:root {
    --bg-dark: #0f0c29;
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --epl-purple: #3d195b;
    --epl-neon: #00ff85;
    --epl-pink: #ff005a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-dim: #a0a0c0;
    --gold: #f6b93b;
}

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

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

h1, h2, .team-name {
    font-family: 'Outfit', sans-serif;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-area h1 {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -1px;
}

.logo-area h1 span {
    color: var(--epl-neon);
}

.api-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    padding: 8px 15px;
    background: rgba(0,0,0,0.3);
    border-radius: 50px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4757;
    box-shadow: 0 0 10px #ff4757;
}

.api-status.connected .status-dot {
    background: var(--epl-neon);
    box-shadow: 0 0 10px var(--epl-neon);
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 20px;
    height: calc(100vh - 150px);
}

.panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.panel:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.panel-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.panel-header i {
    color: var(--epl-neon);
}

/* Tables */
.table-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th {
    text-align: left;
    padding: 12px 10px;
    color: var(--text-dim);
    font-weight: 400;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
}

tr.ucl-spot { background: rgba(74, 105, 189, 0.05); }
tr.relegation-spot { background: rgba(235, 77, 75, 0.05); }

tr:hover td {
    background: rgba(255,255,255,0.02);
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

/* Fixtures List */
.fixtures-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Date separator headers in fixture list */
.date-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--epl-neon);
}

.date-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.fixture-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 15px;
    border: 1px solid var(--glass-border);
}

.fixture-info {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 10px;
    text-align: center;
}

.match-setup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.team-predict {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.prediction-buttons {
    display: flex;
    background: rgba(0,0,0,0.4);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}

.btn-predict {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

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

.btn-predict.active {
    background: var(--epl-purple);
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.btn-predict[data-res="DRAW"].active {
    background: #636e72;
}

/* Prediction Results */
.prediction-panel {
    border: 2px solid rgba(0, 255, 133, 0.1);
}

.actions {
    padding: 20px;
    display: flex;
    gap: 10px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--epl-neon);
    color: #000;
}

.btn-primary:hover {
    background: #00d971;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 133, 0.3);
}

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

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--epl-purple);
    padding: 40px;
    border-radius: 30px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    border: 1px solid var(--glass-border);
}

.modal-content h2 {
    margin-bottom: 15px;
}

.modal-content p {
    color: var(--text-dim);
    margin-bottom: 25px;
    line-height: 1.5;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#apiTokenInput {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 12px;
    color: white;
    font-family: inherit;
    text-align: center;
}

.hint {
    margin-top: 20px;
    font-size: 0.8rem;
}

.hint a {
    color: var(--epl-neon);
    text-decoration: none;
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
}

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

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

@media (max-width: 1100px) {
    .dashboard {
        grid-template-columns: 1fr;
        height: auto;
    }
    .app-container {
        padding: 10px;
    }
}

/* Specific Table Zones */
.ucl-spot td:first-child {
    border-left: 4px solid #4a69bd !important;
}
.relegation-spot td:first-child {
    border-left: 4px solid #eb4d4b !important;
}

tr {
    transition: all 0.2s ease;
}

#predictionBody tr {
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}
