/* ==========================================================================
   InternTrack — Premium Dark + Glassmorphism design system
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
    /* Surfaces */
    --bg-0:             #0a0a14;
    --bg-1:             #10101e;
    --glass:            rgba(255, 255, 255, 0.04);
    --glass-strong:     rgba(255, 255, 255, 0.07);
    --glass-border:     rgba(255, 255, 255, 0.09);
    --glass-highlight:  rgba(255, 255, 255, 0.16);
    --solid-glass:      rgba(16, 16, 30, 0.85);

    /* Accent gradient: violet -> blue */
    --violet:           #8b5cf6;
    --blue:             #3b82f6;
    --grad-accent:      linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    --grad-accent-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(59, 130, 246, 0.18));

    /* Text */
    --text-1:           #f4f4f8;
    --text-2:           #a7a7bc;
    --text-3:           #6e6e84;

    /* Semantic */
    --success:          #34d399;
    --danger:           #f87171;
    --warning:          #fbbf24;
    --info:             #60a5fa;

    /* Glow / shadow */
    --glow-violet:      0 0 24px rgba(139, 92, 246, 0.35);
    --glow-blue:        0 0 24px rgba(59, 130, 246, 0.3);
    --shadow-card:      0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-lift:      0 16px 48px rgba(0, 0, 0, 0.45);

    /* Geometry */
    --radius-sm:        8px;
    --radius-md:        12px;
    --radius-lg:        18px;
    --radius-full:      999px;
    --blur-glass:       14px;

    /* Type */
    --font-display:     "Space Grotesk", "Inter", system-ui, sans-serif;
    --font-body:        "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

    /* Motion */
    --ease-out:         cubic-bezier(0.22, 1, 0.36, 1);
    --t-fast:           150ms;
    --t-med:            280ms;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;

    font-family: var(--font-body);
    line-height: 1.55;

    background: var(--bg-0);
    color: var(--text-1);

    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    margin-top: 0;
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

a {
    color: var(--info);
    text-decoration: none;
    transition: color var(--t-fast);
}

a:hover {
    color: var(--text-1);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Animated background orbs (rendered from header.php, fixed behind content) */
.bg-orbs {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-orbs .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.32;
    will-change: transform;
}

.bg-orbs .orb-violet {
    width: 520px;
    height: 520px;
    top: -160px;
    left: -120px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.8), transparent 65%);
    animation: orb-drift-a 70s ease-in-out infinite alternate;
}

.bg-orbs .orb-blue {
    width: 460px;
    height: 460px;
    bottom: -180px;
    right: -100px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.7), transparent 65%);
    animation: orb-drift-b 80s ease-in-out infinite alternate;
}

.bg-orbs .orb-teal {
    width: 360px;
    height: 360px;
    top: 40%;
    left: 55%;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.35), transparent 65%);
    animation: orb-drift-a 90s ease-in-out infinite alternate-reverse;
}

@keyframes orb-drift-a {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(120px, 80px) scale(1.15); }
}

@keyframes orb-drift-b {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-100px, -90px) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
    .bg-orbs .orb {
        animation: none;
    }
}

#gradient-blinds {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    mix-blend-mode: screen;
    overflow: hidden;
    filter: blur(28px);
    opacity: 0.55;
}

/* --------------------------------------------------------------------------
   3. Glass components
   -------------------------------------------------------------------------- */

.glass-card {
    background: var(--solid-glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-card);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    .glass-card {
        background: var(--glass);
        -webkit-backdrop-filter: blur(var(--blur-glass));
        backdrop-filter: blur(var(--blur-glass));
    }
}

.glass-card--hover {
    transition:
        transform var(--t-med) var(--ease-out),
        box-shadow var(--t-med) var(--ease-out),
        border-color var(--t-med) var(--ease-out);
}

.glass-card--hover:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-lift), var(--glow-violet);
}

