/* ============================================
   GIF to Favicon - Modern Styling with Dark Mode
   ============================================ */

/* CSS Variables - Light Mode (Default) */
:root {
    --transition-speed: 0.25s;
    
    /* Primary Colors - Green Theme for Favicon tools */
    --primary: #339966;
    --primary-light: #e8f5e9;
    --primary-dark: #2d8659;
    --accent: #4ade80;
    
    /* Status Colors */
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #3399cc;
    --info-light: #DBEAFE;
    
    /* Background Colors */
    --bg: #F8FAFC;
    --bg-elevated: #FFFFFF;
    --bg-secondary: #F1F5F9;
    --bg-tertiary: #E2E8F0;
    
    /* Text Colors */
    --text: #1E293B;
    --text-secondary: #475569;
    --text-muted: #64748B;
    
    /* Border Colors */
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    --shadow-primary: 0 4px 14px rgba(51, 153, 102, 0.25);
    --shadow-primary-hover: 0 6px 20px rgba(51, 153, 102, 0.35);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Checkerboard for transparency */
    --checker-light: #f0f0f0;
    --checker-dark: #e0e0e0;
    
    /* Input */
    --input-bg: #FFFFFF;
    --input-border: #E2E8F0;
    
    /* Scrollbar */
    --scrollbar-track: var(--bg);
    --scrollbar-thumb: var(--text-muted);
    --scrollbar-thumb-hover: var(--text-secondary);
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --primary: #4ade80;
    --primary-light: rgba(74, 222, 128, 0.15);
    --primary-dark: #339966;
    --accent: #86efac;
    
    /* Status Colors */
    --success: #4ADE80;
    --success-light: rgba(74, 222, 128, 0.15);
    --warning: #FBBF24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #F87171;
    --danger-light: rgba(248, 113, 113, 0.15);
    --info: #60A5FA;
    --info-light: rgba(96, 165, 250, 0.15);
    
    /* Background Colors */
    --bg: #0F172A;
    --bg-elevated: #1E293B;
    --bg-secondary: #334155;
    --bg-tertiary: #475569;
    
    /* Text Colors */
    --text: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    
    /* Border Colors */
    --border: #334155;
    --border-light: #475569;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5);
    --shadow-primary: 0 4px 14px rgba(74, 222, 128, 0.2);
    --shadow-primary-hover: 0 6px 20px rgba(74, 222, 128, 0.3);
    
    /* Checkerboard for transparency */
    --checker-light: #334155;
    --checker-dark: #475569;
    
    /* Input */
    --input-bg: #334155;
    --input-border: #475569;
    
    /* Scrollbar */
    --scrollbar-track: var(--bg-elevated);
    --scrollbar-thumb: var(--text-muted);
    --scrollbar-thumb-hover: var(--text-secondary);
}

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

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

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

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

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

.tool-icon-wrapper {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-primary);
    flex-shrink: 0;
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.tool-icon-wrapper svg,
.tool-icon-wrapper i {
    width: 28px;
    height: 28px;
}

.tool-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin: 0;
    color: var(--primary);
    letter-spacing: -0.02em;
}

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

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

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

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-light);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: var(--bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.upload-area:hover::before,
.upload-area.drag-over::before {
    opacity: 0.5;
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    color: var(--primary);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.upload-area:hover .upload-icon {
    transform: translateY(-5px);
}

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

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

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

.file-type-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

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

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

/* Editor Section */
.editor-section {
    background: var(--bg-elevated);
    transition: background-color var(--transition-speed);
}

/* File Info Bar */
.file-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

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

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

/* Editor Grid */
.editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

/* Panel Styles */
.preview-panel,
.controls-panel {
    padding: 1.5rem;
}

.preview-panel {
    border-right: 1px solid var(--border);
    transition: border-color var(--transition-speed);
}

.panel-header {
    margin-bottom: 1.25rem;
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.panel-header h3 svg,
.panel-header h3 i {
    color: var(--primary);
}

/* Preview Container */
.preview-container {
    text-align: center;
}

.preview-wrapper {
    display: inline-block;
    background-image: 
        linear-gradient(45deg, var(--checker-light) 25%, transparent 25%),
        linear-gradient(-45deg, var(--checker-light) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--checker-light) 75%),
        linear-gradient(-45deg, transparent 75%, var(--checker-light) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: border-color var(--transition-speed);
    max-width: 100%;
}

#gifPreview {
    display: block;
    max-width: 100%;
    max-height: 200px;
}

.preview-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.preview-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.preview-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Favicon Preview Section */
.favicon-preview-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

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

.browser-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text);
    border: 1px solid var(--border);
}

