:root {
    --bg-body: #f1f5f9;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.8);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent-color: #4F46E5;
    --accent-glow: rgba(79, 70, 229, 0.15);
    --hal-red: #EF4444;
    --hal-red-glow: rgba(239, 68, 68, 0.6);
}

body {
    font-family: "Inter", "Noto Sans Arabic", sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- PARALLAX BACKGROUND --- */
.parallax-bg {
    position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
    background-image: radial-gradient(circle at 50% 50%, #e0e7ff 0%, transparent 60%);
    z-index: -1; pointer-events: none;
    will-change: transform;
}

/* --- LAYOUT & SCROLLBARS --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.app-wrapper {
    display: flex; height: 100vh; max-width: 1800px; margin: 0 auto;
    position: relative; overflow: hidden;
}

/* --- RESULTS PANEL --- */
.results-sidebar {
    width: 440px; flex-shrink: 0; 
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid #e2e8f0;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.3s ease;
    z-index: 40; display: flex; flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
}

[dir="rtl"] .results-sidebar { border-right: none; border-left: 1px solid #e2e8f0; }

.results-sidebar.collapsed { margin-left: -440px; transform: translateX(-100%); }
[dir="rtl"] .results-sidebar.collapsed { margin-left: 0; margin-right: -440px; transform: translateX(100%); }

/* --- MAIN CONTENT --- */
.main-stage {
    flex-grow: 1; padding: 1rem; overflow-y: auto;
    display: flex; flex-direction: column; align-items: center; position: relative;
}

.content-card {
    width: 100%; max-width: 980px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2rem; margin-bottom: 7rem;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.05);
}

/* --- HAL EYE (Old Design, New Size) --- */
.hal-eye-container {
    width: 70px; height: 70px; /* Reduced by 7% */
    display: flex; justify-content: center; align-items: center;
    position: relative; cursor: pointer; flex-shrink: 0;
}
.hal-eye-bezel {
    width: 100%; height: 100%; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    background: linear-gradient(145deg, #3a3a3a, #1a1a1a);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4), inset 0 2px 4px rgba(0,0,0,0.5);
}
.hal-eye-lens {
    width: 35px; height: 35px; /* Reduced by 7% */
    border-radius: 50%;
    background-color: var(--hal-red);
    box-shadow: 0 0 12px 3px var(--hal-red-glow),
                inset 0 0 5px rgba(0,0,0,0.5);
    animation: hal-eye-calm-breathing 4s infinite ease-in-out;
    transition: transform 0.3s ease;
    position: relative;
}
.hal-eye-lens::after { /* Glint */
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 30%;
    height: 30%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    filter: blur(2px);
}
@keyframes hal-eye-calm-breathing {
    0%, 100% {
        box-shadow: 0 0 12px 3px var(--hal-red-glow);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px 6px var(--hal-red-glow);
        transform: scale(1.05);
    }
}
@keyframes hal-eye-aggressive-pulse {
    0%, 100% { box-shadow: 0 0 18px 6px var(--hal-red-glow), 0 0 6px 2px var(--hal-red); transform: scale(1); }
    50% { box-shadow: 0 0 40px 14px var(--hal-red-glow), 0 0 14px 5px var(--hal-red); transform: scale(1.08); }
}
.hal-eye-lens-aggressive { animation: hal-eye-aggressive-pulse 0.8s infinite ease-in-out !important; }

/* --- FORM ELEMENTS --- */
.premium-input {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    color: #334155; 
    font-weight: 500;
}
.premium-input:hover { 
    border-color: #cbd5e1; 
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.premium-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-glow); 
    outline: none;
    transform: translateY(-1px);
}
.premium-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
    animation: shake 0.5s;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
.glowing-border-red {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3) !important;
    animation: shake 0.5s;
}
.select-wrapper::after {
    content: '\f078'; font-family: "Font Awesome 6 Free"; font-weight: 900;
    position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
    font-size: 0.75rem; color: #94a3b8; pointer-events: none;
}
.select-wrapper:has(.custom-select-container)::after {
    display: none;
}
[dir="rtl"] .select-wrapper::after { right: auto; left: 1rem; }

/* --- CUSTOM DROPDOWN STYLES --- */
.custom-select-container {
    position: relative;
    width: 100%;
}
.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #334155;
    font-weight: 500;
    font-size: 0.875rem;
    min-height: 3rem;
}
.custom-select-trigger:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.custom-select-trigger.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-glow);
    transform: translateY(-1px);
}
.custom-select-trigger.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
    animation: shake 0.5s;
}
.custom-select-trigger .trigger-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}
.custom-select-trigger .trigger-text {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
[dir="rtl"] .custom-select-trigger .trigger-text {
    text-align: right;
}
.custom-select-trigger .trigger-icon {
    font-size: 0.75rem;
    color: #94a3b8;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}
.custom-select-trigger.active .trigger-icon {
    transform: rotate(180deg);
}
.custom-select-options {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.custom-select-options.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.custom-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #334155;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 1px solid #f1f5f9;
}
.custom-option:last-child {
    border-bottom: none;
}
.custom-option:hover {
    background-color: #f8fafc;
    padding-left: 1.25rem;
}
[dir="rtl"] .custom-option:hover {
    padding-left: 1rem;
    padding-right: 1.25rem;
}
.custom-option.selected {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: var(--accent-color);
    font-weight: 600;
}
.custom-option .option-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent-color) 0%, #6366f1 100%);
}
.custom-option .option-icon i {
    font-size: 0.875rem;
}
.custom-option .option-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.custom-select-container .original-select {
    display: none !important;
}

