:root {
    --primary-color: #00ff88;
    --secondary-color: #00ccff;
    --bg-dark: #0a0a12;
    --bg-card: #151520;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent: #ff0055;
    --gradient-main: linear-gradient(135deg, #00ff88 0%, #00ccff 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header & Navigation */
.main-header {
    background: rgba(21, 21, 32, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.5rem 2rem;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
}

.header-controls {
    display: flex;
    align-items: center;
    flex-grow: 1;
    gap: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    /* Hide scrollbar */
}

.date-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    white-space: nowrap;
}

.nav-btn {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: bold;
    padding: 0 8px;
    font-size: 1.2rem;
}

.nav-btn:hover {
    color: var(--primary-color);
}

.current-date {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.hipodrom-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-filter-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.header-filter-btn:hover,
.header-filter-btn.active {
    background: var(--gradient-main);
    color: var(--bg-dark);
    border-color: transparent;
    font-weight: 600;
}

@media (max-width: 900px) {
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .header-controls {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Adsense Placeholders */
.ad-space {
    width: 100%;
    min-height: 100px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Filter/Selectors */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--gradient-main);
    color: var(--bg-dark);
    font-weight: 600;
    border-color: transparent;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

/* Bulletin Table/Cards */
.race-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.race-header {
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.1) 0%, rgba(21, 21, 32, 0) 100%);
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.race-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.race-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Responsive Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.horse-name {
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-ganyan {
    background: rgba(255, 0, 85, 0.2);
    color: var(--accent);
    border: 1px solid rgba(255, 0, 85, 0.3);
}

/* Score/Result Highlighting */
.result-cell {
    font-weight: bold;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .logo {
        font-size: 1.4rem;
    }

    .race-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Card view for mobile perhaps? For now table scroll is safer */
}

.small-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
    margin-left: 0.5rem;
}

.sort-buttons {
    display: flex;
    align-items: center;
}

@media (max-width: 600px) {
    .race-leg-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .sort-buttons {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
    }
}