/* ============================================================
   F1 ON THIS DAY – Frontend Styles
   ============================================================ */

/* ── Wrapper ── */
.f1-otd-wrapper {
    max-width: 1100px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a2e;
}

/* ── Header Band ── */
.f1-otd-header-band {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #e10600 0%, #a00500 100%);
    color: #fff;
    padding: 24px 30px;
    border-radius: 14px 14px 0 0;
}
.f1-otd-logo { font-size: 40px; }
.f1-otd-header-band h2 { margin: 0; font-size: 26px; }
.f1-otd-header-band p  { margin: 4px 0 0; opacity: .85; font-size: 14px; }

/* ── Calendar Container ── */
.f1-otd-calendar-container {
    background: #fff;
    padding: 24px;
    border: 1px solid #e8e8e8;
    border-top: none;
}

.f1-otd-cal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}
.f1-otd-cal-month-label {
    font-size: 20px;
    font-weight: 700;
    min-width: 200px;
    text-align: center;
    color: #1a1a2e;
}
.f1-otd-cal-btn {
    background: #e10600;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.f1-otd-cal-btn:hover { background: #a00500; }

.f1-otd-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.f1-otd-cal-day-name {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    padding: 6px 0;
}
.f1-otd-cal-blank { border-radius: 8px; }
.f1-otd-cal-day {
    text-align: center;
    padding: 10px 4px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid transparent;
    transition: all .15s;
    background: #f7f7f7;
}
.f1-otd-cal-day:hover {
    background: #ffe0de;
    border-color: #e10600;
    color: #e10600;
}
.f1-otd-cal-today {
    background: #e10600 !important;
    color: #fff !important;
    font-weight: 700;
}
.f1-otd-cal-selected {
    background: #1a1a2e !important;
    color: #fff !important;
    border-color: #1a1a2e !important;
}

/* ── Quick Date Picker ── */
.f1-otd-quick-date {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.f1-otd-quick-date label { font-weight: 600; font-size: 14px; }
.f1-otd-quick-date input[type="date"] {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}
.f1-otd-quick-date input[type="date"]:focus { border-color: #e10600; }

.f1-otd-btn-primary {
    background: #e10600;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.f1-otd-btn-primary:hover { background: #a00500; }

/* ── Loading ── */
.f1-otd-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px;
    color: #888;
}
.f1-otd-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #eee;
    border-top-color: #e10600;
    border-radius: 50%;
    animation: f1-spin .8s linear infinite;
    margin-bottom: 12px;
}
@keyframes f1-spin { to { transform: rotate(360deg); } }

/* ── Results Panel ── */
.f1-otd-results {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-top: none;
    border-radius: 0 0 14px 14px;
    overflow: hidden;
    transition: opacity .3s;
}

.f1-otd-date-header {
    padding: 24px 30px 16px;
    background: #fff;
    border-bottom: 2px solid #f0f0f0;
}
.f1-otd-today-badge {
    display: inline-block;
    background: #e10600;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 6px;
}
.f1-otd-date-header h2 {
    margin: 0;
    font-size: 24px;
    color: #1a1a2e;
}
.f1-otd-subtitle { margin: 4px 0 0; color: #888; font-size: 13px; }

.f1-otd-stats-bar {
    padding: 10px 30px;
    background: #f0f0f0;
}
.f1-otd-stat-pill {
    display: inline-block;
    background: #1a1a2e;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

/* ── Section ── */
.f1-otd-section { padding: 20px 30px; border-bottom: 1px solid #ebebeb; }
.f1-otd-section:last-child { border-bottom: none; }

.f1-otd-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid transparent;
}
.f1-otd-section-icon { font-size: 22px; }
.f1-otd-section-header h3 { margin: 0; font-size: 17px; flex: 1; }
.f1-otd-count-badge {
    background: #e10600;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Category colour-coding */
.f1-otd-cat-race_anniversary   { border-bottom-color: #e10600; }
.f1-otd-cat-birthday            { border-bottom-color: #f39c12; }
.f1-otd-cat-points_milestone    { border-bottom-color: #27ae60; }
.f1-otd-cat-pole_position       { border-bottom-color: #2ecc71; }
.f1-otd-cat-fastest_lap         { border-bottom-color: #9b59b6; }
.f1-otd-cat-race_milestone      { border-bottom-color: #3498db; }
.f1-otd-cat-pole_milestone      { border-bottom-color: #1abc9c; }
.f1-otd-cat-fastest_lap_milestone { border-bottom-color: #8e44ad; }

/* ── Cards ── */
.f1-otd-cards { display: flex; flex-direction: column; gap: 10px; }

.f1-otd-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #fff;
    border-radius: 10px;
    padding: 14px 18px;
    border-left: 4px solid #ddd;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow .2s;
}
.f1-otd-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.12); }

/* Card left-border colours by type */
.f1-otd-type-race         { border-left-color: #e10600; }
.f1-otd-type-birthday     { border-left-color: #f39c12; }
.f1-otd-type-milestone    { border-left-color: #27ae60; }
.f1-otd-type-pole         { border-left-color: #2ecc71; }
.f1-otd-type-fastestlap   { border-left-color: #9b59b6; }
.f1-otd-type-races        { border-left-color: #3498db; }
.f1-otd-type-pole_milestone { border-left-color: #1abc9c; }
.f1-otd-type-fl_milestone  { border-left-color: #8e44ad; }

.f1-otd-card-icon { font-size: 22px; line-height: 1; margin-top: 2px; }
.f1-otd-card-body { flex: 1; }
.f1-otd-card-headline { margin: 0 0 6px; font-size: 15px; line-height: 1.5; color: #1a1a2e; }
.f1-otd-card-sub { margin: 0; padding: 0 0 0 16px; color: #555; font-size: 13px; }
.f1-otd-card-sub li { margin-bottom: 3px; }

.f1-otd-card-meta {
    font-size: 11px;
    font-weight: 700;
    color: #aaa;
    white-space: nowrap;
    align-self: center;
    letter-spacing: .3px;
    text-transform: uppercase;
}

/* ── Year Badge ── */
.f1-otd-year-badge {
    display: inline-block;
    background: #1a1a2e;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    vertical-align: middle;
}

/* ── Driver link ── */
.f1-otd-driver-link {
    color: #e10600;
    text-decoration: none;
    font-weight: 600;
}
.f1-otd-driver-link:hover { text-decoration: underline; }
.f1-otd-driver-name { font-weight: 600; }

/* ── Empty State ── */
.f1-otd-empty {
    text-align: center;
    padding: 60px 30px;
    color: #999;
}
.f1-otd-empty-icon { font-size: 56px; margin-bottom: 12px; }
.f1-otd-empty p    { font-size: 16px; margin: 6px 0; }
.f1-otd-empty-sub  { font-size: 13px; }

/* ── Stand-alone results (no calendar) ── */
.f1-otd-results:not(#f1-otd-results-panel) {
    border-radius: 14px;
    border-top: 1px solid #e8e8e8;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .f1-otd-section         { padding: 16px; }
    .f1-otd-date-header     { padding: 16px; }
    .f1-otd-cal-day         { padding: 7px 2px; font-size: 12px; }
    .f1-otd-cal-month-label { font-size: 16px; }
    .f1-otd-card            { flex-wrap: wrap; }
    .f1-otd-card-meta       { width: 100%; text-align: right; }
}
