/*
 * custom.css
 * DSAC Lucky Fan WC26 – Custom styles layered on top of Tailwind CDN
 *
 * Tailwind handles layout and spacing.
 * This file handles: competition-specific colours, animations,
 * form states, drop zone, progress bar, and status banner.
 */

/* ── ROOT VARIABLES ─────────────────────────────────────────────────────────── */
:root {
    --gold:        #FFD700;
    --gold-light:  #FFE84D;
    --green-dark:  #0a1f0a;
    --green-mid:   #1a6b1a;
    --green-sa:    #007A4D;
    --red-sa:      #DE3831;
    --blue-sa:     #002395;
    --white:       #FFFFFF;
    --text-muted:  rgba(255,255,255,0.55);
    --border-dim:  rgba(255,255,255,0.12);
    --border-gold: rgba(255,215,0,0.35);
}

/* ── BASE ───────────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
    background-color: var(--green-dark);
    color: #f0f0e8;
    font-family: 'Barlow', sans-serif;
}

/* ── SA FLAG STRIPE ─────────────────────────────────────────────────────────── */
.flag-stripe {
    height: 5px;
    display: flex;
}
.flag-stripe > span { flex: 1; }

/* ── STATUS BANNER ──────────────────────────────────────────────────────────── */
.comp-banner {
    display: block;
    text-align: center;
    padding: 10px 1rem;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.4px;
    transition: background 0.4s;
}
.comp-banner--open    { background: rgba(0, 122, 77, 0.85); color: #d0ffd0; }
.comp-banner--pending { background: rgba(186, 117, 23, 0.85); color: #fff3cd; }
.comp-banner--closed  { background: rgba(180, 30, 30, 0.75); color: #ffd0d0; }

/* ── COUNTDOWN ──────────────────────────────────────────────────────────────── */
.countdown-grid {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.cd-block {
    background: rgba(255,255,255,0.06);
    border: 0.5px solid var(--border-gold);
    border-radius: 10px;
    padding: 14px 18px 10px;
    min-width: 74px;
    text-align: center;
}
.cd-num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 48px;
    line-height: 1;
    color: var(--gold);
    display: block;
}
.cd-unit-label {
    font-size: 10px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}
.cd-sep {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 40px;
    color: rgba(255,215,0,0.35);
    padding-bottom: 12px;
    line-height: 1;
}

/* ── SECTION LABELS ─────────────────────────────────────────────────────────── */
.section-eyebrow {
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 6px;
}
.section-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(32px, 5vw, 48px);
    letter-spacing: 1px;
    color: #fff;
    line-height: 1.05;
    margin-bottom: 1.25rem;
}

/* ── CARD ───────────────────────────────────────────────────────────────────── */
.card {
    background: rgba(255,255,255,0.05);
    border: 0.5px solid var(--border-gold);
    border-radius: 12px;
    padding: 1.25rem;
}

/* ── DROP ZONE ──────────────────────────────────────────────────────────────── */
.drop-zone {
    border: 2px dashed var(--border-gold);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: rgba(255,215,0,0.02);
    position: relative;
}
.drop-zone:hover,
.drop-zone--drag {
    border-color: rgba(255,215,0,0.7);
    background: rgba(255,215,0,0.05);
}
.drop-zone--has-file {
    border-color: rgba(76,222,130,0.6);
    background: rgba(76,222,130,0.04);
}

/* ── FORM FIELDS ────────────────────────────────────────────────────────────── */
.field-wrapper { position: relative; }

.form-input,
.form-select {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 0.5px solid var(--border-dim);
    border-radius: 7px;
    padding: 10px 14px;
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    color: #f0f0e8;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
}
.form-input::placeholder { color: rgba(255,255,255,0.25); }
.form-input:focus,
.form-select:focus        { border-color: rgba(255,215,0,0.6); box-shadow: 0 0 0 2px rgba(255,215,0,0.1); }
.form-select option       { background: #1a3a1a; color: #f0f0e8; }

/* Valid / invalid state */
.field--valid   { border-color: rgba(76,222,130,0.6) !important; }
.field--invalid { border-color: rgba(255,100,100,0.7) !important; }

.field-hint { font-size: 12px; margin-top: 4px; min-height: 16px; }
.field-hint--error { color: #ff8080; }
.field-hint--ok    { color: #4cde82; }

/* ── FORM LABEL ─────────────────────────────────────────────────────────────── */
.form-label {
    display: block;
    font-size: 11px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.form-label span { color: #ff8080; margin-left: 2px; } /* required asterisk */

/* ── BUTTONS ────────────────────────────────────────────────────────────────── */
.btn-primary {
    background: var(--gold);
    color: #0a1f0a;
    border: none;
    border-radius: 7px;
    padding: 13px 36px;
    font-family: 'Barlow', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary:hover:not(:disabled) { background: var(--gold-light); transform: translateY(-1px); }
.btn-primary:active:not(:disabled){ transform: scale(0.98); }
.btn-primary:disabled,
.btn--disabled {
    background: rgba(255,215,0,0.3);
    color: rgba(0,0,0,0.4);
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 0.5px solid var(--border-dim);
    border-radius: 7px;
    padding: 8px 18px;
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.35); color: #fff; }

/* ── PROGRESS BAR ───────────────────────────────────────────────────────────── */
.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--green-sa), var(--gold));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ── VIDEO PREVIEW ──────────────────────────────────────────────────────────── */
.video-preview-box {
    margin-top: 1rem;
    border-radius: 10px;
    overflow: hidden;
    border: 0.5px solid rgba(76,222,130,0.3);
    background: #000;
}
.video-preview-box video {
    width: 100%;
    max-height: 220px;
    display: block;
}
.video-preview-meta {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── TIMELINE ───────────────────────────────────────────────────────────────── */
.timeline-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 0.5px solid rgba(255,255,255,0.06);
    align-items: start;
}
.tl-date { font-size: 13px; font-weight: 700; }
.tl-open  { color: #4cde82; }
.tl-close { color: #ff8080; }
.tl-judge { color: rgba(255,255,255,0.45); }
.tl-win   { color: var(--gold); }
.tl-event { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

/* ── ELIGIBILITY ────────────────────────────────────────────────────────────── */
.elig-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 0.9rem;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    border: 0.5px solid rgba(255,255,255,0.07);
}
.elig-icon {
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    margin-top: 1px;
}
.elig-icon--yes { background: rgba(76,222,130,0.15); border: 0.5px solid rgba(76,222,130,0.4); color: #4cde82; }
.elig-icon--no  { background: rgba(255,100,100,0.12); border: 0.5px solid rgba(255,100,100,0.4); color: #ff8080; }
.elig-text { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ── DIVIDER ────────────────────────────────────────────────────────────────── */
.section-divider {
    height: 0.5px;
    background: rgba(255,255,255,0.07);
    margin: 0;
}

/* ── UTILITY ────────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }

/* ── SWEETALERT2 THEME OVERRIDES ────────────────────────────────────────────── */
.swal2-popup {
    background: #132613 !important;
    color: #f0f0e8 !important;
    border: 0.5px solid var(--border-gold) !important;
    border-radius: 14px !important;
}
.swal2-title  { color: #fff !important; }
.swal2-html-container { color: var(--text-muted) !important; }
.swal2-confirm { font-family: 'Barlow', sans-serif !important; font-weight: 700 !important; }
.swal2-cancel  { font-family: 'Barlow', sans-serif !important; }

/* ── ANIMATIONS ─────────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-in {
    animation: fadeInUp 0.5s ease forwards;
}
.animate-in--delay-1 { animation-delay: 0.1s; opacity: 0; }
.animate-in--delay-2 { animation-delay: 0.2s; opacity: 0; }
.animate-in--delay-3 { animation-delay: 0.3s; opacity: 0; }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .cd-num  { font-size: 36px; }
    .cd-block { min-width: 58px; padding: 10px 12px 8px; }
    .timeline-row { grid-template-columns: 1fr; gap: 2px; }
    .tl-date { font-size: 12px; }
}

/* ── MOBILE SPACING TIGHTENING ───────────────────────────────────────────────── */
@media (max-width: 639px) {

    /* Hero */
    header .max-w-4xl {
        padding: 1.5rem 1rem 1rem;
        text-align: center;
        align-items: center;
    }

    /* Sections — cut vertical padding in half */
    section.max-w-4xl {
        padding-top: 2rem;
        padding-bottom: 2rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Section headings tighter */
    .section-heading {
        font-size: 28px;
        margin-bottom: 0.75rem;
    }
    .section-eyebrow {
        margin-bottom: 3px;
    }

    /* Prize cards — 2 col grid, compact */
    .prize-grid-mobile {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .card {
        padding: 0.85rem 0.75rem;
    }
    .card .prize-icon { font-size: 20px; margin-bottom: 4px; }
    .card .prize-title { font-size: 12px; }
    .card .prize-desc { font-size: 11px; }

    /* Spots bar — stack vertically */
    .spots-bar {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        padding: 1rem;
    }
    .spot-divider { display: none; }
    .spot-num { font-size: 32px; }

    /* Countdown */
    .countdown-grid { justify-content: center; gap: 6px; }
    .cd-block { min-width: 58px; padding: 8px 10px 6px; }
    .cd-num { font-size: 36px; }

    /* CTA button */
    header .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 14px;
        font-size: 14px;
    }

    /* Timeline — single column */
    .timeline-row {
        grid-template-columns: 1fr;
        gap: 1px;
        padding: 0.65rem 0;
    }
    .tl-date { font-size: 11px; }
    .tl-event { font-size: 12px; }

    /* Steps */
    .step-row { padding: 0.85rem 0; gap: 0.75rem; }
    .step-num { font-size: 24px; min-width: 24px; }
    .step-title { font-size: 13px; }
    .step-body { font-size: 12px; }

    /* Eligibility — single column */
    .eligibility-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
    .elig-text { font-size: 12px; }

    /* Form */
    .form-row {
        grid-template-columns: 1fr !important;
    }
    .form-input, .form-select { font-size: 16px; } /* prevents iOS zoom on focus */
    .submit-btn { font-size: 14px; padding: 13px; }

    /* Drop zone */
    .drop-zone { padding: 1.5rem 1rem; }

    /* Dividers — tighter */
    .section-divider { margin: 0; }

    /* Footer */
    footer { padding: 1.25rem 1rem; }
}