:root {
    --bg-main: #f8f9fa;
    --bg-white: #ffffff;
    --primary: #4361ee;
    --primary-soft: rgba(67, 97, 238, 0.1);
    --secondary: #7209b7;
    --text-main: #2b2d42;
    --text-muted: #8d99ae;
    --border: #edf2f4;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-3d: 0 20px 40px rgba(67, 97, 238, 0.15);
    --danger: #ef233c;
    --success: #4cc9f0;
}

body.dark-mode {
    --bg-main: #0d1117;
    --bg-white: #161b22;
    --text-main: #f0f6fc;
    --text-muted: #8b949e;
    --border: #30363d;
    --primary-soft: rgba(67, 97, 238, 0.2);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-3d: 0 20px 40px rgba(0, 0, 0, 0.4);
}

body.dark-mode header {
    background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
}

body.dark-mode .stat-item {
    background: rgba(22, 27, 34, 0.6);
    border-color: rgba(48, 54, 61, 0.5);
    color: var(--text-main);
}

body.dark-mode .toolbar {
    background: rgba(22, 27, 34, 0.9);
    border-color: var(--border);
}

body.dark-mode .btn-secondary {
    background: #161b22;
    color: var(--text-main);
    border-color: var(--border);
}

body.dark-mode .btn-secondary:hover {
    background: #21262d;
    border-color: #8b949e;
}

body.dark-mode .add-files-circle {
    background: #161b22;
    border: 1px solid var(--border);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

body.dark-mode input[type="range"] {
    background: #30363d;
}

body.dark-mode input[type="range"]::-webkit-slider-thumb {
    border-color: #161b22;
}

body.dark-mode .main-content {
    border-color: #30363d;
}

body.dark-mode footer {
    background: #0d1117;
    border-top-color: var(--border);
}

body.dark-mode .trash-btn {
    background: #161b22;
    border-color: var(--border);
}

body.dark-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.9);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 2rem 1rem 3rem;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-main) 100%);
    border-bottom: 1px solid var(--border);
}

.header-top {
    max-width: 1100px;
    margin: 0 auto 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.logo {
    grid-column: 2;
}

.header-actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.auth-nav {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.auth-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
}

.auth-link:hover {
    color: var(--primary);
}

.auth-btn {
    text-decoration: none;
    padding: 0.6rem 1.4rem;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.2);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
}

.user-profile {
    position: relative;
    cursor: pointer;
}

.avatar-circle {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.user-profile:hover .avatar-circle {
    transform: scale(1.05);
    border-color: var(--primary);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 240px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    padding: 12px;
    z-index: 1000;
    display: none;
    animation: slideDown 0.3s ease-out;
}

.profile-dropdown.active {
    display: block;
}

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

.dropdown-header {
    padding: 12px 15px;
}

.user-name-label {
    font-weight: 800;
    color: var(--text-main);
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.2s;
    border: none;
    width: 100%;
    background: none;
    cursor: pointer;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.modal-container {
    background: var(--bg-white);
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    border-radius: 32px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

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

.btn-close-modal:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    transform: rotate(90deg);
}

.btn-icon-only {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-main);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-only:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: rotate(30deg);
}

.logout-link {
    color: var(--danger);
}

.logout-link:hover {
    background: rgba(239, 35, 60, 0.05);
    color: var(--danger);
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.settings-tab:hover {
    background: var(--bg-white);
    color: var(--primary);
}

.settings-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

.avatar-preview-container {
    position: relative;
    width: 100px;
    height: 100px;
}

.avatar-edit-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid var(--bg-white);
    font-size: 0.8rem;
    transition: all 0.2s;
}

.avatar-edit-badge:hover {
    transform: scale(1.1);
    background: var(--secondary);
}

#user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.theme-switch {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary);
    transition: all 0.3s;
    box-shadow: var(--shadow-soft);
}

.theme-switch:hover {
    transform: rotate(15deg) scale(1.1);
    border-color: var(--primary);
}

.dark-mode .theme-switch i::before {
    content: "\f185"; /* Sun icon */
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-white);
    backdrop-filter: blur(5px);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.stat-item i {
    color: var(--primary);
    font-size: 0.85rem;
}

.stat-item strong {
    color: var(--primary);
    font-weight: 700;
}

.container {
    max-width: 1100px;
    margin: -1.5rem auto 0;
    width: 100%;
    padding: 0 1.5rem 4rem;
    flex: 1;
    z-index: 10;
}

/* Mode Navigation */
.nav-container {
    display: flex;
    justify-content: center;
    margin-top: -1.5rem;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 100;
}

.nav-tabs {
    background: var(--bg-white);
    padding: 0.5rem;
    border-radius: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border);
}

.nav-tab {
    padding: 0.8rem 1.5rem;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: transparent;
    border: none;
    font-family: inherit;
}

.nav-tab i {
    font-size: 1.1rem;
}

.nav-tab:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.nav-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.2);
}

.nav-tab.active i {
    color: white;
}

/* 3D Glass Toolbar */
.toolbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 1.2rem 2rem;
    display: flex;
    flex-direction: row; /* Force horizontal */
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-3d);
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.v-divider {
    width: 1px;
    height: 30px;
    background: var(--border);
    margin: 0 0.5rem;
}

