/* ========================================
   CSS Variables & Root Styles
   Deep Navy Tech Theme
   ======================================== */
:root {
    /* Colors - Deep Navy Tech Theme */
    --bg-primary: #F1F5F9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #E8EEF4;
    --bg-card: #ffffff;
    --bg-hover: #DCE4ED;

    --accent-primary: #1E3A5F;
    --accent-secondary: #0EA5E9;
    --accent-light: #7DD3FC;
    --accent-dark: #14293F;

    --success: #059669;
    --success-light: rgba(5, 150, 105, 0.08);
    --warning: #D97706;
    --warning-light: rgba(217, 119, 6, 0.08);
    --danger: #DC2626;
    --danger-light: rgba(220, 38, 38, 0.08);
    --info: #0EA5E9;
    --info-light: rgba(14, 165, 233, 0.08);

    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #94A3B8;

    --border-color: #CBD5E1;
    --border-light: #E2E8F0;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;

    /* Shadows - Navy-tinted shadows */
    --shadow-sm: 0 1px 3px rgba(30, 58, 95, 0.08), 0 1px 2px rgba(30, 58, 95, 0.06);
    --shadow-md: 0 4px 12px rgba(30, 58, 95, 0.10), 0 2px 4px rgba(30, 58, 95, 0.06);
    --shadow-lg: 0 10px 30px rgba(30, 58, 95, 0.12), 0 4px 8px rgba(30, 58, 95, 0.06);
    --shadow-inner: inset 0 1px 3px rgba(30, 58, 95, 0.06);

    /* Header & Footer */
    --header-height: 64px;
    --footer-height: 40px;

    /* Sidebar */
    --sidebar-width: 300px;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans TC', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Header
   ======================================== */
.header {
    height: var(--header-height);
    background: var(--accent-primary);
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--spacing-lg);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.25);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.app-icon {
    font-size: 24px;
}

.header-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.privacy-badge {
    background: rgba(14, 165, 233, 0.25);
    color: #7DD3FC;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
}

/* ========================================
   Main Layout
   ======================================== */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex-shrink: 0;
    box-shadow: 2px 0 8px rgba(30, 58, 95, 0.04);
}

.sidebar-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--accent-secondary);
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-group {
    margin-bottom: var(--spacing-lg);
}

.setting-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.quality-value {
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(14, 165, 233, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.setting-hint {
    font-size: 11px;
    color: var(--success);
    margin-top: var(--spacing-xs);
    padding: 4px 8px;
    background: var(--success-light);
    border-radius: var(--radius-sm);
}

.quality-override-hint {
    font-size: 11px;
    color: var(--warning);
    margin-top: var(--spacing-xs);
    padding: 4px 8px;
    background: var(--warning-light);
    border-radius: var(--radius-sm);
}

/* Select Input */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--text-muted);
    pointer-events: none;
}

.select-input {
    width: 100%;
    padding: 10px 32px 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    transition: all var(--transition-fast);
}

.select-input:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.select-input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* Slider */
.slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    outline: none;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-secondary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    border-color: var(--accent-primary);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-secondary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-xs);
    font-size: 11px;
    color: var(--text-muted);
}

/* Disabled state for settings group */
.settings-group.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.settings-group.disabled .slider {
    cursor: not-allowed;
}

.settings-group.disabled .quality-value {
    background: var(--border-color);
    color: var(--text-muted);
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    margin-bottom: 0 !important;
}

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

.checkbox-custom {
    width: 20px;
    height: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.checkbox-custom::after {
    content: '✓';
    font-size: 12px;
    color: white;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

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

.checkbox-label input[type="checkbox"]:checked+.checkbox-custom::after {
    opacity: 1;
}

.settings-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--spacing-lg) 0;
}

/* Preset Buttons */
.preset-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
}

.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--spacing-sm) var(--spacing-xs);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.preset-btn.active {
    background: rgba(14, 165, 233, 0.08);
    border-color: var(--accent-secondary);
    color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.preset-icon {
    font-size: 18px;
}

/* ========================================
   Main Content Area
   ======================================== */
.content {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    background: var(--bg-primary);
    position: relative;
}

/* ========================================
   Browser Warning
   ======================================== */
.browser-warning {
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.browser-warning.hidden {
    display: none;
}

.warning-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.warning-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.warning-content p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========================================
   Drop Zone
   ======================================== */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    text-align: center;
    transition: all var(--transition-normal);
    background: var(--bg-card);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.drag-over {
    border-color: var(--accent-secondary);
    background: rgba(14, 165, 233, 0.04);
}

.drop-zone:focus-visible {
    outline: 2px solid var(--accent-secondary);
    outline-offset: 2px;
}

.drop-zone.drag-over {
    transform: scale(1.01);
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.15);
    border-color: var(--accent-secondary);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.drop-icon {
    color: var(--text-muted);
    transition: all var(--transition-normal);
}

.drop-zone:hover .drop-icon,
.drop-zone.drag-over .drop-icon {
    color: var(--accent-secondary);
    transform: translateY(-5px);
}

.drop-zone h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.drop-zone p {
    color: var(--text-muted);
}

.supported-formats {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.btn-icon {
    font-size: 16px;
}

.btn-primary {
    background: var(--accent-secondary);
    color: white;
    box-shadow: 0 2px 6px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    background: #0284C7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

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

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

.btn-danger:hover {
    background: #b04a4a;
}

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

.btn-success:hover {
    background: #3a8a6c;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-sm .btn-icon {
    font-size: 14px;
}

/* ========================================
   File List
   ======================================== */
.file-list-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.file-list-container.hidden {
    display: none;
}

.file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--accent-primary);
    border-bottom: none;
}

.file-list-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.file-count {
    font-size: 12px;
    font-weight: 600;
    background: var(--accent-secondary);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.file-list-header .btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.25);
}

.file-list-header .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.header-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.file-list {
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: var(--bg-hover);
}

.file-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    gap: var(--spacing-md);
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    flex-wrap: wrap;
}

