/* ============================================
   Favicon Generator - ConvertICO
   CSS Variables with Dark Mode Support
   ============================================ */

:root {
    --transition-speed: 0.25s;
    
    /* Primary Colors */
    --primary: #3b82f6;
    --primary-light: #dbeafe;
    --primary-dark: #2563eb;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Background */
    --bg: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    
    /* Text */
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Border */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-primary: 0 4px 14px rgba(59, 130, 246, 0.3);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
    
    /* Checker */
    --checker: #e5e7eb;
}

[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-light: rgba(96, 165, 250, 0.15);
    --primary-dark: #3b82f6;
    --success: #4ade80;
    --success-light: rgba(74, 222, 128, 0.15);
    
    --bg: #0f172a;
    --bg-elevated: #1e293b;
    --bg-secondary: #334155;
    --bg-tertiary: #475569;
    
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border: #334155;
    --border-light: #475569;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
    --shadow-primary: 0 4px 14px rgba(96, 165, 250, 0.25);
    
    --checker: #374151;
}

/* Base */
* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Container */
.tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Header */
.tool-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.tool-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.tool-icon-wrapper {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-md);
}

.tool-icon-wrapper i { width: 26px; height: 26px; }

.tool-title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    margin: 0;
    color: var(--primary);
}

.tool-description {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
}

/* Main Tool */
.tool-main {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

/* Upload Section */
.upload-section {
    padding: 2.5rem 2rem;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: var(--bg);
}

.upload-icon {
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-icon i { width: 48px; height: 48px; }

.upload-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.25rem;
}

.upload-subtitle {
    color: var(--text-secondary);
    margin: 0 0 1rem;
}

.file-types {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.file-type-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.upload-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.upload-hint i { width: 14px; height: 14px; }

/* Editor Section */
.editor-section { padding: 0; }

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.file-info i { width: 18px; height: 18px; color: var(--primary); }

.file-meta {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85rem;
}

.editor-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0;
}

/* Crop Panel */
.crop-panel {
    padding: 1.25rem;
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.panel-title i { width: 16px; height: 16px; color: var(--primary); }

.crop-area-wrapper {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    border: 1px solid var(--border);
}

.crop-canvas-container {
    position: relative;
    background: repeating-conic-gradient(var(--checker) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

#cropCanvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.crop-overlay {
    position: absolute;
    inset: 0;
}

.crop-box {
    position: absolute;
    border: 2px solid var(--primary);
    background: transparent;
    cursor: move;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    touch-action: none;
}

.crop-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(to right, rgba(255,255,255,0.25) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.25) 1px, transparent 1px);
    background-size: 33.33% 33.33%;
    pointer-events: none;
}

.crop-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 2px;
    z-index: 10;
    touch-action: none;
}

.crop-handle:hover { transform: scale(1.15); }

