/* -------------------------------------------------------------
   The Academy Group — Private Cloud Vault
   Design System & Styling
   ------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-primary: #080c15;
    --bg-surface: rgba(16, 23, 39, 0.72);
    --bg-surface-elevated: rgba(23, 32, 54, 0.85);
    --bg-input: rgba(11, 17, 30, 0.8);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.2);
    --border-focus: rgba(16, 185, 129, 0.6);

    --text-main: #f3f4f6;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.35);
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.35);
    --accent-indigo: #6366f1;
    --accent-rose: #f43f5e;
    --accent-amber: #f59e0b;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.25);
    --shadow-modal: 0 25px 60px -15px rgba(0, 0, 0, 0.85);

    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 50%);
    background-attachment: fixed;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* App Header / Navigation */
.app-header {
    background: rgba(8, 12, 21, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0.85rem 1.5rem;
}

.header-container {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: inherit;
}

.brand-icon-wrap {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
    color: #fff;
    flex-shrink: 0;
}

.brand-text h1 {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text span {
    font-size: 0.725rem;
    font-weight: 500;
    color: var(--accent-emerald);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-emerald);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--accent-emerald);
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.25;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-subtle);
    color: var(--text-main);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.3);
    color: #fb7185;
}
.btn-danger:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: #f43f5e;
    color: #fff;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.85rem 1.6rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

/* Main Container */
.main-wrapper {
    flex: 1;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Cards & Glass Containers */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 2rem;
    position: relative;
}

/* Auth / Passcode Modal Box */
.auth-box {
    max-width: 440px;
    margin: 4rem auto 0;
    text-align: center;
}

.auth-header-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.auth-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
    margin-bottom: 1.25rem;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.input-icon-btn {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0.25rem;
}
.input-icon-btn:hover {
    color: var(--text-main);
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* Stats Ribbon */
.stats-ribbon {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.stat-icon.indigo { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); }

.stat-info h4 {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-info p {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

/* Drag & Drop Upload Zone */
.dropzone-container {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 3.5rem 2rem;
    text-align: center;
    background: rgba(16, 23, 39, 0.4);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dropzone-container:hover, .dropzone-container.dragover {
    border-color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
}

.dropzone-container.dragover {
    transform: scale(1.01);
}

.dropzone-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--accent-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: var(--transition);
}

.dropzone-container:hover .dropzone-icon-wrap {
    transform: translateY(-4px);
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

.dropzone-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.dropzone-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.file-input-hidden {
    display: none;
}

/* Upload Options Bar */
.upload-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border-subtle);
}

.select-custom {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 0.65rem 0.85rem;
    font-family: inherit;
    font-size: 0.875rem;
    width: 100%;
    cursor: pointer;
    transition: var(--transition);
}

.select-custom:focus {
    outline: none;
    border-color: var(--border-focus);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    height: 100%;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-emerald);
    cursor: pointer;
}

/* Upload Progress Modal / Card */
.progress-card {
    background: var(--bg-surface-elevated);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: none;
}

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

.progress-filename {
    font-weight: 600;
    font-size: 0.95rem;
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-percentage {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--accent-emerald);
    font-size: 0.95rem;
}

.progress-bar-track {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981 0%, #06b6d4 100%);
    border-radius: var(--radius-full);
    transition: width 0.15s ease-out;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.775rem;
    color: var(--text-dim);
    margin-top: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Success Card with Shareable Links */
.success-card {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    margin-top: 1.5rem;
    display: none;
    animation: fadeInSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.success-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
}

.share-input-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 1.25rem;
}

.share-link-input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 0.7rem 0.9rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    outline: none;
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Recent Files Table & Cards */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.search-box {
    position: relative;
    max-width: 260px;
}

.search-input {
    width: 100%;
    padding: 0.45rem 0.75rem 0.45rem 2.1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.825rem;
    outline: none;
    transition: var(--transition);
}
.search-input:focus {
    border-color: var(--border-focus);
}

.search-icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.files-table th {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.9rem 1.1rem;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-subtle);
}

.files-table td {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.files-table tr:last-child td {
    border-bottom: none;
}

.files-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.file-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-type-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-emerald);
    flex-shrink: 0;
}

.file-title-wrap {
    overflow: hidden;
}

.file-name {
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
    transition: var(--transition);
}
.file-name:hover {
    color: var(--accent-emerald);
}

.file-id-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-dim);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.badge-dim { background: rgba(255, 255, 255, 0.06); color: var(--text-dim); }

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--text-dim);
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

/* =============================================================
   PUBLIC FILE VIEWER PAGE
   ============================================================= */
.viewer-container {
    max-width: 860px;
    margin: 1.5rem auto;
}

.viewer-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.file-hero {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.hero-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
    border: 1px solid rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-emerald);
    flex-shrink: 0;
}

.hero-details h2 {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    word-break: break-all;
    margin-bottom: 0.4rem;
}

.hero-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    font-size: 0.825rem;
    color: var(--text-muted);
}

/* Preview Windows */
.preview-box {
    background: #040711;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 2rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
}

.preview-img {
    max-width: 100%;
    max-height: 520px;
    object-fit: contain;
    display: block;
    transition: transform 0.25s ease;
}

.preview-video {
    width: 100%;
    max-height: 520px;
    background: #000;
    outline: none;
}

.preview-audio-wrap {
    width: 100%;
    padding: 3rem 2rem;
    text-align: center;
}