.tab-favicon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tab-favicon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.tab-title {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.browser-tab svg,
.browser-tab i {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Section Labels */
.section-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.section-label svg,
.section-label i {
    color: var(--primary);
    width: 16px;
    height: 16px;
}

/* Sizes Section */
.sizes-section {
    margin-bottom: 1.5rem;
}

.size-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.size-option input {
    display: none;
}

.size-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-elevated);
    text-align: center;
}

.size-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.size-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.size-option:hover .size-card {
    border-color: var(--primary);
}

.size-option input:checked + .size-card {
    border-color: var(--primary);
    background: var(--primary-light);
}

.size-option input:checked + .size-card .size-value {
    color: var(--primary);
}

.sizes-hint {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Format Section */
.format-section {
    margin-bottom: 1.5rem;
}

.format-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.format-option input {
    display: none;
}

.format-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-elevated);
    text-align: center;
}

.format-card svg,
.format-card i {
    color: var(--text-muted);
    width: 24px;
    height: 24px;
}

.format-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.format-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.format-option:hover .format-card {
    border-color: var(--primary);
}

.format-option input:checked + .format-card {
    border-color: var(--primary);
    background: var(--primary-light);
}

.format-option input:checked + .format-card svg,
.format-option input:checked + .format-card i {
    color: var(--primary);
}

/* Frame Section */
.frame-section {
    margin-bottom: 1.5rem;
}

.frame-option {
    margin-bottom: 0.75rem;
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.option-row label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.option-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.option-input-group input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--text);
    font-size: 0.9rem;
    text-align: center;
    transition: border-color 0.2s ease;
}

.option-input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.option-unit {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.option-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Toggle */
.toggle-option {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: var(--radius-full);
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.toggle-label input:checked + .toggle-switch {
    background: var(--primary);
}

.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(20px);
}

/* Output Summary */
.output-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-speed);
}

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

.summary-item svg,
.summary-item i {
    color: var(--primary);
    width: 18px;
    height: 18px;
}

