/* Inherits primary table styles from race-card.css */

/* =========================================
   1. MAIN LAYOUT & HEADER
   ========================================= */
.container {
    /* Ensure sufficient spacing for the new layout */
    margin-top: 2rem;
    margin-bottom: 4rem;
}

.stewards-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.stewards-header h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--color-primary);
    margin: 0;
    font-size: 2rem;
}

.stewards-header p {
    color: #666;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* GRID SYSTEM */
.stewards-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    /* Sidebar fixed width, Content fluid */
    gap: 2rem;
    align-items: start;
    min-height: 60vh;
}

/* =========================================
   2. SIDEBAR & FILTERS
   ========================================= */
.stewards-sidebar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: sticky;
    top: 20px;
    /* Sticks while scrolling */
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
}

.sidebar-header {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.header-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* FILTER DROPDOWNS ROW */
.filter-row {
    display: flex;
    gap: 0.5rem;
}

.filter-select {
    flex: 1;
    /* Both dropdowns take equal width */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
    /* Subtle focus ring */
}

/* EVENTS LIST AREA */
.events-list-wrapper {
    flex: 1;
    overflow-y: auto;
    background-color: #fff;
}

.sidebar-loading {
    padding: 2rem 1rem;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

.event-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.event-item:hover {
    background-color: #fafafa;
}

/* Active Selected State */
.event-item.active {
    background-color: #fffdf5;
    /* Very light accent background */
    border-left-color: var(--color-secondary);
}

.event-item.active .date {
    color: var(--color-secondary-dark);
}

.event-item .date {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
    color: #444;
    margin-bottom: 4px;
}

.event-item .sub-text {
    font-size: 0.85rem;
    color: #999;
}

/* =========================================
   3. CONTENT AREA & STATES
   ========================================= */
.stewards-content {
    min-width: 0;
    /* Prevents flex/grid blowouts */
}

.state-container {
    text-align: center;
    padding: 4rem 1rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
    color: #666;
}

.hide {
    display: none !important;
}

/* HEADER CARD (Date & PDF Button) */
.report-meta-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #eee;
    border-left: 5px solid var(--color-primary);
}

.meta-info h2 {
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    font-size: 1.5rem;
    color: #333;
    font-family: 'Montserrat', sans-serif;
}

.venue-badge {
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* MODERN PDF BUTTON */
.pdf-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border: 1px solid var(--color-secondary);
    padding: 8px 16px 8px 8px;
    border-radius: 50px;
    /* Pill shape */
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.pdf-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
    background-color: #fffdf7;
}

.pdf-icon {
    width: 36px;
    height: 36px;
    background: var(--color-secondary);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-label {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    margin-right: 10px;
}

.pdf-label span {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-primary);
}

.pdf-label small {
    font-size: 0.75rem;
    color: #888;
}

.arrow {
    color: var(--color-secondary);
}

/* =========================================
   4. REPORT SECTIONS & TABLES
   ========================================= */
.report-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid #eee;
}

.card-header-strip {
    padding: 12px 20px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

/* Section-Specific Header Colors */
.vet-strip {
    background-color: #4A90E2;
}

/* Blue */
.fines-strip {
    background-color: #D9534F;
}

/* Red */
.susp-strip {
    background-color: #F0AD4E;
}

/* Orange */
.general-strip {
    background-color: #5BC0DE;
}

/* Light Blue */

/* MODERN TABLE STYLES */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    /* Helps with responsiveness */
}

.modern-table th {
    background: #f9f9f9;
    color: #666;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    border-bottom: 2px solid #eee;
}

.modern-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    color: #333;
    font-size: 0.9rem;
    vertical-align: top;
    word-wrap: break-word;
    /* Prevents long text from breaking layout */
}

.modern-table tr:last-child td {
    border-bottom: none;
}

/* Empty State Box inside content */
.info-box {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    color: #888;
    font-style: italic;
    border: 1px dashed #ddd;
}

/* =========================================
   5. PDF MODAL
   ========================================= */
.pdf-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.pdf-modal.show {
    display: block;
}

.pdf-modal-content {
    position: relative;
    margin: 2% auto;
    width: 90%;
    max-width: 1000px;
    height: 90%;
    background-color: #222;
    border: 1px solid var(--color-secondary);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.pdf-header {
    padding: 0.75rem 1.25rem;
    background-color: var(--color-primary);
    color: var(--color-secondary);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    border-bottom: 2px solid var(--color-secondary);
}

.pdf-header h3 {
    margin: 0;
    font-size: 1.1rem;
    flex-grow: 1;
}

.pdf-external-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.pdf-external-link:hover {
    color: var(--color-secondary);
    opacity: 0.9;
}

.pdf-body {
    flex-grow: 1;
    background-color: #525659;
    position: relative;
    /* Added to help with iOS scrolling if it ever succeeds in-app */
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.pdf-close {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.pdf-close:hover {
    color: var(--color-secondary);
}

iframe {
    border: none;
}

/* =========================================
   6. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    .stewards-layout {
        grid-template-columns: 1fr;
        /* Stack sidebar on top of content */
        gap: 1.5rem;
    }

    .stewards-sidebar {
        position: relative;
        top: 0;
        max-height: 350px;
        /* Limit height so users can scroll past it to content */
    }

    .report-meta-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .pdf-action-btn {
        width: 100%;
        justify-content: space-between;
    }

    .modern-table th,
    .modern-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    /* Make tables horizontal scroll on very small screens */
    .table-responsive {
        overflow-x: auto;
    }
}