/* ============================================================
   HAPKIDO INDONESIA — SPORTY DESIGN SYSTEM
   ============================================================ */

/* ---------- IMPORTS ---------- */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ---------- CSS VARIABLES ---------- */
:root {
    --bg-deep: #070b14;
    --bg-primary: #0a0e1a;
    --bg-surface: rgba(15, 23, 42, 0.7);
    --bg-surface-solid: #0f172a;
    --bg-elevated: rgba(30, 41, 59, 0.6);
    --accent-red: #ef4444;
    --accent-red-dark: #b91c1c;
    --accent-gold: #f59e0b;
    --accent-gold-dark: #d97706;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-subtle: rgba(148, 163, 184, 0.12);
}

/* ---------- BASE ---------- */
* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: linear-gradient(145deg, var(--bg-deep) 0%, var(--bg-primary) 40%, #0f1729 100%);
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
}

/* Geometric grid overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(245, 158, 11, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245, 158, 11, 0.025) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

body > * { position: relative; z-index: 1; }

h1, h2, h3, h4, h5, h6 {
    font-family: 'Rajdhani', sans-serif;
}

/* ---------- GLASS CARDS ---------- */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.glass-card-elevated {
    background: rgba(20, 30, 52, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

/* ---------- HEADER ---------- */
.header-bar {
    background: linear-gradient(135deg, rgba(10, 14, 26, 0.97), rgba(15, 23, 42, 0.97));
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, transparent, var(--accent-red), var(--accent-gold), var(--accent-red), transparent) 1;
    backdrop-filter: blur(12px);
    padding: 0.75rem 0;
}

.brand-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--accent-gold), #fbbf24, var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.95rem;
}

/* ---------- SECTION TITLES ---------- */
.section-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title-green {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title-cyan {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-cyan);
}

/* ---------- BUTTONS ---------- */
.btn {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.45);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    box-shadow: 0 2px 12px rgba(220, 38, 38, 0.3);
}
.btn-danger:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(220, 38, 38, 0.45);
}

.btn-danger-dark {
    background: linear-gradient(135deg, #991b1b, #7f1d1d);
    color: white;
    box-shadow: 0 2px 12px rgba(153, 27, 27, 0.3);
}
.btn-danger-dark:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(153, 27, 27, 0.45);
}

.btn-success {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    box-shadow: 0 2px 12px rgba(5, 150, 105, 0.3);
}
.btn-success:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(5, 150, 105, 0.45);
}

.btn-warning {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
    box-shadow: 0 2px 12px rgba(217, 119, 6, 0.3);
}
.btn-warning:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(217, 119, 6, 0.45);
}

.btn-orange {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: white;
    box-shadow: 0 2px 12px rgba(234, 88, 12, 0.3);
}
.btn-orange:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(234, 88, 12, 0.45);
}

.btn-cyan {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    color: white;
    box-shadow: 0 2px 12px rgba(8, 145, 178, 0.3);
}
.btn-cyan:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(8, 145, 178, 0.45);
}

.btn-purple {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}
.btn-purple:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.45);
}

.btn-ghost {
    background: rgba(100, 116, 139, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(100, 116, 139, 0.2);
}
.btn-ghost:hover:not(:disabled) {
    background: rgba(100, 116, 139, 0.3);
    color: white;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 10px;
}

.btn-xl {
    padding: 1rem 2.5rem;
    font-size: 1.3rem;
    border-radius: 12px;
}

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

.btn-block { width: 100%; }

/* ---------- FORM INPUTS ---------- */
.input-sporty {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.25s ease;
    width: 100%;
    font-family: 'Inter', sans-serif;
}

.input-sporty:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12), 0 0 20px rgba(6, 182, 212, 0.08);
}

.input-sporty::placeholder { color: var(--text-muted); }

select.input-sporty {
    appearance: auto;
    cursor: pointer;
}

.form-label {
    display: block;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

/* ---------- TABLE ---------- */
.table-sporty {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-sporty thead {
    background-color: var(--bg-surface-solid);
    background-image: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(245, 158, 11, 0.12));
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-sporty thead th {
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent-gold);
    border-bottom: 2px solid rgba(245, 158, 11, 0.15);
}

.table-sporty tbody tr {
    transition: all 0.15s ease;
    cursor: pointer;
    border-bottom: 1px solid rgba(148, 163, 184, 0.05);
}

.table-sporty tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.3);
}

