:root {
    --primary: #c5a059;
    --primary-muted: rgba(197, 160, 89, 0.2);
    --bg: #020617;
    --card-bg: rgba(15, 23, 42, 0.9);
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --accent: #10b981;
    --border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.banner-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.15;
    filter: blur(10px) brightness(0.5);
}

.container {
    width: 100%;
    max-width: 750px;
    padding: 2rem;
    z-index: 1;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(40px) saturate(160%);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 4.5rem 4rem;
    box-shadow: 0 50px 120px rgba(0, 0, 0, 0.9), inset 0 1px 2px rgba(255, 255, 255, 0.05);
    animation: entrance 1s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

@keyframes entrance {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

header {
    margin-bottom: 3.5rem;
}

.brand-logo {
    width: 130px;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 20px rgba(197, 160, 89, 0.3));
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 0.75rem;
    color: #fff;
    text-transform: uppercase;
}

.subtitle {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.badge {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary-muted);
    color: var(--primary);
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid var(--primary);
    letter-spacing: 1.5px;
}

/* Selection Section */
.selection-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.file-selector-wrapper {
    display: flex;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.file-name-placeholder {
    padding-left: 1rem;
    color: var(--text-dim);
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

/* Common Button Styles */
.primary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 1.4rem;
    background: var(--primary);
    color: #000;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 15px 35px rgba(197, 160, 89, 0.3);
    text-transform: uppercase;
}

.primary-button:hover:not(:disabled) {
    transform: translateY(-5px);
    background: #eab308;
    box-shadow: 0 20px 45px rgba(197, 160, 89, 0.4);
}

.primary-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #64748b;
    box-shadow: none;
}

.success-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 1.4rem;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: all 0.4s;
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.3);
    text-transform: uppercase;
}

.success-button:hover {
    transform: translateY(-3px);
    background: #059669;
    box-shadow: 0 20px 45px rgba(16, 185, 129, 0.4);
}

.secondary-button {
    padding: 1rem 1.75rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-text {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    margin-top: 2rem;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-text:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Processing Loader */
.loader-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--primary-muted);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: rotate 1.2s linear infinite;
    box-shadow: 0 0 20px rgba(197, 160, 89, 0.2);
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Progress View */
.percentage-display {
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 30px rgba(197, 160, 89, 0.2);
}

.progress-outer {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    margin-bottom: 3rem;
    overflow: hidden;
}

.progress-inner {
    height: 100%;
    background: linear-gradient(90deg, #c5a059, #fde68a);
    width: 0%;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 20px var(--primary-muted);
}

/* Rest of the aesthetics keep current */
.status-label {
    display: block;
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.batch-detail {
    color: var(--text-dim);
    font-size: 0.85rem;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.05);
    display: inline-block;
    padding: 5px 14px;
    border-radius: 6px;
}

.security-notice {
    margin-top: 4rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0.6;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 3.5rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: transform 0.3s;
}

.stat-item:hover {
    transform: translateY(-3px);
    border-color: var(--primary-muted);
}

.stat-item span {
    display: block;
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-item b {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-item.full-width {
    grid-column: span 2;
    background: rgba(197, 160, 89, 0.05);
    border-color: var(--primary-muted);
}

.legal-footer {
    margin-top: 5rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.8;
    border-top: 1px solid var(--border);
    padding-top: 2.5rem;
}

.results-view {
    animation: scaleIn 0.5s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-indicator {
    width: 60px;
    height: 60px;
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--accent);
}

.success-indicator svg {
    width: 30px;
    height: 30px;
}

.results-header {
    margin-bottom: 2.5rem;
}

.results-header h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: #fff;
}

.results-header p {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.5;
}

.reload-button {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    margin-top: 2rem;
    padding: 1.2rem 2.5rem;
    border-radius: 100px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.reload-button:hover {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(197, 160, 89, 0.2);
}

.hidden {
    display: none;
}
.review-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 1.2rem;
    margin-top: 1rem;
    background: transparent;
    color: var(--primary);
    text-decoration: none;
    border: 2px solid var(--primary);
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-button:hover {
    background: var(--primary);
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(197, 160, 89, 0.25);
}

.processed-filename { margin: 1rem 0; font-weight: 600; color: #c5a059 !important; font-size: 0.9rem !important; } .processed-filename span { color: #fff; font-weight: 700; }

/* ============ RESPONSIVE — MAIN PAGE ============ */

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .glass-card {
        padding: 2.5rem 1.75rem;
        border-radius: 24px;
    }

    h1 {
        font-size: 2rem;
        letter-spacing: -1px;
    }

    .subtitle {
        font-size: 0.75rem;
        letter-spacing: 2px;
    }

    .percentage-display {
        font-size: 3rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-item.full-width {
        grid-column: span 1;
    }

    .stat-item b {
        font-size: 1.4rem;
    }

    .results-header h2 {
        font-size: 1.5rem;
    }

    .primary-button, .success-button {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .security-notice {
        margin-top: 2rem;
        font-size: 0.65rem;
    }

    .legal-footer {
        margin-top: 3rem;
        padding-top: 1.5rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .glass-card {
        padding: 2rem 1.25rem;
        border-radius: 18px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .brand-logo {
        width: 90px;
        margin-bottom: 1.25rem;
    }

    header {
        margin-bottom: 2rem;
    }

    .badge {
        font-size: 0.6rem;
        padding: 8px 16px;
    }

    .file-selector-wrapper {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .file-name-placeholder {
        max-width: 100%;
        text-align: center;
        padding-left: 0;
    }
}

/* ============ ERROR VIEW ============ */
.error-view {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 1rem;
    text-align: center;
}

.error-indicator {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    border: 2px solid rgba(239, 68, 68, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
}

.error-indicator svg {
    width: 36px;
    height: 36px;
}

.error-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 0.5rem;
}

.error-content p {
    font-size: 0.95rem;
    color: #94a3b8;
    max-width: 380px;
    line-height: 1.6;
}

.retry-button {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.retry-button:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.6);
}
