/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.header {
    background-color: #0f172a;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.header-container {
    margin: 0 auto;
    max-width: 1200px;
    padding: 0 1.5rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    min-height: 80vh;
}

.section-title {
    margin-bottom: 2rem;
}

.section-title h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #64748b;
    font-size: 1rem;
}

.footer {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
    font-size: 0.875rem;
    border-top: 1px solid #e2e8f0;
}

/* Common Utilites */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color 0.15s;
}

.back-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.detail-card-wrapper {
    background-color: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    border: 1px solid #e2e8f0;
}

/* Race List UI */
.race-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.race-card-link {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
    display: block;
    text-decoration: none;
}

.race-card-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    border-color: #cbd5e1;
}

.race-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.race-card-meta {
    color: #64748b;
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}


/* Detail UI */
.race-header {
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.race-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.race-meta {
    display: flex;
    gap: 1.5rem;
    color: #475569;
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.entries-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.entries-table th,
.entries-table td {
    padding: 1rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.entries-table th {
    background-color: #f8fafc;
    font-weight: 600;
    font-size: 0.875rem;
    color: #64748b;
    text-transform: uppercase;
}

.entries-table tr:hover {
    background-color: #f1f5f9;
}

.horse-number {
    font-weight: 700;
    color: #0f172a;
    width: 50px;
    text-align: center;
}

.horse-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 1.05rem;
}

.horse-odds {
    text-align: right;
    color: #64748b;
}

/* AI Predictions */
.predictions-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 3rem 0 1.5rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.ai-card {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.ai-header {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.ai-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
}

.ai-badge {
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-chatgpt {
    background-color: #ecfdf5;
    color: #059669;
}

.badge-gemini {
    background-color: #eff6ff;
    color: #2563eb;
}

.badge-grok {
    background-color: #fdf2f8;
    color: #db2777;
}

.prediction-marks {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mark-row {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.mark-symbol {
    font-size: 1.25rem;
    font-weight: 700;
    width: 30px;
}

.mark-fav {
    color: #ef4444;
}

/* ◎ */
.mark-opp {
    color: #3b82f6;
}

/* 〇 */
.mark-hole {
    color: #f59e0b;
}

/* ▲ */
.mark-horse {
    font-weight: 600;
    color: #0f172a;
    flex: 1;
}

.mark-label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: 0.5rem;
    font-weight: 500;
}

.ai-comment {
    padding-top: 1rem;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
    border-top: 1px dashed #cbd5e1;
}

@media (max-width: 768px) {
    .detail-card-wrapper {
        padding: 1.25rem;
    }

    .entries-table th,
    .entries-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .race-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* [V60] Time Navigation Pills */
.time-nav {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.time-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #f1f5f9;
    color: #475569;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.time-pill:hover {
    background-color: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
}

.time-pill.active {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}