.preview-audio {
    width: 100%;
    max-width: 500px;
    margin-top: 1.25rem;
}

.preview-pdf-frame {
    width: 100%;
    height: 600px;
    border: none;
}

.preview-code-box {
    width: 100%;
    max-height: 480px;
    overflow-y: auto;
    background: #030712;
    padding: 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    text-align: left;
}

.generic-download-hero {
    padding: 3.5rem 2rem;
    text-align: center;
}

.generic-icon {
    font-size: 3.5rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
}

/* Viewer Action Grid */
.viewer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* QR Code Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-content {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    max-width: 400px;
    width: 100%;
    padding: 2rem;
    text-align: center;
    position: relative;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.5rem;
}
.modal-close-btn:hover {
    color: #fff;
}

.qr-display-container {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    display: inline-block;
    margin: 1.25rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    box-shadow: var(--shadow-modal);
    color: #fff;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast.toast-success { border-color: rgba(16, 185, 129, 0.4); }
.toast.toast-error { border-color: rgba(244, 63, 94, 0.4); }

/* Footer */
.app-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 1.75rem 1.5rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    background: rgba(8, 12, 21, 0.5);
    margin-top: auto;
}

.app-footer a {
    color: var(--text-muted);
    text-decoration: none;
}
.app-footer a:hover {
    color: var(--accent-emerald);
}

/* Responsive queries */
@media (max-width: 768px) {
    .main-wrapper {
        padding: 1.25rem 1rem;
    }
    .glass-card {
        padding: 1.25rem;
    }
    .dropzone-container {
        padding: 2rem 1rem;
    }
    .header-container {
        flex-direction: row;
    }
    .hero-details h2 {
        font-size: 1.25rem;
    }
}

/* =============================================================
   BEFORE / AFTER IMAGE COMPRESSOR WIDGET (Exact Match to User Reference)
   ============================================================= */
.comp-widget-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
    position: relative;
    padding: 1.5rem 1.75rem 1.75rem;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.18);
    color: #0f172a;
}

.comp-card-filename {
    text-align: center;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    word-break: break-word;
}

.comp-metrics-header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 1rem 1.25rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: #0f172a;
}

.comp-metric-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #0f172a;
}

.comp-metric-item .metric-val {
    color: #0f172a;
    font-weight: 700;
}

.comp-metric-item.comp-metric-after .metric-val,
.comp-metric-item .text-success {
    color: #16a34a !important;
    font-weight: 700;
}

.comp-metric-item .savings-badge {
    font-size: 1.05rem;
    font-weight: 700;
}

.comp-stage-container {
    display: flex;
    gap: 1.25rem;
    align-items: stretch;
}

.comp-slider-viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #000000;
    min-height: 400px;
    max-height: 560px;
    height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ew-resize;
    user-select: none;
    -webkit-user-select: none;
}

.comp-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
    display: block;
}

.comp-layer-before {
    z-index: 1;
}

.comp-layer-after {
    z-index: 5;
    clip-path: inset(0 0 0 50%);
}

.comp-split-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ffffff;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

.comp-split-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    color: #1e293b;
    font-size: 15px;
    font-weight: 700;
    font-family: monospace;
    user-select: none;
}

.comp-controls-column {
    width: 76px;
    background: transparent;
    border: none;
    padding: 0.25rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.comp-ctrl-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 6px;
}

.comp-ctrl-input-wrap {
    margin-bottom: 0.5rem;
}

.comp-input-box {
    width: 58px;
    height: 30px;
    text-align: center;
    background: #ffffff;
    border: 1.5px solid #0f172a;
    border-radius: 4px;
    color: #0f172a;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0;
    outline: none;
    box-sizing: border-box;
}
.comp-input-box:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.comp-slider-track-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0;
    min-height: 180px;
}

.comp-vertical-range {
    -webkit-appearance: slider-vertical;
    writing-mode: bt-lr;
    width: 24px;
    height: 200px;
    cursor: pointer;
    background: transparent;
}

.comp-vertical-range::-webkit-slider-runnable-track {
    width: 4px;
    background: #e2e8f0;
    border-radius: 2px;
}

.comp-vertical-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1e293b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='7 9 12 4 17 9'/%3E%3Cpolyline points='7 15 12 20 17 15'/%3E%3C/svg%3E") center center / 12px 12px no-repeat;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.comp-apply-button {
    width: 58px;
    padding: 6px 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: #94a3b8;
    color: #ffffff;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    text-transform: uppercase;
}
.comp-apply-button:hover {
    background: #64748b;
}
.comp-apply-button:active {
    transform: scale(0.96);
}

@media (max-width: 768px) {
    .comp-widget-card {
        padding: 1rem;
    }
    .comp-stage-container {
        flex-direction: column;
    }
    .comp-slider-viewport {
        height: 320px;
        min-height: 260px;
    }
    .comp-controls-column {
        width: 100%;
        flex-direction: row;
        gap: 1rem;
        padding: 0.75rem 0.5rem;
    }
    .comp-slider-track-wrap {
        min-height: auto;
        padding: 0;
        flex: 1;
    }
    .comp-vertical-range {
        -webkit-appearance: auto;
        writing-mode: horizontal-tb;
        width: 100%;
        height: auto;
    }
    .comp-apply-button {
        width: auto;
        padding: 6px 16px;
    }
}
