@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --text: #eef6ff;
    --muted: #95a7be;
    --primary: #3b82f6;
    --primary-2: #2563eb;
    --success: #22c55e;
    --success-2: #16a34a;
    --danger: #ef4444;
    --panel: rgba(255, 255, 255, 0.08);
    --panel-border: rgba(255, 255, 255, 0.12);
    --footer-bg: rgba(8, 16, 28, 0.92);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

html,
body {
    height: 100%;
    margin: 0;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    color: var(--text);

    background:
        linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.9)),
        url('/static/bg.webp');

    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    overflow-x: hidden;
}



/* background decoration */
.bg-orb {
    position: fixed;
    border-radius: 999px;
    filter: blur(100px);
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

.orb-1 {
    width: 320px;
    height: 320px;
    top: 40px;
    left: -80px;
    background: rgba(59, 130, 246, 0.35);
}

.orb-2 {
    width: 320px;
    height: 320px;
    right: -80px;
    bottom: 60px;
    background: rgba(34, 197, 94, 0.22);
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0));
    z-index: 0;
    pointer-events: none;
}

/* page layout */
.page-shell {
    position: relative;
    z-index: 1;
    width: min(1200px, calc(100% - 32px));
    min-height: 100vh;
    margin: 24px auto 0;
    display: flex;
    flex-direction: column;
}

.main-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 22px;
}

/* common glass panels */
.hero,
.panel,
.stat-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

/* hero */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(255, 255, 255, 0.05)),
        rgba(255, 255, 255, 0.06);
}

.hero::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 65%);
    top: -70px;
    right: -60px;
}

.hero h1 {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
    margin-bottom: 12px;
}

.hero p {
    max-width: 780px;
    color: #d2e1f0;
    line-height: 1.7;
}

/* alerts */
.alerts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert {
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 16px;
    font-size: 14px;
}

.alert.success {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.3);
    color: #d8ffe5;
}

.alert.danger {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ffd9d9;
}

/* panel */
.panel {
    border-radius: 28px;
    padding: 24px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.panel-header h3 {
    font-size: 22px;
    margin-bottom: 6px;
}

.panel-header p {
    color: var(--muted);
    font-size: 14px;
}

/* form */
.form-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dropzone {
    position: relative;
    padding: 34px 20px;
    border: 1.5px dashed rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    text-align: center;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    transition: 0.25s ease;
}

.dropzone:hover,
.dropzone.dragover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.65);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.12), rgba(255, 255, 255, 0.04));
}

.dropzone-icon {
    font-size: 34px;
    margin-bottom: 12px;
}

.dropzone h4 {
    font-size: 20px;
    margin-bottom: 8px;
}

.dropzone p {
    color: var(--muted);
    margin-bottom: 10px;
}

.dropzone p span {
    color: #8fc1ff;
    font-weight: 600;
}

.dropzone small {
    display: inline-block;
    margin-top: 6px;
    color: #cfe0f1;
    word-break: break-word;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.form-group input,
.results-tools input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    color: white;
    font-size: 14px;
    transition: 0.2s ease;
}

.form-group input:focus,
.results-tools input:focus {
    border-color: rgba(59, 130, 246, 0.7);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.input-note {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.actions {
    display: flex;
    justify-content: flex-start;
}

/* buttons */
.btn-primary,
.btn-download {
    border: none;
    color: white;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s ease;
}

.btn-primary {
    padding: 14px 22px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--success), var(--success-2));
    box-shadow: 0 16px 30px rgba(22, 163, 74, 0.28);
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover,
.btn-download:hover {
    transform: translateY(-2px);
}

/* stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.stat-card {
    border-radius: 24px;
    padding: 24px;
}

.stat-card span {
    display: block;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1;
}

/* results */
.results-header {
    align-items: center;
}

.results-tools {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.results-tools input {
    min-width: 220px;
    border-radius: 14px;
}

.table-box {
    overflow: auto;
    max-height: 620px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 15px 16px;
    background: #0f3f86;
    color: white;
    font-size: 14px;
    text-align: left;
}

tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #e7eef6;
    font-size: 14px;
}

tbody tr:nth-child(even) {
    background: #f7fbff;
}

tbody tr:hover {
    background: #eef6ff;
}

/* empty state */
.empty-state {
    padding: 56px 24px;
    text-align: center;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--muted);
}

/* footer final */
.footer {
    margin-top: 40px;
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding: 18px 0 22px;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    background: var(--footer-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
}

.footer-content {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-left strong {
    display: block;
    font-size: 14px;
}

.footer-left span {
    font-size: 12px;
    color: #94a3b8;
}

.footer-right {
    font-size: 13px;
    color: #cbd5e1;
}

/* loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(5, 10, 18, 0.55);
    backdrop-filter: blur(8px);
    z-index: 1000;
}

.loading-overlay.show {
    display: flex;
}

.loader-card {
    width: min(420px, calc(100% - 32px));
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    text-align: center;
    background: rgba(10, 18, 31, 0.9);
    box-shadow: var(--shadow);
}

.loader-card h3 {
    margin: 16px 0 8px;
    font-size: 22px;
}

.loader-card p {
    color: var(--muted);
    line-height: 1.6;
}

.loader-spinner {
    width: 58px;
    height: 58px;
    margin: 0 auto;
    border: 4px solid rgba(255, 255, 255, 0.14);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* responsive */
@media (max-width: 768px) {
    .page-shell {
        width: min(100% - 20px, 1200px);
        margin: 10px auto 0;
    }

    .hero,
    .panel,
    .stat-card {
        padding: 18px;
        border-radius: 20px;
    }

    .grid-2,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .panel-header,
    .results-header,
    .results-tools,
    .footer-content {
        flex-direction: column;
        align-items: stretch;
    }

    .results-tools input {
        min-width: unset;
        width: 100%;
    }

    .footer {
        padding: 16px 0 20px;
    }

    .footer-content {
        text-align: center;
    }

    .hero h1 {
        font-size: 28px;
    }
}