:root {
    --bg-body: #020617;
    --bg-card: #0f172a;
    --bg-nav: #1e293b;
    --border: #334155;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --accent-blue: #38bdf8;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #facc15;
    --font-main: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
}

.app-title {
    margin: 0;
    margin-bottom: 5px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -1px;
}

/* Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 25px;
    /* align-items: start; Removed so sidebar stretches for sticky to work */
}

@media (max-width: 900px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
    /* Grid Item: Shrink to content so it can stick within the tall track */
    z-index: 10;
}

.botd-card {
    background: #111827;
    border-radius: 12px;
    border: 2px solid var(--accent-red);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.15);
}

.botd-header {
    background: var(--accent-red);
    padding: 15px;
    text-align: center;
    font-weight: 900;
    color: white;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.botd-list {
    padding: 15px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.botd-footer {
    padding: 15px;
    background: #000;
    text-align: center;
    border-top: 1px solid var(--border);
}

/* Date Nav */
.date-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-body);
}

.date-nav::-webkit-scrollbar {
    height: 6px;
}

.date-nav::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.date-btn {
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
    background: var(--bg-nav);
    color: var(--text-muted);
    transition: all 0.2s;
}

.date-btn.active {
    background: var(--accent-blue);
    color: #0f172a;
    border-color: var(--accent-blue);
}

.date-btn:hover:not(.active) {
    background: #334155;
    color: white;
}

.spacer-20 {
    height: 20px;
}

/* Top Controls */
.top-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-accumulator {
    background: linear-gradient(45deg, #ef4444, #b91c1c);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 900;
    cursor: pointer;
    font-size: 14px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.1s;
}

.btn-accumulator:active {
    transform: scale(0.98);
}

.search-container {
    flex: 1;
    min-width: 250px;
}

#aiSearch {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: white;
    font-size: 14px;
    outline: none;
    font-family: var(--font-main);
}

#aiSearch:focus {
    border-color: var(--accent-blue);
}

/* Matches Card */
.matches-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-nav);
    border-radius: 8px;
    overflow: hidden;
}

.matches-header {
    display: flex;
    align-items: center;
    /* Ensure vertical center alignment */
    gap: 10px;
    /* Match the gap of .match-row */
    padding: 12px 15px;
    background: var(--bg-card);
    border-bottom: 2px solid var(--bg-nav);
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.matches-list {
    min-height: 200px;
}

.match-row {
    padding: 10px 15px;
    border-bottom: 1px solid var(--bg-nav);
    color: white;
    transition: background 0.1s;
}

.match-row:hover {
    background: rgba(30, 41, 59, 0.5);
}

.match-row:last-child {
    border-bottom: none;
}

.match-content {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

/* Columns */
.col-time {
    width: 45px;
    font-size: 10px;
    color: #64748b;
}

.col-match {
    width: 240px;
}

.col-tip {
    width: 40px;
    color: var(--accent-green);
    font-weight: 900;
}

.col-score {
    width: 60px;
}

.col-ou {
    width: 45px;
    color: var(--accent-yellow);
    font-size: 10px;
    font-weight: 800;
}

.col-btts {
    width: 45px;
    font-size: 10px;
    font-weight: 800;
}

.col-odds {
    width: 45px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: bold;
}

.col-prob {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.center {
    text-align: center;
}

.right {
    text-align: right;
}

/* Match Details */
.league-name {
    font-size: 9px;
    color: var(--accent-blue);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: -5px;
    /* Shift left */
}

.league-flag {
    width: 12px;
    height: auto;
    border-radius: 2px;
    object-fit: cover;
}

.team-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
}

.team-row+.team-row {
    margin-top: 2px;
}

.team-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.score-badge {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-blue);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 12px;
}

.text-green {
    color: var(--accent-green);
}

.text-red {
    color: var(--accent-red);
}

/* Prob Bar */
.prob-bar {
    display: flex;
    height: 18px;
    border-radius: 3px;
    overflow: hidden;
    font-size: 9px;
    border: 1px solid var(--bg-nav);
    width: 100%;
    max-width: 140px;
}

.prob-seg {
    display: flex;
    align-items: center;
    justify-content: center;
}

.seg-1 {
    background: var(--accent-green);
}

.seg-x {
    background: var(--accent-yellow);
    color: #0f172a;
}

.seg-2 {
    background: var(--accent-red);
}

/* BotD Items */
.acc-row {
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    font-size: 13px;
}

.acc-row:last-child {
    border-bottom: none;
}

.acc-match {
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 4px;
}

.acc-pick {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.acc-pick b {
    font-weight: 700;
    color: white;
}

.acc-odd {
    color: var(--accent-yellow);
    font-weight: bold;
}

.total-odds-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.total-odds-value {
    font-size: 32px;
    font-weight: 900;
    color: var(--accent-green);
    text-align: center;
}

.loading-state {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

/* Ad Spaces */
.ad-slot {
    background: #0f172a;
    border: 1px dashed #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 20px;
    border-radius: 8px;
}

.ad-header {
    width: 100%;
    height: 90px;
    /* Standard Leaderboard */
}

.ad-sidebar {
    width: 100%;
    height: 250px;
    /* Standard Rectangle */
    margin-top: 25px;
}

.ad-middle {
    width: 100%;
    min-height: 150px;
    /* Flexible height for responsive ads */
    margin-top: 30px;
    margin-bottom: 10px;
}

/* SEO Content */
.seo-content {
    margin-top: 40px;
    padding: 30px;
    background: #0f172a;
    border-radius: 12px;
    border: 1px solid var(--bg-nav);
    color: #cbd5e1;
}

.seo-content h2 {
    color: white;
    font-size: 18px;
    margin-top: 0;
}

.seo-content h3 {
    color: var(--accent-blue);
    font-size: 14px;
    margin-top: 20px;
}

.seo-content p {
    line-height: 1.6;
    font-size: 13px;
    margin-bottom: 15px;
}

.seo-content ul {
    padding-left: 20px;
}

.seo-content li {
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.5;
}