.file-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.file-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.file-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 16px;
}

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

.file-action-btn.remove:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* File Thumbnail */
.file-thumbnail {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

/* ========================================
   Progress Panel
   ======================================== */
.progress-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.progress-panel.hidden {
    display: none;
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.progress-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.queue-progress {
    font-size: 12px;
    font-weight: 500;
    background: var(--accent-secondary);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.current-file {
    margin-bottom: var(--spacing-md);
}

.current-file .file-name {
    font-size: 14px;
    color: var(--text-secondary);
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-secondary);
    min-width: 50px;
    text-align: right;
}

.progress-details {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 13px;
}

.detail-label {
    color: var(--text-muted);
}

.detail-value {
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-value.highlight {
    color: var(--accent-secondary);
    font-weight: 600;
}

/* ========================================
   Results Panel
   ======================================== */
.results-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.results-panel.hidden {
    display: none;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--accent-primary);
    border-bottom: none;
}

.results-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.results-header h3::before {
    content: '✓';
    color: #34D399;
}

.results-header .btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.25);
}

.results-header .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.results-list {
    max-height: 400px;
    overflow-y: auto;
}

.result-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.result-item:last-child {
    border-bottom: none;
}

.result-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-stats {
    display: flex;
    gap: var(--spacing-lg);
    font-size: 12px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value.success {
    color: var(--success);
}

.result-actions {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    height: var(--footer-height);
    background: var(--accent-dark);
    border-top: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.footer-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.footer-divider {
    color: rgba(255, 255, 255, 0.2);
}

.footer-content a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-content a:hover {
    color: #ffffff;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    z-index: 1000;
    pointer-events: none;
}

.toast {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    animation: slideIn 0.3s ease;
    pointer-events: auto;
}

.toast.success {
    border-color: var(--success);
    background: linear-gradient(135deg, var(--success-light), var(--bg-secondary));
}

.toast.error {
    border-color: var(--danger);
    background: linear-gradient(135deg, var(--danger-light), var(--bg-secondary));
}

.toast.warning {
    border-color: var(--warning);
    background: linear-gradient(135deg, var(--warning-light), var(--bg-secondary));
}

.toast.info {
    border-color: var(--info);
    background: linear-gradient(135deg, var(--info-light), var(--bg-secondary));
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

.toast-icon {
    font-size: 18px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-primary);
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-full);
}

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

/* ========================================
   Utilities
   ======================================== */
.hidden {
    display: none !important;
}

/* ========================================
   Loading Overlay
   ======================================== */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(241, 245, 249, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    z-index: 100;
    backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
    display: none !important;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 14px;
}

.loading-progress {
    width: 200px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.loading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* ========================================
   File Estimate
   ======================================== */
.file-estimate {
    display: flex;
    gap: var(--spacing-sm);
    font-size: 12px;
    margin-top: 4px;
    padding: 4px 8px;
    background: var(--success-light);
    border-radius: var(--radius-sm);
    width: fit-content;
}

.estimate-label {
    color: var(--text-muted);
}

.estimate-value {
    color: var(--success);
    font-weight: 600;
}

.estimate-percent {
    color: var(--success);
    font-weight: 500;
}

.file-min-size {
    font-size: 11px;
    margin-top: 2px;
    padding: 3px 6px;
    background: var(--warning-light);
    border-radius: var(--radius-sm);
    display: inline-flex;
    gap: 4px;
}

.min-size-label {
    color: var(--text-muted);
}

.min-size-value {
    color: var(--warning);
    font-weight: 600;
}

/* ========================================
   Number Inputs & Input Rows
   ======================================== */
.number-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.number-input:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.number-input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.number-input::placeholder {
    color: var(--text-muted);
}

.number-input.wide {
    flex: 1;
}

.input-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.input-group {
    flex: 1;
}

.input-group label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.input-separator {
    color: var(--text-muted);
    font-weight: 500;
    padding-top: 18px;
}

.select-input.small {
    width: auto;
    min-width: 80px;
    padding: 8px 28px 8px 12px;
}

/* Resize & Target Size Options */
.resize-options,
.target-size-options {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-top: var(--spacing-sm);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 900px) {
    .main-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .preset-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .header-content {
        padding: 0 var(--spacing-sm);
    }

    .header-title {
        font-size: 15px;
    }

    .sidebar {
        padding: var(--spacing-md);
    }

    .content {
        padding: var(--spacing-md);
    }

    .drop-zone {
        padding: var(--spacing-lg);
        min-height: 200px;
    }

    .drop-zone h3 {
        font-size: 16px;
    }

    .file-list-header {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
    }

    .progress-details {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .result-item {
        flex-wrap: wrap;
    }

    .result-actions {
        width: 100%;
        margin-top: var(--spacing-sm);
    }

    .result-actions .btn {
        flex: 1;
        justify-content: center;
    }
}