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

:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(17, 24, 39, 0.65);
    --bg-card-hover: rgba(31, 41, 55, 0.85);
    --bg-input: rgba(17, 24, 39, 0.9);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-glow: rgba(99, 102, 241, 0.3);
    
    --color-primary: #6366f1; /* Indigo */
    --color-primary-light: rgba(99, 102, 241, 0.15);
    --color-accent: #a855f7; /* Purple */
    --color-success: #10b981; /* Emerald */
    --color-success-light: rgba(16, 185, 129, 0.12);
    --color-warning: #f59e0b; /* Amber */
    --color-warning-light: rgba(245, 158, 11, 0.12);
    --color-danger: #f43f5e; /* Rose */
    --color-danger-light: rgba(244, 63, 94, 0.12);
    
    --color-text-main: #f8fafc;
    --color-text-muted: #94a3b8;
    --color-text-dim: #64748b;
    
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px 2px rgba(99, 102, 241, 0.15);
    
    --font-family: 'Outfit', sans-serif;
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
}

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

body {
    background-color: var(--bg-main);
    color: var(--color-text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    margin-bottom: 2.5rem;
    text-align: center;
    position: relative;
}

h1 {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    background: linear-gradient(to right, #ffffff, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    display: inline-block;
}

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

/* Glassmorphism Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-main);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    border-color: var(--border-color-glow);
    box-shadow: var(--shadow-main), var(--shadow-glow);
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.5rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text-muted);
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--color-text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

/* Leaderboard */
.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    margin-top: 1rem;
}

.leaderboard-table th {
    color: var(--color-text-dim);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
}

.leaderboard-row {
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(1.01);
}

.leaderboard-row td {
    padding: 1.125rem 1rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-row td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: var(--border-radius-sm);
    border-bottom-left-radius: var(--border-radius-sm);
    width: 70px;
    text-align: center;
}

.leaderboard-row td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: var(--border-radius-sm);
    border-bottom-right-radius: var(--border-radius-sm);
    text-align: right;
    font-weight: 700;
}

/* Rank Badges */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
}

.rank-badge.rank-1 {
    background: #f59e0b;
    color: #000;
    box-shadow: 0 0 12px #f59e0b;
}

.rank-badge.rank-2 {
    background: #cbd5e1;
    color: #000;
    box-shadow: 0 0 12px #cbd5e1;
}

.rank-badge.rank-3 {
    background: #b45309;
    color: #fff;
    box-shadow: 0 0 12px #b45309;
}

.rank-badge.rank-other {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-muted);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
}

.player-name {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Grid layout for fixtures */
.fixtures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.25rem;
}

.fixture-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1.25rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.fixture-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.fixture-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text-dim);
    font-size: 0.775rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 0.5rem;
}

.fixture-round {
    color: var(--color-primary);
    background: var(--color-primary-light);
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

.fixture-teams {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

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

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

.team-score {
    font-size: 1.25rem;
    font-weight: 700;
    width: 30px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.fixture-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.825rem;
}

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

.fixture-winner-indicator span {
    color: var(--color-success);
    font-weight: 600;
}

/* Accuracy color codes */
.points-tag {
    font-size: 0.775rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.points-tag.correct {
    background-color: var(--color-success-light);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.points-tag.sign-correct {
    background-color: var(--color-warning-light);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.points-tag.incorrect {
    background-color: var(--color-danger-light);
    color: var(--color-danger);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.points-tag.pending {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-text-dim);
}

/* Modals / Detail Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-content {
    background: #0f172a;
    border: 1px solid var(--border-color-glow);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), var(--shadow-glow);
    position: relative;
    animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Admin Styles */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 900px) {
    .admin-grid {
        grid-template-columns: 280px 1fr;
    }
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-menu-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    text-align: left;
    font-family: var(--font-family);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-menu-btn:hover {
    color: var(--color-text-main);
    background: rgba(255, 255, 255, 0.03);
}

.admin-menu-btn.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

/* Forms & Inputs */
label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

input[type="text"], input[type="password"], select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    color: white;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: all 0.2s ease;
}

input[type="text"]:focus, input[type="password"]:focus, select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

/* Upload Area */
.upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.005);
}

.upload-dropzone:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.upload-icon {
    font-size: 3rem;
    color: var(--color-text-dim);
    margin-bottom: 1rem;
}

.btn {
    background: var(--color-primary);
    color: white;
    border: none;
    outline: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

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

.btn-danger:hover {
    background: #e11d48;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.4);
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-main);
    z-index: 2000;
    display: none;
    animation: toastSlideIn 0.3s ease;
    font-weight: 500;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: #065f46;
    color: #a7f3d0;
    border: 1px solid #047857;
}

.notification.error {
    background: #9f1239;
    color: #ffe4e6;
    border: 1px solid #be123c;
}

/* Player Detail Layout */
.player-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

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

.stat-box {
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.stat-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-lbl {
    font-size: 0.75rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
}

/* Match Admin Forms */
.match-admin-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.match-admin-row:last-child {
    border-bottom: none;
}

.match-admin-teams {
    flex: 1;
    font-weight: 500;
}

.match-admin-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.match-admin-score-input {
    width: 50px !important;
    text-align: center;
}

.match-admin-winner-select {
    width: 140px !important;
}

/* Accordions/Sections */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    padding-bottom: 0.5rem;
}