.gradient-text {
    background: var(--grad-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Stat card: big display number + small uppercase label */
.stat-card {
    padding: 18px 20px;
    text-align: center;
}

.stat-card .stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-3);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */

button,
.btn {
    display: inline-block;

    width: 100%;
    padding: 10px 18px;
    margin-top: 6px;
    margin-bottom: 16px;

    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: center;

    color: var(--text-1);
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);

    cursor: pointer;

    transition:
        background var(--t-fast),
        border-color var(--t-fast),
        box-shadow var(--t-fast),
        transform var(--t-fast);
}

button:hover,
.btn:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text-1);
}

.btn {
    width: auto;
    margin: 0;
    text-decoration: none;
}

.btn-primary,
button.btn-primary {
    background: var(--grad-accent);
    border: none;
    color: #fff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover,
button.btn-primary:hover {
    background: var(--grad-accent);
    box-shadow: var(--glow-violet);
    transform: translateY(-1px);
}

.btn-ghost,
button.btn-ghost {
    background: transparent;
    border: 1px solid var(--glass-border);
}

.btn-ghost:hover,
button.btn-ghost:hover {
    background: var(--glass-strong);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger,
button.btn-danger {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: var(--danger);
}

.btn-danger:hover,
button.btn-danger:hover {
    background: rgba(248, 113, 113, 0.22);
    border-color: var(--danger);
}

/* --------------------------------------------------------------------------
   5. Forms
   -------------------------------------------------------------------------- */

form {
    margin-top: 16px;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-2);
}

input,
textarea,
select {
    width: 100%;

    padding: 10px 12px;
    margin-top: 6px;
    margin-bottom: 16px;

    font-family: var(--font-body);
    font-size: 0.95rem;

    color: var(--text-1);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);

    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-3);
}

select option {
    background: var(--bg-1);
    color: var(--text-1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-error {
    padding: 10px 14px;
    margin-bottom: 16px;

    font-size: 0.88rem;
    color: var(--danger);

    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   6. Navbar
   -------------------------------------------------------------------------- */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;

    padding: 12px 24px;

    background: rgba(10, 10, 20, 0.75);
    border-bottom: 1px solid var(--glass-border);

    transition: background var(--t-med) var(--ease-out);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    .navbar {
        -webkit-backdrop-filter: blur(var(--blur-glass));
        backdrop-filter: blur(var(--blur-glass));
    }
}

.nav-left,
.nav-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 16px;

    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;

    background: var(--grad-accent);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.45);
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-links a {
    position: relative;
    padding: 7px 12px;

    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-2);

    border-radius: var(--radius-sm);
    transition: color var(--t-fast), background var(--t-fast);
}

.nav-links a:hover {
    color: var(--text-1);
    background: var(--glass-strong);
}

.nav-links a.active {
    color: var(--text-1);
}

.nav-links a.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 2px;

    height: 2px;
    border-radius: 2px;
    background: var(--grad-accent);
}

.nav-user-chip {
    padding: 5px 14px;

    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-1);

    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);

    /* button resets */
    width: auto;
    margin: 0;
    cursor: pointer;
    transition: border-color var(--t-fast), background var(--t-fast);
}

.nav-user-chip:hover {
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(255, 255, 255, 0.09);
}

/* Profile-picture button in the nav + its fallback initial. */
.nav-avatar {
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    border: 2px solid rgba(139, 92, 246, 0.5);
    border-radius: 50%;
    background: var(--glass-strong);
    cursor: pointer;
    transition: border-color var(--t-fast), transform var(--t-fast);
}

.nav-avatar:hover {
    border-color: var(--violet);
    transform: translateY(-1px);
}

.nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nav-avatar-fallback {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-1);
    line-height: 1;
}

.nav-avatar-fallback.big { font-size: 2.6rem; }

.nav-burger {
    display: none;

    width: auto;
    margin: 0;
    padding: 8px 10px;

    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}

