/* 
 * Style for Kemenkumham FC26 Tournament Draw Application
 * Theme: Dark Navy (#0a192f) with Royal Gold (#d4af37) & Cyan Accents
 * Font: Inter (Google Fonts)
 */

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

:root {
    --bg-dark: #070c18;
    --bg-card: #0f172a;
    --bg-input: #1e293b;
    --primary: #d4af37; /* Kemenkumham Gold */
    --primary-hover: #bda02b;
    --accent: #00f2fe; /* Cyberpunk Cyan */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --border-gold: rgba(212, 175, 55, 0.3);
    --border-gold-focus: rgba(212, 175, 55, 0.8);
    --success: #10b981;
    --danger: #ef4444;
    --font-outfit: 'Outfit', sans-serif;
    --font-inter: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-inter);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, rgba(212, 175, 55, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 242, 254, 0.05) 0px, transparent 50%),
        radial-gradient(at 50% 0%, rgba(15, 23, 42, 0.5) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-outfit);
    font-weight: 700;
}

.gradient-text {
    background: linear-gradient(135deg, #fff 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-text-gold {
    background: linear-gradient(135deg, #ffe082 0%, var(--primary) 50%, #bda02b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* App Layout & Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.app-header {
    text-align: center;
    padding: 40px 20px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 30px;
}

.logo-kemenkumham {
    max-height: 90px;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3));
}

.theme-banner {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 50px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--border-gold);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Navigation Menu */
.navbar {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-family: var(--font-outfit);
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 4px;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: rgba(212, 175, 55, 0.1);
}

/* Cards & Elements */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
    padding: 24px;
    margin-bottom: 24px;
    transition: transform 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-gold {
    border: 1px solid var(--border-gold);
}

.card-gold::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.card-title {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-inter);
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: var(--font-outfit);
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #bda02b 100%);
    color: #070c18;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, #ffe082 0%, var(--primary) 100%);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-block {
    display: block;
    width: 100%;
}

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

/* Badge status */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Rules / Accordion */
.accordion-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.accordion-header:hover {
    border-color: var(--primary);
    background: rgba(212, 175, 55, 0.02);
}

.accordion-content {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-top: none;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    margin-top: -14px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* Clubs Display in Landing */
.club-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.club-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.club-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.1);
}

.club-avatar {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px auto;
    border: 1px solid rgba(255,255,255,0.1);
    font-family: var(--font-outfit);
    font-weight: 800;
    color: var(--primary);
    font-size: 1.4rem;
}

/* Spin Wheel Section styling */
.wheel-container {
    position: relative;
    width: 360px;
    height: 360px;
    margin: 40px auto;
    border-radius: 50%;
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.2);
    border: 8px solid var(--primary);
}

.wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #0f172a;
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 40px;
    z-index: 10;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.wheel-pointer::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #ef4444; /* red pointer */
}

.wheel-center-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    border: 4px solid #fff;
    border-radius: 50%;
    z-index: 12;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-outfit);
    font-weight: 800;
    font-size: 0.95rem;
    color: #fff;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.wheel-center-button:hover {
    transform: translate(-50%, -50%) scale(1.05);
    background: linear-gradient(135deg, #4ade80 0%, #166534 100%);
}

.wheel-center-button:disabled {
    background: #475569 !important;
    color: #94a3b8;
    cursor: not-allowed;
    transform: translate(-50%, -50%) !important;
}

/* Spinner modal result animation */
@keyframes confettifall {
    0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

.result-card-glow {
    animation: pulseGlow 1.5s infinite alternate;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px rgba(212, 175, 55, 0.2); }
    100% { box-shadow: 0 0 30px rgba(212, 175, 55, 0.6); }
}

/* Bracket styling (Live Bagan) */
.bracket-wrapper {
    display: flex;
    overflow-x: auto;
    padding: 20px 10px;
    min-height: 550px;
    gap: 50px;
    justify-content: center;
    align-items: stretch;
}

/* Round columns */
.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 240px;
    flex-shrink: 0;
}

.bracket-round-title {
    text-align: center;
    font-family: var(--font-outfit);
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    font-weight: 800;
    border-bottom: 1px solid var(--border-gold);
    padding-bottom: 10px;
}

/* Match structure */
.bracket-match {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    position: relative;
    transition: all 0.3s ease;
}

.bracket-match:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.15);
}

.bracket-match-header {
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 6px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
}

/* Competitors list */
.bracket-competitor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    transition: background 0.2s ease;
}

.bracket-competitor:last-child {
    border-bottom: none;
}

.bracket-competitor.winner {
    background: rgba(16, 185, 129, 0.08);
    color: #fff;
    font-weight: 600;
}

.bracket-competitor.loser {
    color: var(--text-muted);
}

.competitor-info {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 75%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.competitor-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.competitor-club {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: normal;
}

.bracket-competitor.winner .competitor-club {
    color: var(--primary);
}

.competitor-score {
    font-family: var(--font-outfit);
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 15px;
    text-align: center;
}

.bracket-competitor.winner .competitor-score {
    color: var(--success);
    background: rgba(16, 185, 129, 0.15);
}

.slot-index-badge {
    font-size: 0.65rem;
    background: rgba(255,255,255,0.07);
    padding: 1px 4px;
    border-radius: 3px;
    color: var(--text-muted);
    font-family: monospace;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 12, 24, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: var(--bg-card);
    border: 2px solid var(--primary);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-header {
    font-family: var(--font-outfit);
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.modal-body {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Table styling for Admin dashboard */
.table-responsive {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
}

.custom-table th {
    background: rgba(255,255,255,0.03);
    color: var(--primary);
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.custom-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.custom-table tr:hover td {
    background: rgba(255,255,255,0.01);
}

/* Admin override logs */
.log-box {
    background: #070c18;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 180px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.75rem;
    padding: 10px 15px;
    color: var(--text-muted);
}

.log-item {
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    padding-bottom: 4px;
}

.log-time {
    color: var(--accent);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 50px;
}

/* Alert banners */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}

/* Responsive grid layouts */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media(min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 2fr 1fr;
    }
    
    .admin-stats-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@keyframes pulseAlert {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}
