:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(20, 27, 45, 0.75);
    --card-hover: rgba(28, 38, 62, 0.9);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.35);
    --live-color: #ef4444;
    --success: #10b981;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(30, 58, 138, 0.15) 0, transparent 50%), 
        radial-gradient(at 100% 100%, rgba(219, 39, 119, 0.1) 0, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
}

/* Glass Panels */
.glass-container {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
}

/* Login */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

/* Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 290px;
    background: rgba(15, 23, 42, 0.85);
    border-right: 1px solid var(--panel-border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #38bdf8;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 28px;
}

.logo svg {
    width: 28px;
    height: 28px;
}

.filter-section label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.glass-input, .glass-select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.glass-input:focus, .glass-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.glass-select option {
    background: #0f172a;
    color: #fff;
}

/* Buttons */
.btn-primary {
    padding: 12px 18px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: all 0.2s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-logout {
    padding: 10px 16px;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

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

.top-bar {
    margin-bottom: 24px;
}

.top-bar h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

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

/* Match Card */
.match-card {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--panel-border);
}

.match-card:hover {
    transform: translateY(-3px);
    background: var(--card-hover);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.league-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.flag-icon {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    object-fit: contain !important;
    border-radius: 3px;
}

.match-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.team img {
    width: 44px !important;
    height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    object-fit: contain !important;
}

.team span {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
}

.match-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 75px;
}

.time-badge {
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
}

.btn-analyze {
    width: 100%;
    padding: 10px;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-analyze:hover {
    background: #2563eb;
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px var(--accent-glow);
}

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

.modal-content {
    width: 100%;
    max-width: 780px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #fff;
}

.analysis-text {
    margin-top: 20px;
    line-height: 1.7;
    color: #e2e8f0;
    font-size: 0.95rem;
}

.analysis-text h1, .analysis-text h2, .analysis-text h3 {
    margin: 16px 0 8px;
    color: #38bdf8;
}

.analysis-text ul, .analysis-text ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.analysis-text strong {
    color: #fff;
}

/* Loader */
.loader {
    text-align: center;
    padding: 40px 0;
}

.spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

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

@media (max-width: 900px) {
    .dashboard-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .main-content {
        padding: 20px;
    }
}