.crop-handle.nw { top: -7px; left: -7px; cursor: nw-resize; }
.crop-handle.ne { top: -7px; right: -7px; cursor: ne-resize; }
.crop-handle.sw { bottom: -7px; left: -7px; cursor: sw-resize; }
.crop-handle.se { bottom: -7px; right: -7px; cursor: se-resize; }
.crop-handle.n { top: -7px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.crop-handle.s { bottom: -7px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.crop-handle.e { top: 50%; right: -7px; transform: translateY(-50%); cursor: e-resize; }
.crop-handle.w { top: 50%; left: -7px; transform: translateY(-50%); cursor: w-resize; }

.crop-size-label {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    pointer-events: none;
}

.crop-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.crop-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.crop-info i { width: 14px; height: 14px; }

.crop-buttons {
    display: flex;
    gap: 0.4rem;
}

/* Settings Panel */
.settings-panel {
    padding: 1.25rem;
    background: var(--bg-elevated);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Preview */
.preview-section { }

.preview-grid {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.preview-canvas {
    background: repeating-conic-gradient(var(--checker) 0% 25%, transparent 0% 50%) 50% / 8px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.preview-item span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.browser-preview {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
}

.browser-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tab-icon {
    border-radius: 2px;
}

/* Options */
.options-section { }

.option-group {
    margin-bottom: 1rem;
}

.option-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.bg-options {
    display: flex;
    gap: 0.5rem;
}

.bg-option {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.bg-option input { display: none; }

.bg-option:hover,
.bg-option.active {
    border-color: var(--primary);
    color: var(--primary);
}

.bg-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid var(--border);
}

.bg-swatch.transparent {
    background: repeating-conic-gradient(var(--checker) 0% 25%, white 0% 50%) 50% / 6px 6px;
}

.bg-swatch.white { background: white; }
.bg-swatch.black { background: #1e293b; }

/* Fit Mode Options */
.fit-options {
    display: flex;
    gap: 0.5rem;
}

.fit-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    flex: 1;
    text-align: center;
}

.fit-option input { display: none; }

.fit-option i { width: 16px; height: 16px; }

.fit-option:hover,
.fit-option.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.option-hint {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.package-options {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.package-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.package-option input {
    accent-color: var(--primary);
}

/* Action Bar */
.action-bar {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn i { width: 16px; height: 16px; }

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
    border-color: var(--text-muted);
}

.btn-large {
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
}

.btn-large i { width: 18px; height: 18px; }

.btn-small {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.btn-small i { width: 12px; height: 12px; }

.btn-small:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-text {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
}

.btn-text i { width: 14px; height: 14px; }

.btn-text:hover { background: var(--primary-light); }

/* Processing */
.processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.processing-content {
    background: var(--bg-elevated);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 320px;
    width: 90%;
}

.processing-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.processing-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 1rem;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width 0.2s;
    width: 0;
}

.processing-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

/* Results */
.results-section {
    padding: 2rem;
    text-align: center;
}

.results-header { margin-bottom: 1.5rem; }

.success-icon {
    width: 56px;
    height: 56px;
    background: var(--success-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    color: var(--success);
}

.success-icon i { width: 28px; height: 28px; }

.results-header h2 {
    font-size: 1.35rem;
    margin: 0 0 0.25rem;
    color: var(--text);
}

.results-header p {
    color: var(--text-secondary);
    margin: 0;
}

.generated-files {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.file-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    min-width: 80px;
}

.file-card canvas,
.file-card .file-icon {
    margin-bottom: 0.35rem;
}

.file-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.file-card span {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.code-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
    border: 1px solid var(--border);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.code-header span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}

.code-header span i { width: 16px; height: 16px; color: var(--primary); }

.code-block {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow-x: auto;
    white-space: pre;
    margin: 0;
}

.download-section {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Error */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin: 1rem;
    font-size: 0.9rem;
}

[data-theme="dark"] .error-message {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(248, 113, 113, 0.3);
    color: #f87171;
}

/* Related Tools */
.related-tools {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 0.85rem 1rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    flex-wrap: wrap;
}

.related-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--text);
    font-size: 0.85rem;
}

.related-label i { width: 14px; height: 14px; color: var(--primary); }

.related-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.related-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.related-link i { width: 12px; height: 12px; }

.related-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Info Sections */
.info-sections {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

.info-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.info-card h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    color: var(--text);
    margin: 0 0 1rem;
}

.info-card h2 i { width: 20px; height: 20px; color: var(--primary); }

/* Steps List */
.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step;
}

.steps-list li {
    position: relative;
    padding-left: 2.5rem;
    padding-bottom: 0.85rem;
    counter-increment: step;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.steps-list li:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 11px;
    top: 1.75rem;
    bottom: 0;
    width: 2px;
    background: var(--primary-light);
}

.steps-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}

/* Size Grid */
.size-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.size-item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.size-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.size-info strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.1rem;
}

.size-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Appearances Grid */
.appearances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.appearance-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.appearance-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.appearance-icon i {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.appearance-content strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.appearance-content p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Pro Tip */
.pro-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.pro-tip i {
    width: 18px;
    height: 18px;
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 2px;
}

.pro-tip span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.pro-tip a {
    color: var(--primary);
    text-decoration: none;
}

.pro-tip a:hover {
    text-decoration: underline;
}

/* FAQ */
.faq-list { display: grid; gap: 0.5rem; }

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: none;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question:hover { background: var(--bg); }

.faq-question i {
    width: 16px;
    height: 16px;
    color: var(--primary);
    transition: transform 0.2s;
}

.faq-item.open .faq-question i { transform: rotate(180deg); }

.faq-answer {
    display: none;
    padding: 0 1rem 0.75rem;
    background: var(--bg-elevated);
}

.faq-item.open .faq-answer { display: block; }

.faq-answer p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
}

.faq-answer code {
    background: var(--bg-secondary);
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .tool-container { padding: 1rem; }
    
    .editor-body {
        grid-template-columns: 1fr;
    }
    
    .crop-panel {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .action-bar {
        flex-direction: column;
    }
    
    .btn { width: 100%; }
    
    .related-tools {
        flex-direction: column;
        text-align: center;
    }
    
    .related-links { justify-content: center; }
    
    .size-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .upload-section { padding: 1.5rem 1rem; }
    
    .editor-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .bg-options { flex-wrap: wrap; }
    
    .download-section { flex-direction: column; }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.editor-section, .results-section {
    animation: fadeIn 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
