/* css/style.css */
:root {
    --bg-main: #0f172a; /* Slate 900 */
    --bg-secondary: #1e293b; /* Slate 800 */
    --accent: #38bdf8; /* Light Blue */
    --accent-glow: rgba(56, 189, 248, 0.4);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981; /* Emerald */
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.05), transparent 25%);
}

h1, h2, h3, .logo {
    font-family: 'Outfit', sans-serif;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* Sidebar */
.sidebar {
    width: 260px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    border-radius: 0;
    border-right: 1px solid var(--glass-border);
}

.logo h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo span {
    color: var(--accent);
}

.main-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.main-nav a:hover, .main-nav a.active {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}

.main-nav a.active {
    border-left: 3px solid var(--accent);
    background: linear-gradient(90deg, rgba(56,189,248,0.1) 0%, transparent 100%);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px 48px;
    overflow-y: auto;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.top-header h1 {
    font-size: 28px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.status-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
}

/* Stats */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.stat-card {
    padding: 24px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 12px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.currency {
    font-size: 16px;
    color: var(--text-muted);
}

.stat-card.highlight {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}

.api-ok { color: var(--success); }

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.btn-primary {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover {
    background: #0ea5e9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 16px;
}

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

.hidden { display: none !important; }

/* Matches Grid */
.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.match-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s ease;
}

.match-card:hover {
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.league-badge {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    font-weight: 600;
}

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

.team {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team.away { text-align: right; }

.team .name {
    font-size: 18px;
    font-weight: 700;
}

.team .xG {
    font-size: 12px;
    color: var(--text-muted);
}

.xg-val {
    color: var(--text-main);
    font-weight: 600;
}

.vs {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 800;
}

/* Odds Analysis Section */
.odds-analysis {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.odd-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.odd-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.odd-type {
    font-weight: 600;
    width: 30px;
}

.odd-details {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.highlight-value {
    color: var(--text-main);
    font-weight: 600;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge.value {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

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

.kelly-stake {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kelly-amount {
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    width: 90%;
    max-width: 600px;
    padding: 32px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 24px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: white;
}

.modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.modal-league {
    font-size: 14px;
    color: var(--accent);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
}

.modal-teams {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    font-size: 24px;
}

.modal-teams span {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 800;
}

.modal-body h3 {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.match-card {
    cursor: pointer;
}

.dimmed { opacity: 0.35; transition: opacity 0.3s; }
.dimmed:hover { opacity: 0.8; }
