/* Referee.is - Professional Design */

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

/* CSS Variables */
:root {
    /* Colors */
    --primary: #0a0f1c;
    --primary-light: #111827;
    --secondary: #1f2937;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.1);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --yellow-card: #fbbf24;
    --red-card: #dc2626;

    /* Text */
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Borders & Shadows */
    --border-color: #374151;
    --border-light: rgba(255, 255, 255, 0.05);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);

    /* Typography */
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(180deg, var(--primary) 0%, #0d1321 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Links */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==================== HEADER ==================== */
.header {
    background: rgba(10, 15, 28, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: transform var(--transition-fast);
}

.logo:hover {
    color: var(--text-primary);
    transform: scale(1.02);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-links a:hover {
    color: var(--text-primary);
    background: var(--accent-light);
}

.nav-links a.active {
    color: var(--text-primary);
    background: var(--accent);
}

/* ==================== MAIN ==================== */
.main {
    flex: 1;
    padding: 2.5rem 0;
}

/* ==================== HERO ==================== */
.hero {
    text-align: center;
    padding: 3rem 0 4rem;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 400;
}

.subtitle strong {
    color: var(--accent);
    font-weight: 600;
}

/* ==================== PAGE HEADER ==================== */
.page-header {
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* ==================== BREADCRUMB ==================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--accent);
}

/* ==================== LEAGUE SECTION ==================== */
.league-section {
    margin-bottom: 3rem;
}

.league-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.league-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.league-header h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
}

.league-header h2 a {
    color: var(--text-primary);
}

.league-header h2 a:hover {
    color: var(--accent);
}

.league-country {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-left: auto;
    padding: 0.25rem 0.75rem;
    background: var(--secondary);
    border-radius: var(--radius-sm);
}

/* ==================== MATCHES GRID ==================== */
.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

/* ==================== MATCH CARD ==================== */
.match-card {
    background: linear-gradient(145deg, var(--primary-light) 0%, var(--secondary) 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, #8b5cf6 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.match-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-xl), 0 0 40px rgba(59, 130, 246, 0.1);
}

.match-card:hover::before {
    opacity: 1;
}

.match-link {
    display: block;
    padding: 1.5rem;
    color: var(--text-primary);
}

.match-time {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.match-time .time {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.375rem 1rem;
    background: var(--primary);
    border-radius: var(--radius-sm);
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: linear-gradient(135deg, var(--danger) 0%, #b91c1c 100%);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: pulse-live 2s infinite;
}

.live-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes pulse-live {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    background: var(--secondary);
    color: var(--text-secondary);
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.finished {
    background: var(--success);
    color: white;
}

.match-teams {
    margin-bottom: 1.25rem;
}

.match-teams .team {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.625rem 0;
}

.team-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--primary);
    padding: 4px;
}

.team-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.9375rem;
}

.score {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    min-width: 28px;
    text-align: center;
}

.match-referee {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.match-referee::before {
    content: '👨‍⚖️';
    font-size: 1rem;
}

.referee-name {
    color: var(--accent);
    font-weight: 500;
}

.referee-tba {
    color: var(--text-muted);
    font-style: italic;
}

/* ==================== MATCH DETAIL ==================== */
.match-detail {
    background: linear-gradient(145deg, var(--primary-light) 0%, var(--secondary) 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.match-header {
    text-align: center;
    margin-bottom: 2rem;
}

.league-info {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    padding: 0.5rem 1.25rem;
    background: var(--primary);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.match-date-time {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.match-score-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    padding: 2.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.team-display {
    text-align: center;
    flex: 1;
    max-width: 200px;
}

.team-logo-large {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto 1rem;
    padding: 0.5rem;
    background: var(--primary);
    border-radius: var(--radius-lg);
}

.team-display h2 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
}

.score-display {
    text-align: center;
    padding: 0 2rem;
}

.score-display .score {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.score-display .vs {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-muted);
}

.halftime-score {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.match-status {
    margin-top: 0.75rem;
}

/* ==================== REFEREE SECTION ==================== */
.referee-section,
.match-info-section,
.match-stats-section,
.matches-section,
.related-section {
    margin-bottom: 2rem;
}

.referee-section h2,
.match-info-section h2,
.match-stats-section h2,
.matches-section h2,
.related-section h2,
.stats-section h2,
.leagues-section h2,
.referees-section h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.referee-card {
    display: flex;
    gap: 2rem;
    align-items: center;
    background: var(--primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.referee-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
}

.referee-photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.referee-info h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.referee-info h3 a {
    color: var(--text-primary);
}

.referee-info h3 a:hover {
    color: var(--accent);
}

.referee-nationality {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

.referee-stats {
    display: flex;
    gap: 2rem;
}

.referee-stats .stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-value.yellow { color: var(--yellow-card); }
.stat-value.red { color: var(--red-card); }

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.referee-tba-notice {
    background: var(--primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
}

/* ==================== INFO LIST ==================== */
.info-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    background: var(--primary);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.info-item dt {
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.info-item dd {
    font-weight: 600;
    font-size: 0.9375rem;
}

/* ==================== STATS GRID ==================== */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.stat-name {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.home-stat,
.away-stat {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.125rem;
    min-width: 36px;
    text-align: center;
}

/* ==================== MATCHES LIST ==================== */
.matches-list,
.matches-table {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.match-list-item,
.match-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.match-list-item:hover,
.match-row:hover {
    border-color: var(--accent);
    background: var(--primary-light);
    transform: translateX(4px);
}

.match-date,
.match-time-col {
    min-width: 70px;
    text-align: center;
}

.match-date .date,
.match-time-col .time {
    font-weight: 600;
    font-size: 0.875rem;
}

.match-date .time {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.match-teams-col {
    flex: 1;
}

.match-league-col {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    min-width: 150px;
}

.match-referee-col {
    min-width: 130px;
    text-align: right;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-weight: 500;
    color: var(--accent);
}

.view-all-link:hover {
    gap: 0.75rem;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
}

.empty-state h2 {
    font-family: var(--font-display);
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: var(--text-secondary);
}

/* ==================== FILTERS ==================== */
.filters-section {
    margin-bottom: 2rem;
}

.filters-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.filter-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group select,
.filter-group input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--primary);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: var(--font-body);
    min-width: 200px;
    transition: border-color var(--transition-fast);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.filter-group.search {
    flex-direction: row;
    align-items: flex-end;
    gap: 0.5rem;
}

.filter-group.search label {
    display: none;
}

.filter-group button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.filter-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* ==================== CARDS GRID ==================== */
.referees-grid,
.leagues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.referee-card,
.league-card {
    background: linear-gradient(145deg, var(--primary-light) 0%, var(--secondary) 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-normal);
}

.referee-card:hover,
.league-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-xl);
}

.referee-card a,
.league-card a {
    color: var(--text-primary);
    display: block;
}

.league-logo,
.league-logo-large img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin: 0 auto 1.25rem;
    padding: 0.5rem;
    background: var(--primary);
    border-radius: var(--radius-md);
}

.league-logo-placeholder,
.logo-placeholder {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.league-name,
.referee-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.league-country,
.referee-nationality {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.country-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

.league-type,
.league-type-badge {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.season-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--secondary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

/* ==================== PROFILE PAGES ==================== */
.referee-profile,
.league-profile {
    background: linear-gradient(145deg, var(--primary-light) 0%, var(--secondary) 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.profile-header {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-light);
}

.profile-photo img,
.photo-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent);
}

.photo-placeholder {
    background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
}

.profile-info h1 {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.375rem;
}

.nationality,
.country {
    color: var(--text-secondary);
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.birth-date {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-top: 0.25rem;
}

/* Stats Cards */
.stats-section .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-light);
}

.stat-card .stat-value {
    font-size: 2.25rem;
}

.averages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.avg-card {
    background: var(--primary);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-light);
}

.avg-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.avg-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Team logos */
.team-logo-small,
.league-logo-small {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.league-logo-tiny {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* Cards display */
.match-cards {
    display: flex;
    gap: 0.75rem;
}

.yellow-card,
.red-card {
    display: inline-block;
    width: 14px;
    height: 18px;
    border-radius: 2px;
}

.yellow-card {
    background: var(--yellow-card);
}

.red-card {
    background: var(--red-card);
}

/* ==================== CHIPS ==================== */
.leagues-list,
.referees-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.league-chip,
.referee-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.league-chip:hover,
.referee-chip:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
}

.page-link {
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.page-link:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.page-info {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 1.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
    color: white;
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--primary);
    border-top: 1px solid var(--border-light);
    padding: 4rem 0 2rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr repeat(2, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-section h4 {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.625rem;
}

.footer-section ul a {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    transition: color var(--transition-fast);
}

.footer-section ul a:hover {
    color: var(--accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ==================== DATE SECTIONS ==================== */
.date-section {
    margin-bottom: 2.5rem;
}

.date-header {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 0.25rem;
    }

    .nav-links a {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .matches-grid {
        grid-template-columns: 1fr;
    }

    .match-score-section {
        flex-direction: column;
        gap: 2rem;
    }

    .score-display {
        order: -1;
        padding: 0;
    }

    .team-display {
        max-width: none;
    }

    .referee-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 1.25rem;
    }

    .referee-stats {
        justify-content: center;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .match-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .match-league-col,
    .match-referee-col {
        width: 100%;
        text-align: left;
    }

    .info-list {
        grid-template-columns: 1fr;
    }

    .filters-form {
        flex-direction: column;
    }

    .filter-group select,
    .filter-group input {
        width: 100%;
    }

    .filter-group.search {
        flex-direction: column;
        align-items: stretch;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .referees-grid,
    .leagues-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--primary);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 5px;
}

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

/* ==================== SELECTION ==================== */
::selection {
    background: var(--accent);
    color: white;
}

/* ==================== SEARCH OVERLAY ==================== */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    width: 100%;
    max-width: 640px;
    background: var(--primary-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transform: translateY(-20px) scale(0.95);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-xl);
}

.search-overlay.active .search-container {
    transform: translateY(0) scale(1);
}

.search-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-icon-input {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-family: var(--font-body);
}

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

.search-shortcut {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
}

.search-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color var(--transition-fast);
}

.search-close:hover {
    color: var(--text-primary);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-section {
    padding: 1rem 1.5rem;
}

.search-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.search-result-item:hover {
    background: var(--secondary);
}

.search-icon {
    font-size: 1.25rem;
}

.search-name {
    flex: 1;
    font-weight: 500;
}

.search-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.search-loading,
.search-empty,
.search-error {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.search-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--primary);
}

.search-tip {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-tip kbd {
    background: var(--secondary);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-family: monospace;
}

/* ==================== COUNTDOWN TIMER ==================== */
.countdown {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--secondary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    min-width: 48px;
}

.countdown-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.countdown-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.countdown-live {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--danger);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    animation: pulse 2s infinite;
}

.countdown-live::before {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ==================== SORT TABS ==================== */
.sort-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.sort-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.sort-tab:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.sort-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.tab-icon {
    font-size: 1rem;
}

/* ==================== RANKING CARDS ==================== */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ranking-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--primary-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    transition: all var(--transition-fast);
}

.ranking-card:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.ranking-position {
    width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.position-medal {
    font-size: 2rem;
}

.position-number {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-muted);
}

.ranking-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.ranking-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ranking-photo .photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary);
    color: var(--text-muted);
}

.ranking-photo .photo-placeholder svg {
    width: 24px;
    height: 24px;
}

.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-name:hover {
    color: var(--accent);
}

.ranking-nationality {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ranking-stats {
    display: flex;
    gap: 1.5rem;
}

.ranking-stats .stat-item {
    text-align: center;
}

.ranking-stats .stat-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.ranking-stats .stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.ranking-severity {
    width: 180px;
    flex-shrink: 0;
}

.ranking-action {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.ranking-action:hover {
    color: var(--accent);
}

/* ==================== SEVERITY INDICATOR ==================== */
.severity-indicator {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.severity-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.severity-label.severity-high {
    color: var(--danger);
}

.severity-label.severity-medium {
    color: var(--warning);
}

.severity-label.severity-moderate {
    color: var(--yellow-card);
}

.severity-label.severity-low {
    color: var(--success);
}

.severity-bar {
    height: 6px;
    background: var(--secondary);
    border-radius: 3px;
    overflow: hidden;
}

.severity-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease-out;
}

.severity-bar-fill.severity-high {
    background: linear-gradient(90deg, var(--warning), var(--danger));
}

.severity-bar-fill.severity-medium {
    background: linear-gradient(90deg, var(--yellow-card), var(--warning));
}

.severity-bar-fill.severity-moderate {
    background: linear-gradient(90deg, var(--success), var(--yellow-card));
}

.severity-bar-fill.severity-low {
    background: var(--success);
}

.severity-score {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--secondary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    opacity: 0;
    transition: all var(--transition-normal);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ==================== SHARE BUTTONS ==================== */
.share-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.share-section h4 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.share-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.share-btn.twitter:hover {
    background: #1da1f2;
    border-color: #1da1f2;
    color: white;
}

.share-btn.facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
    color: white;
}

.share-btn.whatsapp:hover {
    background: #25d366;
    border-color: #25d366;
    color: white;
}

.share-btn.telegram:hover {
    background: #0088cc;
    border-color: #0088cc;
    color: white;
}

/* ==================== TEAM FORM INDICATOR ==================== */
.team-form {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.form-badge {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}

.form-badge.win {
    background: var(--success);
}

.form-badge.draw {
    background: var(--text-muted);
}

.form-badge.loss {
    background: var(--danger);
}

.form-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* ==================== H2H SECTION ==================== */
.h2h-section {
    margin-top: 2rem;
}

.h2h-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.h2h-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.h2h-stat {
    text-align: center;
    padding: 1rem;
    background: var(--secondary);
    border-radius: var(--radius-md);
}

.h2h-stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.h2h-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.h2h-matches {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.h2h-match {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--secondary);
    border-radius: var(--radius-md);
}

.h2h-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 80px;
    flex-shrink: 0;
}

.h2h-teams {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.h2h-team {
    flex: 1;
    text-align: center;
    font-size: 0.875rem;
}

.h2h-score {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

/* ==================== WEATHER WIDGET ==================== */
.weather-widget {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--secondary) 0%, rgba(59, 130, 246, 0.1) 100%);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-top: 1.5rem;
}

.weather-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.weather-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.weather-temp {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.weather-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.weather-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.weather-minmax {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.weather-rain {
    font-size: 0.8rem;
    color: var(--accent);
}

/* ==================== SIMILAR MATCHES ==================== */
.similar-matches {
    margin-top: 2rem;
}

.similar-matches h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

/* ==================== RESPONSIVE ADDITIONS ==================== */
/* ==================== VISUAL STAT BARS ==================== */
.avg-visual {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.visual-bar {
    flex: 1;
    height: 8px;
    background: var(--secondary);
    border-radius: 4px;
    overflow: hidden;
}

.visual-bar .bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease-out;
}

.yellow-bar .bar-fill {
    background: linear-gradient(90deg, var(--warning), var(--yellow-card));
}

.red-bar .bar-fill {
    background: linear-gradient(90deg, var(--warning), var(--danger));
}

.averages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.avg-card {
    background: var(--secondary);
    padding: 1.25rem;
    border-radius: var(--radius-md);
}

.avg-card .avg-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.avg-card .avg-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ==================== COUNTDOWN CONTAINER ==================== */
.countdown-container {
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .search-container {
        margin: 0 1rem;
        border-radius: var(--radius-lg);
    }

    .ranking-card {
        flex-wrap: wrap;
        padding: 1rem;
    }

    .ranking-position {
        width: 40px;
    }

    .ranking-stats {
        width: 100%;
        justify-content: space-around;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
    }

    .ranking-severity {
        width: 100%;
        margin-top: 0.5rem;
    }

    .ranking-action {
        display: none;
    }

    .sort-tabs {
        padding-bottom: 0.5rem;
    }

    .countdown-item {
        min-width: 40px;
        padding: 0.4rem 0.5rem;
    }

    .countdown-value {
        font-size: 1.25rem;
    }

    .h2h-summary {
        grid-template-columns: 1fr;
    }

    .h2h-match {
        flex-direction: column;
        text-align: center;
    }

    .h2h-date {
        width: auto;
    }
}
