@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,400;0,700;1,900&family=Inter:wght@400;600;800&display=swap');

:root {
    --bg-body: #111827;      /* Mély sötétkék/szürke */
    --bg-card: #1f2937;      /* Kicsit világosabb kártya alap */
    --bg-card-hover: #374151;
    
    --primary: #ef4444;      /* "Red Cup" Piros */
    --primary-dark: #dc2626;
    
    --accent: #f59e0b;       /* Sör / Arany szín */
    --success: #10b981;      /* Zöld asztal posztó */
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    
    --radius: 12px;          /* Moderált lekerekítés */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, .brand {
    font-family: 'Kanit', sans-serif; /* Sportos, vastag betű */
    text-transform: uppercase;
    line-height: 1.1;
}

h1 { font-weight: 900; letter-spacing: 1px; font-style: italic; }
h2 { font-weight: 700; letter-spacing: 0.5px; }

/* --- COMPONENTS --- */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.2s, background-color 0.2s;
}

.clickable-card:active {
    transform: scale(0.98);
}

.glass {
    /* Megtartjuk a nevet a kompatibilitás miatt, de ez most sima solid header lesz */
    background-color: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-family: 'Kanit', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover { background-color: var(--primary-dark); }

.btn-ghost {
    background-color: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover {
    color: white;
    background-color: rgba(255,255,255,0.05);
}

.btn-action {
    background-color: var(--success);
    color: white;
}

/* --- BRACKET SPECIFIC --- */
.match-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1rem;
    position: relative;
    border-left: 5px solid #374151; /* Alap szürke csík */
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.match-card.in-progress {
    border-left-color: var(--accent);
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.05) 0%, var(--bg-card) 100%);
}

.match-card.complete {
    border-left-color: var(--success);
}

.team-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.team-row span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}

.winner-text { color: var(--success); }
.loser-text { color: var(--text-muted); opacity: 0.7; }

.score-box {
    background: rgba(0,0,0,0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Kanit', sans-serif;
    min-width: 24px;
    text-align: center;
}

.table-badge {
    position: absolute;
    top: -10px;
    right: 10px;
    background: var(--accent);
    color: #111;
    font-family: 'Kanit', sans-serif;
    font-weight: 900;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* --- FORMS --- */
input, select {
    background: #374151;
    border: 1px solid #4b5563;
    color: white;
    padding: 10px;
    border-radius: 6px;
    width: 100%;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Scrollbar szépítés */
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 4px; }

/* --- AJAX ANIMÁCIÓK --- */
.updating {
    animation: flash-update 1s ease-out;
}

@keyframes flash-update {
    0% { background-color: rgba(255, 255, 255, 0.2); transform: scale(1.02); }
    100% { background-color: var(--bg-card); transform: scale(1); }
}

/* Toast Értesítések */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border-left: 4px solid var(--primary);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    min-width: 250px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toast.show { transform: translateX(0); }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--primary); }

/* Betöltés indikátor gombokon */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s infinite linear;
}
@keyframes spin { to { transform: rotate(360deg); } }