/* ============================================
   GIF Upscaler - Modern Stylesheet
   Dark Mode Support with Light Mode Default
   Color Theme: Blue (#3399cc)
   ============================================ */

/* CSS Variables - Light Mode (Default) */
:root {
    --transition-speed: 0.25s;
    
    /* Primary Colors - Blue Theme */
    --primary: #3399cc;
    --primary-light: #E0F2FE;
    --primary-dark: #2980b9;
    --accent: #0ea5e9;
    
    /* Status Colors */
    --success: #339966;
    --success-light: #E8F5E9;
    --warning: #f59e0b;
    --warning-light: #FEF3C7;
    --danger: #e64e4e;
    --danger-light: #FEE2E2;
    
    /* Background Colors */
    --bg: #F0F9FF;
    --bg-elevated: #ffffff;
    --bg-secondary: #F1F5F9;
    --bg-tertiary: #E2E8F0;
    
    /* Text Colors */
    --text: #1E293B;
    --text-secondary: #475569;
    --text-muted: #64748B;
    
    /* Border Colors */
    --border: #BAE6FD;
    --border-light: #E2E8F0;
    
    /* 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, 204, 0.25);
    --shadow-primary-hover: 0 6px 20px rgba(51, 153, 204, 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: #BAE6FD;
    
    /* Scrollbar */
    --scrollbar-track: var(--bg);
    --scrollbar-thumb: var(--text-muted);
    --scrollbar-thumb-hover: var(--text-secondary);
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --primary: #38bdf8;
    --primary-light: rgba(56, 189, 248, 0.15);
    --primary-dark: #0ea5e9;
    --accent: #7dd3fc;
    
    /* 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);
    
    /* 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(56, 189, 248, 0.2);
    --shadow-primary-hover: 0 6px 20px rgba(56, 189, 248, 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;
}

.tool-description a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.tool-description a:hover {
    text-decoration: underline;
}

/* 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.dragover {
    border-color: var(--primary);
    background: var(--bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.upload-area:hover::before,
.upload-area.dragover::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;
}

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

/* Preview Header */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.preview-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

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

.btn-text {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

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

/* Preview Area */
.preview-area {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: var(--bg-secondary);
    min-height: 200px;
    border-bottom: 1px solid var(--border);
}

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

.gif-preview {
    max-width: 400px;
    max-height: 300px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    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 0px;
}

.gif-info {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

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

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

/* Settings Panel */
.settings-panel {
    padding: 2rem;
}

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

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

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

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

.settings-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

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

/* Scale Options */
.scale-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.scale-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.scale-btn:hover {
    border-color: var(--primary);
    background: var(--bg);
}

.scale-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

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

.scale-btn .scale-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.scale-btn.active .scale-value,
.scale-btn.active .scale-label {
    color: var(--primary);
}

/* Custom Scale */
.custom-scale {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

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

.scale-input {
    width: 80px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 2px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    transition: border-color 0.2s ease;
}

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

/* New Resolution Display */
.new-resolution {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.new-resolution svg,
.new-resolution i {
    color: var(--primary);
}

.new-resolution strong {
    color: var(--primary);
    font-weight: 600;
}

/* Enhancement Options */
.enhancement-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.checkbox-option:hover {
    background: var(--bg-tertiary);
}

.checkbox-option input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-custom svg,
.checkbox-custom i {
    width: 12px;
    height: 12px;
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom svg,
.checkbox-option input[type="checkbox"]:checked + .checkbox-custom i {
    opacity: 1;
}

.checkbox-label {
    flex: 1;
}

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

.checkbox-label small {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Quality Slider */
.quality-section {
    margin-top: 0.5rem;
}

.quality-control {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quality-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quality-value {
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
}

.quality-slider {
    width: 100%;
    height: 8px;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    cursor: pointer;
}

.quality-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease;
}

.quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.quality-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-md);
}

.quality-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Info Box */
.info-box {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
}

.info-box-icon {
    flex-shrink: 0;
    color: var(--primary);
}

.info-box-icon svg,
.info-box-icon i {
    width: 18px;
    height: 18px;
}

.info-box-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

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

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

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

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

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

/* Processing Overlay */
.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(4px);
}

.processing-modal {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: 3rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-xl);
}

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

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

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

.processing-status {
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
}

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

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

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

/* Results Section */
.results-section {
    padding: 2rem;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

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

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

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

/* Comparison Area */
.comparison-area {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.comparison-item {
    text-align: center;
}

.comparison-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comparison-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    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: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
}

.comparison-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.comparison-stat {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.comparison-stat strong {
    color: var(--text);
}

.comparison-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.comparison-arrow svg,
.comparison-arrow i {
    width: 32px;
    height: 32px;
}

.scale-badge {
    background: var(--primary);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
}

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #2d8659;
}

/* Error Display */
.error-display {
    display: none;
    padding: 1rem 1.5rem;
    background: var(--danger-light);
    border-radius: var(--radius-md);
    margin: 1rem 2rem;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.error-icon {
    color: var(--danger);
    flex-shrink: 0;
}

.error-message {
    color: var(--danger);
    font-weight: 500;
}

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

.info-card {
    padding: 0;
}

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

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

.info-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 1rem 0;
}

.info-card p:last-child {
    margin-bottom: 0;
}

.info-card a {
    color: var(--primary);
    text-decoration: none;
}

.info-card a:hover {
    text-decoration: underline;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-speed);
}

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

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

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

/* Related Tools */
.related-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

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

.related-tool-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

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

/* 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.open .faq-question svg,
.faq-item.open .faq-question i {
    transform: rotate(180deg);
}

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

.faq-item.open .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;
}

/* Responsive */
@media (max-width: 900px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-area {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .comparison-arrow {
        transform: rotate(90deg);
    }
}

@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;
    }
    
    .settings-panel {
        padding: 1.5rem;
    }
    
    .scale-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-bar {
        flex-direction: column;
        padding: 1.25rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .results-section {
        padding: 1.5rem;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .results-actions .btn {
        width: 100%;
    }
    
    .feature-item {
        flex-direction: column;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .tool-title-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .custom-scale {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 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, 204, 0.2);
    color: var(--text);
}

[data-theme="dark"] ::selection {
    background: rgba(56, 189, 248, 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;
    }
}
