/* ===== DESIGN SYSTEM – Czech Dodgeball ===== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

/* ===== CSS Variables ===== */
:root {
    /* --- Light Theme (Default) --- */
    --bg: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-elevated: #F1F5F9;
    --bg-input: #F8FAFC;
    --bg-nav: rgba(248, 250, 252, 0.85);

    --accent: #2563EB;
    --accent-dim: #1D4ED8;
    --accent-glow: rgba(37, 99, 235, 0.1);

    --success: #22C55E;
    --warning: #EAB308;
    --danger: #EF4444;
    --info: #0EA5E9;

    --text: #0F172A;
    --text-muted: #475569;
    --text-faint: #94A3B8;

    --border: rgba(15, 23, 42, 0.12);
    --border-hover: rgba(15, 23, 42, 0.18);
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 48px rgba(15, 23, 42, 0.1);

    /* Radius */
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    /* Transitions */
    --transition: 0.2s ease;
    --transition-slow: 0.35s ease;
}

[data-theme='dark'] {
    /* --- Dark Theme --- */
    --bg: #0F1117;
    --bg-card: #1A1E2E;
    --bg-elevated: #222840;
    --bg-input: #0D1020;
    --bg-nav: rgba(15, 17, 23, 0.85);

    --accent: #3B82F6;
    --accent-dim: #2563EB;
    --accent-glow: rgba(59, 130, 246, 0.15);

    --success: #30D158;
    --warning: #FFD60A;
    --danger: #FF453A;
    --info: #64D2FF;

    --text: #E8EAF0;
    --text-muted: #7A8099;
    --text-faint: #3D4460;

    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.15);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.6);
}

/* ===== Reset ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== Typography ===== */
h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

h4 {
    font-size: 1rem;
    font-weight: 600;
}

p {
    color: var(--text-muted);
}

.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
}

/* ===== Material Icons ===== */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    user-select: none;
}

/* ===== Layout ===== */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

.container--wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.main-content {
    flex: 1;
    padding: 32px 0 64px;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: border-color var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
}

.card--elevated {
    background: var(--bg-elevated);
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.card__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.card__desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Grid ===== */
.grid {
    display: grid;
    gap: 16px;
}

.grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {

    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: 1fr;
    }
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn--primary {
    background: var(--accent);
    color: #fff;
}

.btn--primary:hover {
    background: var(--accent-dim);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.btn--secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn--secondary:hover {
    border-color: var(--border-hover);
    background: var(--bg-input);
}

.btn--danger {
    background: rgba(255, 69, 58, 0.12);
    color: var(--danger);
    border: 1px solid rgba(255, 69, 58, 0.2);
}

.btn--danger:hover {
    background: rgba(255, 69, 58, 0.2);
}

.btn--success {
    background: rgba(48, 209, 88, 0.12);
    color: var(--success);
    border: 1px solid rgba(48, 209, 88, 0.2);
}

.btn--success:hover {
    background: rgba(48, 209, 88, 0.2);
}

.btn--ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn--ghost:hover {
    color: var(--text);
    background: var(--bg-elevated);
}

.btn--icon {
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn--icon:hover {
    color: var(--text);
    border-color: var(--border-hover);
}

.btn--lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn--sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn--full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== Inputs ===== */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.input,
select.input,
textarea.input {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}

select.input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%237A8099' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input::placeholder {
    color: var(--text-faint);
}

.input--mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge--success {
    background: rgba(48, 209, 88, 0.12);
    color: var(--success);
}

.badge--danger {
    background: rgba(255, 69, 58, 0.12);
    color: var(--danger);
}

.badge--warning {
    background: rgba(255, 214, 10, 0.12);
    color: var(--warning);
}

.badge--info {
    background: rgba(100, 210, 255, 0.12);
    color: var(--info);
}

.badge--muted {
    background: var(--bg-elevated);
    color: var(--text-muted);
}

.badge--accent {
    background: var(--accent-glow);
    color: var(--accent);
}

/* ===== Dividers ===== */
.divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* ===== Loading / Spinner ===== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Toast notifications ===== */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: 0.9rem;
    animation: toastIn 0.3s ease;
    max-width: 360px;
}

.toast--success {
    border-left: 3px solid var(--success);
}

.toast--error {
    border-left: 3px solid var(--danger);
}

.toast--info {
    border-left: 3px solid var(--info);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Empty state ===== */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}

.empty-state .material-symbols-outlined {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* ===== Utility ===== */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.text-center {
    text-align: center;
}

.gap-sm {
    gap: 8px;
}

.gap {
    gap: 16px;
}

.gap-lg {
    gap: 24px;
}

.text-accent {
    color: var(--accent);
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-sm {
    font-size: 0.85rem;
}

.text-xs {
    font-size: 0.75rem;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.bold {
    font-weight: 700;
}

.mt-xs {
    margin-top: 4px;
}

.mt-sm {
    margin-top: 8px;
}

.mt {
    margin-top: 16px;
}

.mt-lg {
    margin-top: 24px;
}

.mb-sm {
    margin-bottom: 8px;
}

.mb {
    margin-bottom: 16px;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* ===== Tables ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* ===== Status Dots ===== */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-faint);
}

.status-dot--live {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Match History UI */
.score-badge {
    display: inline-flex;
    padding: 6px 16px;
    background: var(--bg-elevated);
    border-radius: 20px;
    font-weight: 800;
    color: var(--accent);
    font-size: 0.95rem;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.table tr:hover .score-badge {
    background: var(--bg-card);
    transform: scale(1.05);
}

.team-logo--sm {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.team-logo--sm.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-faint);
}

.team-logo--md {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.team-logo--md.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-faint);
}

.live-score {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    padding: 0 24px;
    letter-spacing: -0.05em;
}