.nav-burger span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 3.5px 0;
    background: var(--text-1);
    border-radius: 2px;
    transition: transform var(--t-med) var(--ease-out), opacity var(--t-fast);
}

.nav-burger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.nav-logout-mobile {
    display: none;
}

.nav-links a.nav-logout-mobile {
    color: #f87171;
}

.nav-links a.nav-logout-mobile:hover,
.nav-links a.nav-logout-mobile:focus {
    color: #ef4444;
}

/* --------------------------------------------------------------------------
   7. Tables
   -------------------------------------------------------------------------- */

.table-wrap {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: var(--radius-lg);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;

    background: var(--solid-glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    table {
        background: var(--glass);
        -webkit-backdrop-filter: blur(var(--blur-glass));
        backdrop-filter: blur(var(--blur-glass));
    }
}

.table-wrap table {
    margin-top: 0;
}

th,
td {
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid var(--glass-border);

    text-align: center;
    vertical-align: middle;
}

th {
    background: rgba(255, 255, 255, 0.03);

    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-3);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background var(--t-fast);
}

tbody tr:hover {
    background: rgba(139, 92, 246, 0.06);
}

/* --------------------------------------------------------------------------
   8. Badges
   -------------------------------------------------------------------------- */

.tag-badge {
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-align: center;
    white-space: nowrap;
}

