:root {
    --bg-dark: #09090b;
    --card-bg: rgba(24, 24, 27, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-primary: #10b981;
    /* Emerald */
    --accent-secondary: #8b5cf6;
    /* Violet */
    --text-main: #f4f4f5;
    --text-dim: #a1a1aa;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.4);
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
    z-index: -1;
}

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

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.3));
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.league-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' 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 1rem center;
}

.league-select:hover,
.league-select:focus {
    border-color: var(--accent-primary);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.league-select option {
    background: #18181b;
    color: var(--text-main);
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-primary), #059669);
    border: none;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transition: var(--transition);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* Glass Card Styles */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
}

.card {
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
}

#leagueTableCard {
    animation: fadeIn 0.8s ease-out;
}

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

h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Table Styles */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--text-dim);
    font-weight: 400;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
}

tr td:first-child {
    border-radius: 12px 0 0 12px;
}

tr td:last-child {
    border-radius: 0 12px 12px 0;
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.team-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.tiny-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
}

tbody tr {
    transition: var(--transition);
    cursor: pointer;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.01);
}

.pts {
    font-weight: 800;
    color: var(--accent-primary);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 320px 320px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.top-scorer-section {
    position: sticky;
    top: 2rem;
    animation: fadeIn 1s ease-out;
}

.scorer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.scorer-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.scorer-rank {
    font-weight: 800;
    color: var(--text-dim);
    width: 30px;
    font-size: 1.1rem;
}

.scorer-info {
    flex: 1;
}

.scorer-name {
    font-weight: 600;
    display: block;
}

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

.scorer-goals {
    font-weight: 800;
    color: var(--accent-primary);
    font-size: 1.2rem;
    min-width: 40px;
    text-align: right;
}

/* Surprise List */
.surprise-list {
    display: flex;
    flex-direction: column;
}

.surprise-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.surprise-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

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

.surprise-teams {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.surprise-score {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent-primary);
}

.surprise-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.surprise-actual {
    color: var(--text-dim);
}

.shock-badge {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Fixture Window */
.hidden {
    display: none !important;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 950;
    transition: var(--transition);
    animation: fadeIn 0.3s ease-out;
}

.fixture-section {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    z-index: 1000;
    overflow-y: auto;
    animation: modalFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fixture-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 16px;
    margin-bottom: 1rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.fixture-item.clickable {
    cursor: pointer;
}

.fixture-item.clickable:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(16, 185, 129, 0.3);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
}

.fixture-item.clickable::after {
    content: '➔';
    position: absolute;
    right: 1.5rem;
    opacity: 0;
    color: var(--accent-primary);
    transition: var(--transition);
    transform: translateX(-10px);
}

.fixture-item.clickable:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.fixture-score {
    font-weight: 800;
    font-size: 1.3rem;
    padding: 0.4rem 1rem;
    border-radius: 10px;
    min-width: 80px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    /* Default */
    color: var(--text-dim);
}

.fixture-score.win-score {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-primary);
}

.fixture-score.loss-score {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.fixture-score.draw-score {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.fix-info {
    flex: 1;
}

.opp-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 4px;
}

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

.actual-score {
    font-size: 0.85rem;
    color: var(--text-dim);
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.match-detail-section {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 800px;
    max-height: 90vh;
    z-index: 1100;
    overflow-y: auto;
    animation: modalFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.2rem;
    line-height: 1;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    transform: rotate(90deg);
}

.match-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.2rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.match-score-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    margin-bottom: 2rem;
}

.md-team {
    font-size: 1.2rem;
    font-weight: 600;
    width: 200px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.banner-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.md-score {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-primary);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.shot-list-container h3 {
    margin-bottom: 1rem;
    color: var(--text-dim);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.shot-item {
    display: grid;
    grid-template-columns: 60px 1fr 120px 80px;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.shot-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.shot-min {
    font-weight: 600;
    color: var(--text-dim);
}

.shot-player {
    font-weight: 500;
}

.shot-prob {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-align: right;
}

.shot-result {
    text-align: right;
    font-weight: 700;
    font-size: 0.9rem;
}

.result-goal {
    color: var(--accent-primary);
}

.result-miss {
    color: var(--text-dim);
    opacity: 0.6;
}

.result-ignored {
    color: var(--text-dim);
    opacity: 0.4;
    font-style: italic;
}

.retry-shot-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition);
    vertical-align: middle;
}

.retry-shot-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

.actual-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--accent-secondary);
    color: white;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}