.summary-content {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

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

.btn svg,
.btn i {
    width: 18px;
    height: 18px;
}

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

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

.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-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

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

.processing-content {
    background: var(--bg-elevated);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    text-align: center;
    max-width: 350px;
    box-shadow: var(--shadow-xl);
    transition: background-color var(--transition-speed);
}

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

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

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

.processing-subtext {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 1.25rem 0;
}

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

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

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

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

.success-icon {
    width: 72px;
    height: 72px;
    background: var(--success);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: white;
    transition: background-color var(--transition-speed);
}

.success-icon svg,
.success-icon i {
    width: 36px;
    height: 36px;
}

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

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

/* Results Preview */
.results-preview {
    margin-bottom: 2rem;
}

.preview-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.browser-mockup {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    max-width: 400px;
    margin: 0 auto;
}

.browser-header {
    background: var(--bg-tertiary);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
}

.browser-dots {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.browser-tabs {
    flex: 1;
}

.browser-tabs .browser-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-size: 0.85rem;
    color: var(--text);
    border: none;
}

.browser-tabs .browser-tab.active {
    background: var(--bg-secondary);
}

.result-favicon {
    width: 16px;
    height: 16px;
}

.result-favicon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.browser-content {
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
}

.browser-url {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.browser-url svg,
.browser-url i {
    color: var(--success);
}

/* Download Files */
.download-files {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.download-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.download-file:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.file-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.file-icon svg,
.file-icon i {
    width: 24px;
    height: 24px;
}

.file-details {
    text-align: center;
}

.file-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.download-link:hover {
    background: var(--primary-dark);
}

/* Implementation Guide */
.implementation-guide {
    margin-bottom: 2rem;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

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

.guide-header svg,
.guide-header i {
    color: var(--primary);
}

.code-block {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
    overflow: hidden;
}

.code-block pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    color: var(--text);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Results Actions */
.results-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Error Message */
.error-message {
    background: var(--danger-light);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin: 1.25rem;
    font-weight: 500;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

/* Related Tools */
.related-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

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

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

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

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

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

.related-link svg,
.related-link i {
    width: 16px;
    height: 16px;
}

/* Info Sections */
.info-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

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

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

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

.steps-list li {
    position: relative;
    padding-left: 3.25rem;
    margin-bottom: 1rem;
    counter-increment: step;
    color: var(--text-secondary);
    line-height: 1.6;
}

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

.steps-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 1;
}

.steps-list li:last-child {
    margin-bottom: 0;
}

.steps-list li a {
    color: var(--primary);
    text-decoration: none;
}

.steps-list li a:hover {
    text-decoration: underline;
}

.steps-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--warning-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.steps-tip svg,
.steps-tip i {
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 2px;
}

.steps-tip a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

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

/* Browser Support Grid */
.browser-support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.browser-support-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-align: center;
}

.browser-support-item svg,
.browser-support-item i {
    color: var(--text-muted);
}

.browser-support-item.supported svg,
.browser-support-item.supported i {
    color: var(--success);
}

.browser-support-item.partial svg,
.browser-support-item.partial i {
    color: var(--warning);
}

.browser-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.support-status {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 500;
}

.browser-support-item.supported .support-status {
    background: var(--success-light);
    color: var(--success);
}

.browser-support-item.partial .support-status {
    background: var(--warning-light);
    color: var(--warning);
}

.browser-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.browser-note a {
    color: var(--primary);
    text-decoration: none;
}

.browser-note a:hover {
    text-decoration: underline;
}

/* Benefits List */
.benefits-list {
    display: grid;
    gap: 1.25rem;
}

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

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

.benefit-content h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    color: var(--text);
}

.benefit-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition-speed);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    text-align: left;
    transition: all 0.2s ease;
}

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

.faq-question svg,
.faq-question i {
    flex-shrink: 0;
    color: var(--primary);
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

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

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 300px;
}

.faq-answer p {
    padding: 1rem 1.25rem;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.faq-answer a {
    color: var(--primary);
    text-decoration: none;
}

.faq-answer a:hover {
    text-decoration: underline;
}

.faq-answer code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
    .editor-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-panel {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
    }
    
    .tool-title-row {
        gap: 0.75rem;
    }
    
    .tool-icon-wrapper {
        width: 50px;
        height: 50px;
    }
    
    .tool-icon-wrapper svg,
    .tool-icon-wrapper i {
        width: 24px;
        height: 24px;
    }
    
    .upload-section {
        padding: 2rem 1.5rem;
    }
    
    .upload-area {
        padding: 2.5rem 1.5rem;
    }
    
    .file-info-bar {
        gap: 1rem;
        padding: 0.875rem 1rem;
    }
    
    .preview-panel,
    .controls-panel {
        padding: 1.25rem 1rem;
    }
    
    .size-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .format-options {
        grid-template-columns: 1fr;
    }
    
    .output-summary {
        grid-template-columns: 1fr;
    }
    
    .action-bar {
        flex-direction: column;
        padding: 1.25rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .results-actions .btn {
        width: 100%;
    }
    
    .related-tools {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .browser-support-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .benefit-item {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .info-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .tool-title-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .download-files {
        grid-template-columns: 1fr;
    }
    
    .browser-support-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Selection */
::selection {
    background: rgba(51, 153, 102, 0.2);
    color: var(--text);
}

[data-theme="dark"] ::selection {
    background: rgba(74, 222, 128, 0.3);
}

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

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

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