.table-sporty tbody tr:hover {
    background: rgba(6, 182, 212, 0.07) !important;
}

.table-sporty tbody td {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

/* ---------- LISTBOX ITEMS ---------- */
.listbox-item {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
}

.listbox-item:hover {
    background: rgba(30, 41, 59, 0.75);
    border-color: rgba(6, 182, 212, 0.15);
}

.listbox-item.selected {
    border-color: var(--accent-gold);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.12);
    background: rgba(245, 158, 11, 0.08);
}

/* ---------- LOGIN PAGE ---------- */
.login-bg {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(239, 68, 68, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(245, 158, 11, 0.06) 0%, transparent 50%),
        linear-gradient(145deg, var(--bg-deep) 0%, var(--bg-primary) 100%);
    min-height: 100vh;
}

.login-divider {
    height: 3px;
    width: 60px;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-gold));
    border-radius: 2px;
    margin: 0 auto;
}

/* ---------- LOADING OVERLAY ---------- */
.loading-overlay {
    background: rgba(7, 11, 20, 0.85);
    backdrop-filter: blur(8px);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(245, 158, 11, 0.15);
    border-top: 3px solid var(--accent-gold);
    border-right: 3px solid var(--accent-red);
    border-radius: 50%;
    animation: spinner 0.75s linear infinite;
}

/* ---------- MODAL ---------- */
.modal-backdrop {
    background: rgba(7, 11, 20, 0.7);
    backdrop-filter: blur(6px);
}

.modal-card {
    animation: modal-enter 0.25s ease-out;
}

