/* ============================================
   4K Image Upscaler - Modern Styling
   Dark mode support with light mode default
   ============================================ */

/* CSS Variables - Light Mode (Default) */
:root {
    --transition-speed: 0.25s;
    
    /* Primary Colors */
    --primary: #3399cc;
    --primary-light: #E0F2FE;
    --primary-dark: #2980b9;
    --accent: #38BDF8;
    
    /* Status Colors */
    --success: #339966;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #e64e4e;
    --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, 204, 0.25);
    --shadow-primary-hover: 0 6px 20px rgba(51, 153, 204, 0.35);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    
    /* Category Colors */
    --color-1: #e64e4e;
    --color-2: #3399cc;
    --color-3: #339966;
}

/* Dark Mode */
[data-theme="dark"] {
    --primary: #38BDF8;
    --primary-light: rgba(56, 189, 248, 0.12);
    --primary-dark: #0EA5E9;
    --accent: #7DD3FC;
    
    --success: #34D399;
    --success-light: rgba(52, 211, 153, 0.12);
    --warning: #FBBF24;
    --warning-light: rgba(251, 191, 36, 0.12);
    --danger: #F87171;
    --danger-light: rgba(248, 113, 113, 0.12);
    --info: #60A5FA;
    --info-light: rgba(96, 165, 250, 0.12);
    
    --bg: #0F172A;
    --bg-elevated: #1E293B;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    
    --text: #E2E8F0;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    --border: #334155;
    --border-light: #1E293B;
    
    --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.4);
    --shadow-primary: 0 4px 14px rgba(56, 189, 248, 0.2);
    --shadow-primary-hover: 0 6px 20px rgba(56, 189, 248, 0.3);
}

/* ============================================
   TOOL CONTAINER
   ============================================ */

.tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

/* ============================================
   TOOL HEADER
   ============================================ */

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

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

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

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

.tool-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    transition: color var(--transition-speed);
}

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

/* ============================================
   UPLOAD SECTION
   ============================================ */

.upload-section {
    margin-bottom: 1.5rem;
}

.upload-area {
    background: var(--bg-elevated);
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed);
}

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

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

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

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

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

.file-type-badge {
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-speed);
}

.upload-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color var(--transition-speed);
}

/* ============================================
   FILE INFO BAR
   ============================================ */

.file-info-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    transition: background-color var(--transition-speed);
}

.file-info-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: color var(--transition-speed);
}

.file-info-item svg,
.file-info-item i {
    color: var(--primary);
    flex-shrink: 0;
}

/* ============================================
   EDITOR GRID
   ============================================ */

.editor-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .editor-grid {
        grid-template-columns: 1fr;
    }
}

/* Preview Panel */
.preview-panel {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all var(--transition-speed);
}

.preview-container {
    padding: 1.5rem;
}

.preview-image-wrapper {
    min-height: 200px;
    max-height: 400px;
    background: repeating-conic-gradient(var(--bg-tertiary) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all var(--transition-speed);
}

.preview-image-wrapper img {
    max-width: 100%;
    max-height: 400px;
    display: block;
    object-fit: contain;
}

/* Settings Panel */
.settings-panel {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    transition: all var(--transition-speed);
}

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

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

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

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

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

/* Scale Options */
.scale-section {
    margin-bottom: 1.5rem;
}

.scale-options {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.scale-option {
    flex: 1;
    cursor: pointer;
}

.scale-option input { display: none; }

.scale-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.scale-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    transition: color var(--transition-speed);
}

.scale-option:hover .scale-box {
    border-color: var(--primary);
}

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

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

.output-dimensions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    color: var(--primary);
    font-size: 0.85rem;
    transition: all var(--transition-speed);
}

.output-dimensions.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.output-dimensions svg,
.output-dimensions i {
    flex-shrink: 0;
}

/* Algorithm/Model Options */
.algorithm-section {
    margin-bottom: 1.5rem;
}

.algorithm-options {
    display: grid;
    gap: 0.6rem;
}

.algorithm-option {
    cursor: pointer;
}

.algorithm-option input { display: none; }

.algorithm-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.algorithm-option:hover .algorithm-box {
    border-color: var(--primary);
}

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

.algorithm-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

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

.algorithm-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
    transition: color var(--transition-speed);
}

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

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

.format-option {
    cursor: pointer;
}

.format-option input { display: none; }

.format-label {
    display: block;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

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

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

/* Engine Info */
.engine-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    transition: all var(--transition-speed);
}

.engine-info svg,
.engine-info i {
    color: var(--primary);
    flex-shrink: 0;
}

/* Action Button */
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: var(--shadow-primary);
}

.action-btn:hover {
    filter: brightness(1.1);
    box-shadow: var(--shadow-primary-hover);
    transform: translateY(-1px);
}

.secondary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 0.6rem;
    transition: all 0.2s ease;
}

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

/* ============================================
   PROCESSING OVERLAY
   ============================================ */

.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

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

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

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

.processing-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.4rem;
    transition: color var(--transition-speed);
}

.processing-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 1.25rem;
    transition: color var(--transition-speed);
}

.progress-bar-container {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    transition: background-color var(--transition-speed);
}

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

.progress-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
}

/* ============================================
   RESULTS SECTION
   ============================================ */

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

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

.results-header h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--success);
    margin: 0;
}