.custom-select-search {
    padding: 0.75rem;
    position: sticky;
    top: 0;
    background: var(--glass-bg);
    z-index: 10;
    border-bottom: 1px solid #e2e8f0;
    backdrop-filter: blur(20px);
}
.custom-select-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    outline: none;
    background: rgba(255, 255, 255, 0.8);
    color: #334155;
    transition: all 0.2s;
}
.custom-select-search input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* --- IMPROVED TOGGLES --- */
.toggle-wrapper {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; background: #ffffff;
    border: 1px solid #e2e8f0; border-radius: 0.75rem;
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.toggle-wrapper:hover { 
    border-color: #94a3b8; 
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Has Options Specific Animation */
#options-toggle-wrapper.active {
    border-color: var(--accent-color);
    background: #f5f3ff;
}
#options-toggle-wrapper .bg-container {
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
}
.toggle-checkbox:checked ~ .bg-container { 
    background-color: var(--accent-color); 
    box-shadow: 0 0 0 4px var(--accent-glow); /* Pulse ring */
}
.toggle-checkbox:checked ~ .dot { 
    transform: translateX(calc(2.75rem - 1rem - 0.5rem)); 
    background-color: white; 
}
.bg-container { 
    width: 2.75rem; height: 1.5rem; border-radius: 9999px; 
    background-color: #cbd5e1; position: relative; 
}
.dot { 
    position: absolute; top: 0.25rem; left: 0.25rem; 
    width: 1rem; height: 1rem; border-radius: 50%; 
    background-color: white; 
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); 
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
[dir="rtl"] .toggle-checkbox:checked ~ .dot { transform: translateX(calc(-2.75rem + 1rem + 0.5rem)); }
[dir="rtl"] .dot { left: auto; right: 0.25rem; }

/* --- TOGGLE WOBBLE ANIMATION (for unchecked "Has options") --- */
@keyframes wobble {
    0%, 100% { 
        transform: rotate(0deg);
    }
    25% { 
        transform: rotate(-3deg);
    }
    75% { 
        transform: rotate(3deg);
    }
}
@keyframes subtle-glow {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
    50% { 
        box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.4);
    }
}
#options-toggle-wrapper:not(.active) .bg-container {
    animation: wobble 0.6s ease-in-out 2s infinite, subtle-glow 3s ease-in-out 2s infinite;
}
#options-toggle-wrapper.active .bg-container {
    animation: none;
}

/* --- TOGGLE TOOLTIPS --- */
.toggle-tooltip {
    position: absolute;
    bottom: calc(100% + 0.75rem);
    right: 0;
    background-color: #1e293b;
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-4px);
    z-index: 10000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.toggle-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 1rem;
    transform: translateX(0);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}
.toggle-wrapper:hover .toggle-tooltip,
.toggle-wrapper.group:hover .toggle-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- FILE GRID & DRAG DROP --- */
.files-list-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.files-scroll-area {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    scroll-behavior: smooth;
}
.files-scroll-area::-webkit-scrollbar { height: 6px; }
.files-scroll-area::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }
.files-scroll-area::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

.file-row {
    min-width: 200px;
    max-width: 240px;
    flex-shrink: 0;
    background: #ffffff; 
    border: 1px solid #e2e8f0; 
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem; 
    position: relative; 
    cursor: grab;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; 
    align-items: center; 
    gap: 0.75rem;
}
.file-row:hover { 
    border-color: #cbd5e1; 
    background-color: #f8fafc;
}
.file-row.dragging { 
    opacity: 0.5; 
    border: 1px dashed var(--accent-color); 
    background: #f5f3ff;
    cursor: grabbing;
}
.file-row-icon {
    width: 3.5rem; height: 3.5rem;
    display: flex; items-center; justify-center;
    font-size: 1.5rem;
    flex-shrink: 0;
    background: #f1f5f9;
    border-radius: 0.5rem;
    color: #64748b;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}
.file-row-icon:hover {
    transform: scale(1.05);
}
.file-row-icon img {
    cursor: pointer;
}
.file-row-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; justify-content: center;
}
.file-row-name {
    font-size: 0.8125rem; font-weight: 500; color: #334155;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-row-meta {
    font-size: 0.6875rem; color: #94a3b8; font-family: monospace; margin-top: 0.125rem;
}
.file-row-remove {
    width: 1.75rem; height: 1.75rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 0.375rem;
    color: #94a3b8;
    transition: all 0.2s;
    cursor: pointer;
    flex-shrink: 0;
}
.file-row-remove:hover {
    background-color: #fee2e2; color: #ef4444;
}