.tag-badge-maybe           { color: #fde047; border-color: rgba(202, 138, 4, 0.5);  background: rgba(202, 138, 4, 0.12); }
.tag-badge-probably        { color: #4ade80; border-color: rgba(22, 163, 74, 0.5);  background: rgba(22, 163, 74, 0.12); }
.tag-badge-for-sure        { color: #93c5fd; border-color: rgba(59, 130, 246, 0.5); background: rgba(59, 130, 246, 0.12); }
.tag-badge-absolute-cinema {
    color: #e9d5ff;
    border-color: rgba(147, 51, 234, 0.6);
    background: var(--grad-accent-soft);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: center;
    white-space: nowrap;
}

.status-badge-pending   { color: #d1d5db; border-color: rgba(156, 163, 175, 0.4); background: rgba(156, 163, 175, 0.1); }
.status-badge-rejected  { color: #f87171; border-color: rgba(220, 38, 38, 0.45);  background: rgba(220, 38, 38, 0.12); }
.status-badge-ghosted   { color: #9ca3af; border-color: rgba(75, 85, 99, 0.5);    background: rgba(75, 85, 99, 0.15); }
.status-badge-interview { color: #4ade80; border-color: rgba(22, 163, 74, 0.5);   background: rgba(22, 163, 74, 0.12); }
.status-badge-offer     {
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.55);
    background: rgba(59, 130, 246, 0.14);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

.date-badge {
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.date-badge-green   { color: #4ade80; border-color: rgba(22, 163, 74, 0.5);   background: rgba(22, 163, 74, 0.12); }
.date-badge-yellow  { color: #fde047; border-color: rgba(202, 138, 4, 0.5);   background: rgba(202, 138, 4, 0.12); }
.date-badge-orange  { color: #fb923c; border-color: rgba(234, 88, 12, 0.5);   background: rgba(234, 88, 12, 0.12); }
.date-badge-red     { color: #f87171; border-color: rgba(220, 38, 38, 0.45);  background: rgba(220, 38, 38, 0.12); }
.date-badge-neutral { color: #d1d5db; border-color: rgba(156, 163, 175, 0.4); background: rgba(156, 163, 175, 0.1); }

.status-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.status-buttons button {
    margin: 0;
    width: auto;
}

/* --------------------------------------------------------------------------
   9. Auth pages
   -------------------------------------------------------------------------- */

.auth-card {
    max-width: 420px;
    margin: 7vh auto;
    padding: 36px 32px;
}

.auth-card .auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;

    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-1);
}

.auth-card h1 {
    margin-bottom: 4px;
    font-size: 1.6rem;
}

.auth-card .auth-sub {
    margin: 0 0 20px;
    font-size: 0.92rem;
    color: var(--text-2);
}

.auth-card .auth-alt {
    margin: 14px 0 0;
    font-size: 0.88rem;
    color: var(--text-2);
    text-align: center;
}

/* --------------------------------------------------------------------------
   10. Modal
   -------------------------------------------------------------------------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;

    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;

    background: rgba(5, 5, 12, 0.6);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    .modal-overlay {
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
    }
}

.modal-dialog {
    width: min(480px, calc(100vw - 32px));
    padding: 24px;

    animation: modal-in var(--t-med) var(--ease-out);
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .modal-dialog {
        animation: none;
    }
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-actions button {
    width: auto;
    margin: 0;
}

/* Opaque dialog (no glass translucency). */
.modal-dialog.modal-solid {
    background: var(--bg-1);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* Profile-picture modal */
.avatar-dialog { width: min(380px, calc(100vw - 32px)); }

.avatar-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.avatar-modal-head h3 { margin: 0; }

.avatar-preview {
    width: 160px;
    height: 160px;
    margin: 0 auto 14px;

    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    border: 2px solid var(--glass-border);
    border-radius: 50%;
    background: var(--glass-strong);
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avatar-hint { text-align: center; font-size: 0.8rem; margin: 0 0 16px; }

.avatar-feedback {
    margin: 12px 0 0;
    min-height: 1.1em;
    text-align: center;
    font-size: 0.82rem;
    color: var(--success);
}

/* Profile-credentials modal */
.profile-dialog { width: min(400px, calc(100vw - 32px)); }

.profile-dialog label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-2);
}

.profile-dialog input {
    margin-bottom: 14px;
}

.profile-feedback {
    margin: 12px 0 0;
    min-height: 1.1em;
    font-size: 0.82rem;
    color: var(--success);
}

.profile-feedback.error { color: var(--danger); }

/* --------------------------------------------------------------------------
   11. Podium (leaderboard top 3)
   -------------------------------------------------------------------------- */

.podium {
    display: flex;
    gap: 16px;
    align-items: stretch;
    justify-content: center;
    margin: 24px 0 8px;
}

.podium-card {
    flex: 1;
    max-width: 240px;
    padding: 22px 18px;
    text-align: center;
}

.podium-card .podium-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;
    margin-bottom: 10px;

    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;

    border-radius: 50%;
}

.podium-card .podium-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
}

.podium-card .podium-score {
    margin: 4px 0 2px;
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.15;
}

.podium-card .podium-sub {
    font-size: 0.78rem;
    color: var(--text-3);
}

.podium-card.rank-1 {
    order: 2;
    max-width: 270px;
    margin-top: 0;
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-card), var(--glow-violet);
}

.podium-card.rank-2 { order: 1; margin-top: 22px; }
.podium-card.rank-3 { order: 3; margin-top: 22px; }

.podium-card.rank-1 .podium-medal { background: linear-gradient(135deg, #fbbf24, #f59e0b); box-shadow: 0 0 16px rgba(251, 191, 36, 0.4); }
.podium-card.rank-2 .podium-medal { background: linear-gradient(135deg, #d1d5db, #9ca3af); }
.podium-card.rank-3 .podium-medal { background: linear-gradient(135deg, #d97706, #92400e); }

.rank-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 26px;
    height: 26px;

    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;

    border-radius: 50%;
}

.rank-medal.rank-medal-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.rank-medal.rank-medal-2 { background: linear-gradient(135deg, #d1d5db, #9ca3af); }
.rank-medal.rank-medal-3 { background: linear-gradient(135deg, #d97706, #92400e); }

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */

.site-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;

    margin-top: 40px;
    padding: 20px 24px;

    background: rgba(10, 10, 20, 0.6);
    border-top: 1px solid var(--glass-border);

    font-size: 0.9rem;
}

.footer-label {
    color: var(--text-3);
    margin-right: 4px;
}

.site-footer a {
    padding: 7px 18px;

    background: var(--glass-strong);
    color: var(--text-1);

    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);

    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;

    transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.site-footer a:hover {
    background: var(--grad-accent-soft);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: var(--glow-violet);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   13. Utilities
   -------------------------------------------------------------------------- */

.cell-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.cell-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.icon-btn {
    width: auto;
    margin: 0;
    padding: 6px 9px;

    font-size: 0.8rem;
    line-height: 1;

    background: transparent;
    border: 1px solid var(--glass-border);
}

.icon-btn:hover {
    background: var(--glass-strong);
    border-color: rgba(139, 92, 246, 0.4);
}

.muted {
    color: var(--text-3);
}

.page-heading {
    font-size: 1.9rem;
}

/* --------------------------------------------------------------------------
   14. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .container {
        padding: 24px 16px;
    }
}

@media (max-width: 768px) {
    .nav-burger {
        display: block;
    }

    .navbar.nav-open {
        background: rgb(10, 10, 20);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;

        flex-direction: column;
        align-items: stretch;
        gap: 2px;

        max-height: 0;
        overflow: hidden;
        padding: 0 16px;

        background: rgb(10, 10, 20);
        border-bottom: 1px solid transparent;

        transition: max-height var(--t-med) var(--ease-out), padding var(--t-med) var(--ease-out);
    }

    .nav-links.open {
        max-height: 480px;
        padding: 10px 16px;
        border-bottom-color: var(--glass-border);
        border-radius: 0 0 var(--radius-md) var(--radius-md);
    }

    .nav-links a {
        padding: 12px;
    }

    .nav-links a.active::after {
        bottom: 6px;
    }

    .nav-right .nav-logout-desktop {
        display: none;
    }

    .nav-links a.nav-logout-mobile {
        display: block;
        margin-top: 6px;
        padding: 12px;
        border-top: 1px solid var(--glass-border);
        color: #f87171;
        font-weight: 600;
        text-align: left;
    }

    .nav-links a.nav-logout-mobile:hover,
    .nav-links a.nav-logout-mobile:focus {
        background: rgba(239, 68, 68, 0.15);
        color: #ef4444;
    }

    .podium {
        flex-direction: column;
        align-items: center;
    }

    .podium-card {
        width: 100%;
        max-width: 340px;
        margin-top: 0 !important;
    }

    .podium-card.rank-1 { order: 1; }
    .podium-card.rank-2 { order: 2; }
    .podium-card.rank-3 { order: 3; }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card .stat-value {
        font-size: 1.6rem;
    }

    .container {
        padding: 20px 12px;
    }

    /* Keep the navbar narrower than the viewport: flex children cannot
       shrink below their content width, so trim every fixed part. */
    .navbar {
        padding: 10px 12px;
        gap: 8px;
    }

    .nav-brand {
        margin-right: 4px;
        gap: 8px;
        font-size: 1rem;
    }

    .brand-mark {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .nav-user-chip {
        display: none;
    }

    .navbar .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* Responsive card-table technique: tables with .responsive-table collapse
   into stacked cards below 800px. Each <td> needs a data-label attribute. */
@media (max-width: 800px) {
    table.responsive-table thead {
        display: none;
    }

    table.responsive-table,
    table.responsive-table tbody {
        display: block;
        background: transparent;
        border: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        box-shadow: none;
    }

    table.responsive-table tbody tr {
        display: block;

        margin-bottom: 14px;
        padding: 6px 0;

        background: var(--solid-glass);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-lg);
    }

    table.responsive-table tbody tr:hover {
        background: var(--solid-glass);
    }

    table.responsive-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;

        padding: 9px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);

        text-align: right;
    }

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

    table.responsive-table td::before {
        content: attr(data-label);

        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--text-3);

        text-align: left;
        flex-shrink: 0;
    }

    table.responsive-table td .cell-stack {
        align-items: flex-end;
    }
}
