/* =========================================
   1. TRAINER INFO HEADER (NEW)
   ========================================= */
.trainer-info-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    margin-top: 3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--color-primary);
}

.info-section {
    flex: 1;
    min-width: 280px;
}

.info-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--color-primary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-content p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: #333;
}

.info-content .highlight {
    color: #d9534f;
    font-weight: 700;
}

.info-content small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
}

/* =========================================
   2. STANDARD TITLE BAR
   ========================================= */
.race-title-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 50;
    margin-bottom: 2rem;
    background: transparent;
    padding: 0;
}

.race-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-white);
    margin-right: 2rem;
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: -0.5px;
}

.month-nav-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    padding: 0.25rem 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

#current-month-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-dark);
    text-transform: uppercase;
    min-width: 160px;
    text-align: center;
    letter-spacing: 0.5px;
}

.cal-nav-btn {
    background: var(--color-primary);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.cal-nav-btn:hover {
    background-color: var(--color-secondary);
    color: var(--color-primary);
    transform: scale(1.05);
}

.race-controls-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.btn-quick-link {
    background-color: #fff;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: 0 1.25rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 40px;
    transition: all 0.2s ease;
}

.btn-quick-link:hover {
    background-color: #f0f8ff;
}

.btn-quick-link.active {
    background-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(26, 71, 42, 0.2);
}

.btn-view-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 32px;
    padding: 0 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-view-card:hover {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
    color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* =========================================
   3. TABLE STYLES (List View)
   ========================================= */
.race-results-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.race-results-table th {
    background-color: var(--color-primary);
    color: #fff;
    padding: 1rem;
    text-align: left;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.race-results-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #eee;
    color: #333;
    font-size: 0.95rem;
    vertical-align: middle;
}

.section-empty {
    padding: 4rem 1rem;
    text-align: center;
    color: #999;
    font-style: italic;
    background: #fff;
    border: 1px dashed #ddd;
    border-radius: 8px;
    margin-top: 1rem;
}

.hide {
    display: none !important;
}

/* =========================================
   4. FULL CALENDAR GRID (Planner Style)
   ========================================= */
.full-calendar-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    max-width: 100%;
    margin: 0 auto;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-table th {
    background-color: #f8f9fa;
    color: var(--color-primary);
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #eee;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.calendar-table td {
    /* Auto height so the pills can stack */
    height: auto;
    min-height: 140px;
    vertical-align: top;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 8px;
    background-color: #fff;
    transition: background 0.2s;
    position: relative;
}

.calendar-table td:hover {
    background-color: #fafafa;
}

/* Day Number */
.cal-date-num {
    display: block;
    font-weight: 800;
    color: #888;
    margin-bottom: 6px;
    font-size: 1.2rem;
    text-align: right;
}

.cal-date-num.has-event {
    color: var(--color-primary);
}

/* Today */
.calendar-today {
    background-color: #fffdf0 !important;
}

.calendar-today .cal-date-num {
    color: var(--color-secondary);
}

/* --- RACE ITEMS INSIDE CALENDAR --- */
.cal-day-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.cal-race-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* RESTORED: Background color pill style */
.cal-race-item {
    font-size: 0.75rem;
    background-color: var(--color-secondary);
    color: var(--color-primary);
    padding: 6px 8px;
    border-radius: 4px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s ease;
}

.cal-race-item:hover {
    background-color: var(--color-secondary);
    /* Gold/Yellow on hover */
    color: var(--color-primary);
    transform: translateY(-1px);
    z-index: 2;
}

.cal-race-empty {
    font-size: 0.8rem;
    font-style: italic;
    color: #999;
    text-align: center;
    margin-top: 1rem;
}

/* List View Badge */
.venue-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    background-color: #6c757d;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.venue-badge.venue-pjc {
    background-color: var(--color-primary);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .trainer-info-header {
        flex-direction: column;
        gap: 1rem;
    }

    .race-title-bar {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .calendar-table th {
        font-size: 0.7rem;
        padding: 5px;
    }

    .cal-race-item {
        font-size: 0.65rem;
        padding: 2px 3px;
    }

    .calendar-table td {
        min-height: 80px;
    }
}

/* =========================================
   5. LIGHTBOX MODAL
   ========================================= */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@media only screen and (max-width: 700px) {
    .lightbox-content {
        width: 100%;
    }
}

/* =========================================
   6. DECLARATIONS & ANNOUNCEMENTS
   ========================================= */

/* Header Adjustments */
.trainer-info-header {
    display: block;
    /* Overrides flex */
}

.info-section {
    width: 100%;
}

.info-title {
    align-items: baseline;
}

.info-title-text {
    font-size: 1.5rem;
    color: #d9534f;
}

.info-title-icon {
    margin-right: 10px;
}

.prize-money-alert {
    margin-left: auto;
    font-size: 0.9rem;
    color: #d9534f;
    text-transform: none;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Announcement Tabs */
.announcement-tabs {
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.announcement-tab-btn {
    background: none;
    border: none;
    color: #aaa;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
}

.announcement-tab-btn.active {
    color: #333 !important;
    /* Force override inline JS if needed, though JS sets style directly */
    border-bottom: 2px solid #e74c3c !important;
}

/* Announcement Content */
.announcement-content {
    margin-bottom: 15px;
}

.announcement-images {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    justify-content: center;
}

.announcement-img {
    max-height: 400px;
    width: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: zoom-in;
    transition: transform 0.2s;
}