.form-input {
    background: var(--bg-main);
    border: 1px solid var(--border);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

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

.slider-container {
    flex: 2; /* Take more space */
    min-width: 200px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border: 4px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.4);
}

.percentage-display {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 80px;
    text-align: center;
}

.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 14px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(67, 97, 238, 0.3);
}

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

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-main);
    border: 1px solid var(--border);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.btn-secondary:hover {
    background: var(--bg-main);
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* Main Content Area */
.main-content {
    background: var(--bg-white);
    border: 2px dashed var(--border);
    border-radius: 32px;
    min-height: 400px; /* Reduced from 500px */
    padding: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-content: flex-start;
    justify-content: center; 
    align-items: center;    
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
}

.main-content.drag-over {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.main-content.has-files .empty-state {
    display: none !important;
}

.empty-state {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 0;
    margin: auto; /* Force centering in flex parent */
}

.add-files-circle {
    width: 200px;
    height: 180px;
    border-radius: 40px;
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--primary);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05), inset 0 0 0 1px rgba(0,0,0,0.02);
    margin-bottom: 1.5rem;
}

.add-files-circle:hover {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 30px 60px rgba(67, 97, 238, 0.15);
}

.add-files-circle i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 5px 10px rgba(67, 97, 238, 0.3));
}

.empty-state span {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    display: block;
    padding: 0 15px;
    text-align: center;
}

.add-more-card {
    width: 240px;
    height: 320px; /* Approximately matches file-card height */
    margin-bottom: 0;
    border-radius: 24px;
    border: 2px dashed var(--border);
    background: transparent;
    box-shadow: none;
}

.add-more-card:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    transform: translateY(-10px);
}

/* Professional File Card */
.file-card {
    width: 240px;
    background: var(--bg-white);
    border-radius: 24px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border: 1px solid var(--border);
}

.file-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
}

.file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.file-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.remove-btn {
    background: var(--primary-soft);
    color: var(--danger);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

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

.preview-btn {
    background: var(--primary-soft);
    color: var(--primary);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

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

.file-preview {
    width: 100%;
    aspect-ratio: 1/1.2;
    background: var(--bg-main);
    border-radius: 16px;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
}

.file-preview img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.file-stats {
    text-align: left;
    margin-bottom: 1.2rem;
}

.original-size {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.new-size {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.1rem;
}

.status-badge {
    position: absolute;
    top: 55px;
    right: 1.5rem;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--border);
    color: var(--text-muted);
}

.status-badge.processing {
    background: var(--primary-soft);
    color: var(--primary);
}

.status-badge.success {
    background: rgba(76, 201, 240, 0.1);
    color: var(--success);
}

.status-badge.failed {
    background: rgba(239, 35, 60, 0.1);
    color: var(--danger);
}

.btn-download {
    width: 100%;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
}

.btn-download:not(:disabled):hover {
    background: var(--primary);
    color: white;
}

/* Footer */
footer {
    padding: 1.5rem 1rem;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 90;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 1rem;
    align-items: center;
}

.trash-btn {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: #fff5f5;
    border: none;
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.trash-btn:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

/* 3D Floating Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Loading Spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Stats Section Styling */
.stats-section {
    margin-top: 4rem;
    background: var(--bg-white);
    border-radius: 32px;
    padding: 3rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.section-header {
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.section-header p {
    color: var(--text-muted);
}
.file-card {
    cursor: grab;
}

.file-card:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.4;
    border: 2px dashed var(--primary) !important;
    background: var(--bg-main) !important;
}

.chart-container {
    width: 100%;
    height: 400px;
    position: relative;
}

.file-actions-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 5;
}

.file-card:hover .file-actions-overlay {
    opacity: 1;
}

.rotate-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

.rotate-btn:hover {
    transform: translate(0, 0) scale(1.1);
}

.page-selection {
    margin-top: 8px;
}

.page-selection input {
    width: 100%;
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-main);
    color: var(--text-main);
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.page-selection input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}
/* Scanning Loading Animation */
.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 32px;
    transition: all 0.4s ease;
}

body.dark-mode .processing-overlay {
    background: rgba(13, 17, 23, 0.85);
}

.processing-overlay.active {
    display: flex;
    animation: fadeIn 0.4s ease;
}

.scanner {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    border-radius: 32px;
    pointer-events: none;
}

.scanner-line {
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, transparent, var(--primary-soft), var(--primary), var(--primary-soft), transparent);
    position: absolute;
    top: -200px;
    left: 0;
    animation: scan 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    border-top: 1px solid rgba(255,255,255,0.2);
    opacity: 0.6;
}

@keyframes scan {
    0% { top: -200px; }
    100% { top: 100%; }
}

.processing-loader {
    width: 80px;
    height: 80px;
    border: 6px solid var(--primary-soft);
    border-top: 6px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin-bottom: 2rem;
    box-shadow: 0 0 30px var(--primary-soft);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.processing-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 4px;
    animation: pulse-text 1.5s ease-in-out infinite;
    text-shadow: 0 0 20px var(--primary-soft);
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.4; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1); }
}