/* ---------- ARENA ACCENT BORDERS ---------- */
.arena-a-accent { border-left: 3px solid #ef4444; }
.arena-b-accent { border-left: 3px solid #f59e0b; }
.arena-c-accent { border-left: 3px solid #10b981; }

.arena-a-border-top { border-top: 3px solid #ef4444; }
.arena-b-border-top { border-top: 3px solid #f59e0b; }
.arena-c-border-top { border-top: 3px solid #10b981; }

.arena-a-border-bottom { border-bottom: 3px solid #ef4444; }
.arena-b-border-bottom { border-bottom: 3px solid #f59e0b; }
.arena-c-border-bottom { border-bottom: 3px solid #10b981; }

/* ---------- ARENA GLOW (for green "DI DALAM ARENA" section) ---------- */
.arena-glow {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.35); }

/* ---------- ANIMATIONS ---------- */
@keyframes spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modal-enter {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35); }
    70% { box-shadow: 0 0 0 12px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.animate-fade-in { animation: fade-in-up 0.4s ease-out; }
.animate-pulse-ring { animation: pulse-ring 2s infinite; }

/* ---------- MONITOR PAGE (large display) ---------- */
.monitor-item {
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.monitor-item-tunggu { background: rgba(30, 41, 59, 0.7); border-left: 3px solid var(--accent-cyan); }
.monitor-item-a { background: rgba(239, 68, 68, 0.12); border-left: 3px solid #ef4444; }
.monitor-item-b { background: rgba(245, 158, 11, 0.12); border-left: 3px solid #f59e0b; }
.monitor-item-c { background: rgba(16, 185, 129, 0.12); border-left: 3px solid #10b981; }
.monitor-item-umum { background: rgba(100, 116, 139, 0.15); border-left: 3px solid #64748b; }

/* ---------- RESULT PAGE ---------- */
.result-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 10px;
    padding: 0.85rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.result-card:hover {
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* ---------- DAERYUN VS BORDER ---------- */
.vs-biru {
    border: 2px solid rgba(37, 99, 235, 0.4);
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.05);
}

.vs-merah {
    border: 2px solid rgba(220, 38, 38, 0.4);
    border-radius: 12px;
    background: rgba(220, 38, 38, 0.05);
}

/* ---------- UTILITIES ---------- */
.text-gradient-gold {
    background: linear-gradient(135deg, var(--accent-gold), #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.border-gradient-gold {
    border: 1px solid transparent;
    border-image: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(239, 68, 68, 0.3)) 1;
}

.inner-panel {
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.06);
    border-radius: 10px;
}

/* ---------- FULL SITE POLISH + RESPONSIVE LAYOUT ---------- */
html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at 10% 10%, rgba(239, 68, 68, 0.13), transparent 30rem),
        radial-gradient(circle at 92% 8%, rgba(6, 182, 212, 0.11), transparent 28rem),
        radial-gradient(circle at 50% 100%, rgba(245, 158, 11, 0.09), transparent 34rem),
        linear-gradient(145deg, var(--bg-deep) 0%, var(--bg-primary) 42%, #111827 100%);
    overflow-x: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select {
    -webkit-tap-highlight-color: transparent;
}

.container {
    width: min(100% - 2rem, 1440px) !important;
}

.glass-card {
    background:
        linear-gradient(145deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.7)),
        var(--bg-surface);
    border-color: rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.glass-card-elevated {
    background:
        linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(10, 14, 26, 0.9)),
        rgba(20, 30, 52, 0.85);
    border-radius: 12px;
}

.header-bar {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.26);
}

.brand-title {
    letter-spacing: 3px;
    line-height: 1;
}

.brand-subtitle {
    line-height: 1.25;
}

.btn {
    min-height: 2.35rem;
    white-space: normal;
    text-align: center;
}

.input-sporty {
    min-height: 2.5rem;
    padding: 0.62rem 0.78rem;
}

.table-sporty {
    min-width: 680px;
}

.listbox-item {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.65));
    border-color: rgba(148, 163, 184, 0.12);
    font-size: 0.84rem;
    overflow-wrap: anywhere;
}

.login-bg {
    background:
        radial-gradient(ellipse at 18% 30%, rgba(239, 68, 68, 0.14) 0%, transparent 44%),
        radial-gradient(ellipse at 84% 34%, rgba(6, 182, 212, 0.12) 0%, transparent 42%),
        linear-gradient(145deg, var(--bg-deep) 0%, var(--bg-primary) 100%);
    padding: 1rem;
}

.page-card-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.page-card-title::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 18px currentColor;
    flex: 0 0 auto;
}

.glass-card > h2:first-child,
.glass-card > h3:first-child {
    line-height: 1.15;
}

#arena-selection-view {
    max-width: 920px;
    margin: 0 auto;
    padding: clamp(2rem, 8vh, 5rem) 0;
}

#arena-selection-view > h2 {
    color: var(--text-primary);
    text-transform: uppercase;
}

#main-scoring-view {
    animation: fade-in-up 0.25s ease-out;
}

#participant-list > div,
#hyung-scoring-list > div {
    overflow-wrap: anywhere;
}

.vs-biru,
.vs-merah {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.monitor-item {
    overflow-wrap: anywhere;
}

@media (max-width: 1023px) {
    #main-app.h-screen {
        height: auto !important;
        min-height: 100vh;
    }

    #main-app main.overflow-hidden {
        overflow: visible !important;
    }

    #main-app main {
        min-height: calc(100vh - 84px);
    }

    .lg\:col-span-3,
    .lg\:col-span-2 {
        min-width: 0;
    }
}

@media (max-width: 767px) {
    .container {
        width: min(100% - 1rem, 1440px) !important;
    }

    body::before {
        background-size: 34px 34px;
    }

    .header-bar .container,
    .header-bar [class*="container"] {
        flex-direction: column;
        justify-content: center;
        gap: 0.75rem;
        text-align: center;
    }

    .header-bar .flex {
        flex-wrap: wrap;
        justify-content: center;
    }

    .brand-title {
        font-size: clamp(1.45rem, 7vw, 2.1rem) !important;
        letter-spacing: 1.6px;
        overflow-wrap: anywhere;
    }

    .brand-subtitle {
        font-size: 0.78rem !important;
        letter-spacing: 1px;
    }

    .glass-card,
    .glass-card-elevated,
    .inner-panel {
        border-radius: 10px;
    }

    .glass-card,
    .glass-card-elevated {
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
    }

    .btn {
        width: 100%;
        min-height: 2.65rem;
        padding: 0.65rem 0.8rem;
    }

    .btn-sm {
        font-size: 0.78rem;
    }

    .btn-xl {
        padding: 0.85rem 1rem;
        font-size: 1.05rem;
    }

    .input-sporty {
        font-size: 1rem;
    }

    .table-sporty thead th,
    .table-sporty tbody td {
        padding: 0.58rem 0.65rem;
    }

    .listbox-item {
        padding: 0.72rem 0.8rem;
        font-size: 0.9rem;
    }

    .modal-backdrop {
        padding: 1rem;
    }

    .monitor-item {
        padding: 0.75rem 0.85rem;
    }
}

@media (max-width: 420px) {
    .container {
        width: min(100% - 0.75rem, 1440px) !important;
    }

    .brand-title {
        font-size: 1.35rem !important;
    }
}