/* ============================================
   COMPARISON SLIDER
   ============================================ */

.comparison-container {
    margin-bottom: 1.5rem;
}

.comparison-wrapper {
    position: relative;
    width: 100%;
    max-height: 550px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    cursor: ew-resize;
    user-select: none;
    -webkit-user-select: none;
    background: repeating-conic-gradient(var(--bg-tertiary) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
    transition: border-color var(--transition-speed);
}

.comparison-image {
    position: relative;
}

.comparison-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 550px;
    object-fit: contain;
}

.comparison-after {
    position: relative;
}

.comparison-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
}

.comparison-before img {
    position: absolute;
    top: 0;
    left: 0;
    width: auto;
    min-width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left;
}

.comparison-label {
    position: absolute;
    bottom: 12px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    z-index: 5;
    backdrop-filter: blur(8px);
}

.before-label {
    left: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

.after-label {
    right: 12px;
    background: rgba(51, 153, 204, 0.85);
    color: #fff;
}

.comparison-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 3px;
    height: 100%;
    background: #fff;
    z-index: 10;
    cursor: ew-resize;
    box-shadow: 0 0 6px rgba(0,0,0,0.4);
    transform: translateX(-50%);
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    color: var(--primary);
}

.comparison-wrapper.dragging .slider-handle {
    transform: translate(-50%, -50%) scale(1.1);
}

/* ============================================
   RESULT STATS
   ============================================ */

.result-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 1.25rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    transition: all var(--transition-speed);
}

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

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
    transition: color var(--transition-speed);
}

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

.stat-divider {
    width: 1px;
    height: 30px;
    background: var(--border);
    transition: background-color var(--transition-speed);
}

/* Download Actions */
.download-actions {
    max-width: 400px;
    margin: 0 auto;
}

.download-btn {
    background: var(--success);
    box-shadow: 0 4px 14px rgba(51, 153, 102, 0.3);
}

.download-btn:hover {
    box-shadow: 0 6px 20px rgba(51, 153, 102, 0.4);
}

/* ============================================
   RELATED SECTION
   ============================================ */

.related-section {
    margin: 2rem 0;
    padding: 1.25rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-speed);
}

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

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

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

.related-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

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

.related-link svg,
.related-link i {
    color: var(--primary);
    flex-shrink: 0;
}

/* ============================================
   INFO SECTIONS
   ============================================ */

.info-sections {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.info-card {
    padding: 1.5rem;
    transition: color var(--transition-speed);
}

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

.info-card h2 svg,
.info-card h2 i {
    color: var(--primary);
    flex-shrink: 0;
}

.info-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 0.75rem;
    transition: color var(--transition-speed);
}

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

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

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

/* Steps List */
.steps-list {
    margin: 0;
    padding: 0 0 0 1.5rem;
    color: var(--text-secondary);
    transition: color var(--transition-speed);
}

.steps-list li {
    padding: 0.35rem 0;
    line-height: 1.5;
}

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

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

/* Mode Explanations */
.mode-explanations {
    display: grid;
    gap: 1rem;
}

.mode-explain {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-speed);
}

.mode-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.mode-tag.general-tag {
    background: rgba(51, 153, 204, 0.12);
    color: var(--color-2);
}

.mode-tag.anime-tag {
    background: rgba(139, 92, 246, 0.12);
    color: #8B5CF6;
}

.mode-tag.tip-tag {
    background: rgba(51, 153, 102, 0.12);
    color: var(--color-3);
}

.mode-explain p {
    margin: 0.3rem 0 0;
    font-size: 0.9rem;
}

/* ============================================
   FAQ
   ============================================ */

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

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

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

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

.faq-question svg,
.faq-question i {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.faq-item.active .faq-question svg,
.faq-item.active .faq-question i,
.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.active .faq-answer,
.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 0.75rem 1rem;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

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

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

/* ============================================
   ERROR TOAST
   ============================================ */

.error-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: var(--danger);
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 20000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 90%;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.toast-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    opacity: 0.7;
    display: flex;
}

.toast-close:hover {
    opacity: 1;
}

/* Inline error - shown at bottom of editor */
.inline-error {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    background: var(--danger-light, #FEE2E2);
    border-radius: var(--radius-md);
    animation: fadeIn 0.3s ease;
}

[data-theme="dark"] .inline-error {
    background: rgba(220, 38, 38, 0.15);
}

.inline-error-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--danger);
}

.inline-error-content p {
    margin: 0;
    line-height: 1.5;
}

.inline-error-content .error-contact {
    margin-top: 0.4rem;
    color: var(--text-secondary);
}

.inline-error-content .error-contact a {
    color: var(--primary);
    text-decoration: underline;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .tool-container {
        padding: 1.25rem 1rem 2rem;
    }
    
    .tool-title {
        font-size: 1.35rem;
    }
    
    .upload-area {
        padding: 2rem 1.5rem;
    }
    
    .file-info-bar {
        gap: 0.75rem;
    }
    
    .result-stats {
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .stat-divider {
        display: none;
    }
    
    .comparison-wrapper {
        max-height: 350px;
    }
    
    .comparison-image img {
        max-height: 350px;
    }
}

@media (max-width: 480px) {
    .scale-options {
        gap: 0.4rem;
    }
    
    .format-options {
        gap: 0.35rem;
    }
    
    .format-label {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}
