/* ===========================
   CSS Variables for Easy Theming
   =========================== */
:root {
    /* Colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-match: #3a3a3a;
    --bg-match-hover: #454545;
    --border-color: #555;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-muted: #808080;
    --text-reference: #808080;

    /* Status Colors */
    --color-winner: #4caf50;
    --color-finished: #2196f3;
    --color-before: #ff9800;
    --color-not-scheduled: #757575;
    --color-in-progress: #9c27b0;
    --color-bye: #607d8b;
    --color-highlight: #ffd700;

    /* Match Colors */
    --color-p1: #B22C1C;
    --color-p1-transparent: #B22C1C00;
    --color-p2: #4C83C4;
    --color-p2-transparent: #4C83C400;
    --color-points: var(--text-primary);


    /* Spacing */
    --match-margin: 20px;

    /* Border Radius */
    --border-radius: 8px;
    --border-radius-small: 4px;
    --border-radius-team-card: 12px;

    /* Fonts */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 14px;
    --font-size-large: 18px;
    --font-size-small: 12px;
}

/* ===========================
   Base Styles
   =========================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

/* ===========================
   Layout
   =========================== */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 12px;
}

.tournament-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.tournament-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.tournament-header p {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
}

/* ===========================
   Utility Classes
   =========================== */
.text-center {
    text-align: center;
}

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

.hidden {
    display: none;
}

/* ===========================
   Skip Link for Accessibility
   =========================== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
    text-decoration: none;
    border-radius: var(--border-radius-small);
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* ===========================
   Error Message Styling
   =========================== */
.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: var(--border-radius);
    margin: 20px 0;
}

.error-message p {
    font-size: var(--font-size-base);
    margin: 0;
}

/* ===========================
   Loading State
   =========================== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: var(--font-size-large);
}

/* ===========================
   Scrollbar Styling
   =========================== */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--border-radius);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===========================
   Responsive Design (Base)
   =========================== */
@media (max-width: 768px) {
    :root {
        --font-size-base: 13px;
        --font-size-large: 16px;
        --border-radius-team-card: 8px;
    }

    .tournament-header h1 {
        font-size: 1.5rem;
    }

    .container {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-base: 12px;
        --border-radius-team-card: 6px;
    }

    .tournament-header h1 {
        font-size: 1.25rem;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* ===========================
   Page Toggle
   =========================== */
.page-toggle {
    display: inline-flex;
    background-color: transparent;
    border-radius: 0;
    padding: 2px 4px;
    gap: 4px;
}

.toggle-option {
    padding: 1px 4px;
    border-radius: var(--border-radius-small);
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-option.active {
    background-color: var(--bg-match);
    color: var(--text-primary);
    cursor: default;
}

.toggle-option:not(.active):hover {
    color: var(--text-secondary);
    background-color: var(--bg-match-hover);
}

a {
  all: unset;
  cursor: pointer;
}