/* --- RESULTS PANEL REDESIGN --- */
.receipt-card {
    background: #ffffff; 
    border: 1px solid #e2e8f0;
    border-radius: 1rem; 
    overflow: hidden; 
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.receipt-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-color: #cbd5e1;
    transform: translateY(-2px);
}
.receipt-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1rem 1.25rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.receipt-header:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding-left: 1.5rem;
}
.receipt-item {
    padding: 1rem 1.25rem; 
    border-bottom: 1px solid #f1f5f9;
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.receipt-item:hover {
    background-color: #f8fafc;
    padding-left: 1.5rem;
}
.receipt-item:last-child { 
    border-bottom: none; 
}

.lang-badge {
    display: inline-block; 
    padding: 0.25rem 0.625rem; 
    border-radius: 0.5rem;
    font-size: 0.75rem; 
    font-weight: 600; 
    letter-spacing: 0.025em;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.badge-en { 
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); 
    color: #4338ca; 
    border: 1px solid rgba(67, 56, 202, 0.1);
}
.badge-ar { 
    background: linear-gradient(135deg, #ecfccb 0%, #d9f99d 100%); 
    color: #3f6212; 
    border: 1px solid rgba(63, 98, 18, 0.1);
}

.price-tag {
    font-family: 'Inter', monospace; 
    font-weight: 700; 
    color: #1e293b;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 0.375rem 0.75rem; 
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-size: 0.875rem;
}

.category-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4rem;
    height: 1.75rem;
    padding: 0 0.625rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.options-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    box-shadow: 0 1px 3px rgba(30, 64, 175, 0.2);
    border: 1px solid rgba(30, 64, 175, 0.2);
}

/* --- NOTE (Always Visible) --- */
.note-accordion {
    background: #fffbeb; border: 1px solid #fcd34d; border-radius: 0.75rem;
    padding: 0.75rem 1rem;
}
.note-content-always-visible {
    display: block;
}

/* --- FLOATING FOOTER --- */
.floating-footer {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
    z-index: 50; width: auto; min-width: 360px;
}

/* --- MOBILE FIX --- */
@media (max-width: 1024px) {
    .app-wrapper { flex-direction: column; }
    .results-sidebar { 
        position: fixed; inset: auto; bottom: 0; left: 0; right: 0; width: 100%; height: 85vh;
        border-radius: 1.5rem 1.5rem 0 0;
        transform: translateY(110%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
        z-index: 100;
        border-top: 1px solid rgba(255,255,255,0.8);
    }
    .results-sidebar::before {
        content: ''; position: absolute; top: 0.75rem; left: 50%; transform: translateX(-50%);
        width: 4rem; height: 0.3rem; background-color: #cbd5e1; border-radius: 99px;
        pointer-events: none; z-index: 50;
    }
    .results-sidebar.active { transform: translateY(0); margin: 0; }
    .main-stage { width: 100%; padding: 1rem; }
    .content-card { padding: 1.5rem; margin-bottom: 8rem; }
    /* Mobile Overlay */
    .mobile-overlay {
        position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); z-index: 90;
        opacity: 0; pointer-events: none; transition: opacity 0.3s;
        backdrop-filter: blur(4px);
    }
    .mobile-overlay.active { opacity: 1; pointer-events: auto; }
}

/* --- UPLOAD ZONE ACTIVE STATE --- */
.upload-zone.has-files {
    border-color: #10b981;
    background-color: #f0fdf4;
    border-style: solid;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}
.upload-zone.has-files .fa-cloud-arrow-up {
    color: #10b981;
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(17, 24, 39, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center; z-index: 1000;
    opacity: 0; transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1); pointer-events: none;
}
.modal-overlay:not(.hidden) { opacity: 1; pointer-events: auto; }
.modal-card {
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    width: 90%; max-width: 640px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    border-radius: 1rem;
    transform: scale(0.96) translateY(10px); opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay:not(.hidden) .modal-card { 
    transform: scale(1) translateY(0); 
    opacity: 1; 
}
.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 2px solid #f1f5f9;
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    border-radius: 1rem 1rem 0 0;
}
.modal-body {
    padding: 1.5rem;
}
.modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    border-radius: 0 0 1rem 1rem;
}
.modal-textarea {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}

/* --- IMAGE PREVIEW MODAL --- */
#image-preview-modal .modal-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
#preview-image {
    cursor: zoom-in;
}

/* --- ADD FILE CARD --- */
.add-file-card {
    min-width: 200px;
    max-width: 240px;
    flex-shrink: 0;
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: 0.5rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}
.add-file-card:hover {
    border-color: var(--accent-color);
    background-color: #f5f3ff;
    transform: translateY(-2px);
}
.add-file-card-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    border-radius: 50%;
    color: var(--accent-color);
    font-size: 1.5rem;
}
.add-file-card-text {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
}
.add-file-card:hover .add-file-card-text {
    color: var(--accent-color);
}