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

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --bg: #f0f4f8;
    --surface: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
}

/* Navbar */
.navbar {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 1rem;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
}

.navbar-brand svg {
    color: var(--secondary);
}

.navbar-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(15,23,42,0.8), rgba(30,64,175,0.6)),
                url('https://images.unsplash.com/photo-1730739463889-34c7279277a9?w=1920') center/cover;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.hero h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.hero p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(37,99,235,0.3);
}

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

.btn-secondary {
    background: var(--secondary);
    color: white;
    box-shadow: 0 4px 15px rgba(245,158,11,0.3);
}

.btn-success {
    background: var(--success);
    color: white;
}

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

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

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Stats Bar */
.stats-bar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
}

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Section Title */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Match Cards Grid */
.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Match Card */
.match-card {
    background: white;
    border-radius: 24px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.match-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

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

.match-status {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.match-status.upcoming {
    background: #dbeafe;
    color: #1d4ed8;
}

.match-status.completed {
    background: #d1fae5;
    color: #059669;
}

.match-status.live,
.match-status.in_progress {
    background: #fee2e2;
    color: #dc2626;
    animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.match-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

.team {
    flex: 1;
    text-align: center;
}

.team-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 0.5rem;
    background: #f1f5f9;
}

.team-short {
    font-weight: 700;
    font-size: 0.95rem;
}

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

.vs-badge {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: white;
    font-weight: 900;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.match-venue {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.match-action {
    width: 100%;
    justify-content: center;
}

/* Countdown Timer */
.countdown-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #1e40af;
    background: #dbeafe;
    font-weight: 500;
}

.countdown-timer.live-timer {
    background: #fee2e2;
    color: #dc2626;
    font-weight: 700;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc2626;
    display: inline-block;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
}

/* Forms */
.form-section {
    background: #f8fafc;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.form-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input, .form-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    background: white;
    transition: all 0.2s;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.1);
}

/* Cards */
.card {
    background: white;
    border-radius: 24px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* Leaderboard */
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 16px;
    margin-bottom: 0.75rem;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.leaderboard-item.rank-1 {
    border-color: #fbbf24;
    box-shadow: 0 4px 15px rgba(251,191,36,0.2);
}

.leaderboard-item.rank-2 {
    border-color: #94a3b8;
}

.leaderboard-item.rank-3 {
    border-color: #f97316;
}

.rank-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.rank-badge.silver {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    color: #475569;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #fb923c, #ea580c);
    color: white;
}

.rank-badge.default {
    background: #f1f5f9;
    color: var(--text-secondary);
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 700;
}

.leaderboard-stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.leaderboard-score {
    text-align: right;
}

.leaderboard-points {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
}

/* Results */
.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.result-label {
    color: var(--text-secondary);
}

.result-value {
    font-weight: 600;
}

.diff-positive {
    color: var(--success);
    font-weight: 700;
}

.diff-negative {
    color: var(--danger);
    font-weight: 700;
}

.diff-exact {
    background: #d1fae5;
    color: var(--success);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-weight: 700;
}

/* Footer */
.footer {
    background: #0f172a;
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
}

/* ========== RESPONSIVE ========== */

/* Tablet & below */
@media (max-width: 768px) {
    /* Navbar: hide text, show only SVG icons */
    .navbar-links {
        gap: 0.25rem;
    }
    .navbar-links span {
        display: none;
    }
    .nav-link {
        padding: 0.5rem 0.65rem;
    }
    .navbar-brand {
        font-size: 0.95rem;
    }

    /* Hero */
    .hero {
        min-height: 35vh;
        padding: 1.5rem 1rem;
    }
    .hero h1 {
        font-size: 1.6rem;
    }
    .hero p {
        font-size: 0.95rem;
    }

    /* Stats: 2x2 grid on mobile */
    .stats-bar {
        padding: 1rem;
    }
    .stats-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }
    .stat-value {
        font-size: 1.4rem;
    }

    /* Container */
    .container {
        padding: 1rem 0.75rem;
    }

    /* Section titles */
    .section-title {
        font-size: 1.2rem;
    }

    /* Match cards grid */
    .matches-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Match card */
    .match-card {
        padding: 1.15rem;
        border-radius: 16px;
    }
    .match-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .match-date {
        font-size: 0.78rem;
    }
    .team-logo {
        width: 48px;
        height: 48px;
    }
    .team-short {
        font-size: 0.85rem;
    }
    .team-name {
        font-size: 0.7rem;
    }
    .vs-badge {
        font-size: 0.8rem;
        padding: 0.35rem 0.7rem;
    }
    .match-venue {
        font-size: 0.78rem;
    }

    /* Forms */
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    .form-grid-2 {
        grid-template-columns: 1fr !important;
    }
    .form-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .form-section {
        padding: 1rem;
        border-radius: 12px;
    }

    /* Cards */
    .card {
        padding: 1.15rem;
        border-radius: 16px;
    }

    /* Modal */
    .modal-overlay {
        padding: 0.5rem;
    }
    .modal {
        margin: 0;
        max-height: 95vh;
        padding: 1.15rem;
        border-radius: 16px;
    }
    .modal-title {
        font-size: 1.1rem;
    }

    /* Tables: horizontal scroll wrapper */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.5rem;
        padding: 0 0.5rem;
    }
    .table {
        font-size: 0.8rem;
        min-width: 500px;
    }
    .table th, .table td {
        padding: 0.5rem 0.4rem;
        white-space: nowrap;
    }

    /* Admin tabs */
    .admin-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
        flex-wrap: nowrap;
    }
    .admin-tab {
        white-space: nowrap;
        font-size: 0.85rem;
    }

    /* Leaderboard */
    .leaderboard-item {
        gap: 0.65rem;
        padding: 0.85rem;
    }
    .leaderboard-name {
        font-size: 0.9rem;
    }
    .leaderboard-stats {
        font-size: 0.75rem;
    }
    .leaderboard-points {
        font-size: 1.2rem;
    }

    /* Results */
    .result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    /* Buttons */
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    .btn-sm {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    /* Footer */
    .footer {
        padding: 1.5rem 1rem;
        margin-top: 2rem;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .hero {
        min-height: 30vh;
        padding: 1rem 0.75rem;
    }
    .hero h1 {
        font-size: 1.35rem;
    }
    .hero p {
        font-size: 0.88rem;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .form-grid-4 {
        grid-template-columns: 1fr !important;
    }

    .team-logo {
        width: 42px;
        height: 42px;
    }
    .vs-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    .team-name {
        display: none;
    }
    .match-card {
        padding: 1rem;
    }

    .navbar-brand svg {
        width: 20px;
        height: 20px;
    }
    .navbar-brand {
        font-size: 0.88rem;
        gap: 0.35rem;
    }

    .rank-badge {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
}

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: 24px;
    padding: 1.5rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* Admin */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.admin-tab {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 500;
    cursor: pointer;
    background: white;
    border: none;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.admin-tab.active {
    background: var(--primary);
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

