/* Athletics Records Frontend Styles */

.athletics-records-container {
    max-width: 100%;
    margin: 20px 0;
}

.athletics-records-filters {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.athletics-records-filters .filter-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.athletics-records-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.athletics-records-filters label {
    font-weight: 600;
    font-size: 14px;
    color: #495057;
}

.athletics-records-filters select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.15s ease-in-out;
}

.athletics-records-filters select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.clear-filters-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.15s ease-in-out;
}

.clear-filters-btn:hover {
    background: #5a6268;
}

.athletics-records-stats {
    margin: 15px 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.athletics-records-stats .records-count {
    margin: 0;
    font-weight: 600;
    font-size: 16px;
}

.athletics-records-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.athletics-records-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin: 0;
}

.athletics-records-table thead {
    background: #343a40;
    color: white;
}

.athletics-records-table thead th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.athletics-records-table tbody tr {
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.15s ease-in-out;
}

.athletics-records-table tbody tr:hover {
    background-color: #f8f9fa;
}

.athletics-records-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.athletics-records-table tbody tr:nth-child(even):hover {
    background-color: #f1f3f4;
}

.athletics-records-table tbody td {
    padding: 14px 12px;
    vertical-align: middle;
    font-size: 14px;
    border: none;
}

.record-type-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.record-type-track_field { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.record-type-triathlon { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.record-type-cross_country { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.record-type-sportshall { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.record-type-ultra { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.record-type-road_running { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.record-type-schools { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }

.age-group {
    font-weight: 600;
    color: #495057;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.event-name {
    color: #212529;
    font-weight: 600;
    font-size: 15px;
}

.athlete-name {
    color: #495057;
    font-weight: 500;
}

.record-value {
    font-weight: 700;
    color: #28a745;
    font-size: 16px;
}

.record-unit {
    font-size: 12px;
    color: #6c757d;
    margin-left: 3px;
    font-weight: 400;
}

.record-year {
    color: #6c757d;
    font-weight: 500;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.no-records-message {
    text-align: center !important;
    padding: 40px 20px !important;
    color: #6c757d !important;
    font-style: italic;
    font-size: 16px;
}

/* Summary and Latest Records Styles */
.athletics-records-summary {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 24px;
    margin: 20px 0;
}

.athletics-records-summary h3 {
    margin: 0 0 20px 0;
    color: #212529;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
}

.record-type-counts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.record-type-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.record-count {
    font-weight: 600;
    color: #495057;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.latest-records h4 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
}

.latest-records-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.latest-record-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #28a745;
    font-size: 14px;
    line-height: 1.5;
}

.athletics-records-latest {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 24px;
    margin: 20px 0;
}

.athletics-records-latest h3 {
    margin: 0 0 20px 0;
    color: #212529;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
}

.latest-records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.latest-record-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #0073aa;
    transition: transform 0.2s ease-in-out;
}

.latest-record-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.record-date {
    background: #6c757d;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.record-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .athletics-records-filters .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .athletics-records-filters .filter-group {
        min-width: auto;
        width: 100%;
    }
    
    .athletics-records-table-wrapper {
        font-size: 13px;
    }
    
    .athletics-records-table thead th,
    .athletics-records-table tbody td {
        padding: 10px 8px;
    }
    
    .record-type-counts {
        grid-template-columns: 1fr;
    }
    
    .latest-records-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .athletics-records-table {
        font-size: 12px;
    }
    
    .athletics-records-table thead th,
    .athletics-records-table tbody td {
        padding: 8px 6px;
    }
    
    .athletics-records-filters,
    .athletics-records-summary,
    .athletics-records-latest {
        padding: 16px;
        margin: 15px 0;
    }
    
    .record-type-badge {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* Loading state */
.athletics-records-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.athletics-records-loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Track & Field Widget Specific Styles */
.athletics-trackfield-widget {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.trackfield-widget-filters {
    background: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6;
}

.trackfield-widget-filters h4 {
    color: #495057 !important;
    font-weight: 600 !important;
    text-align: center;
    margin: 0 0 10px 0 !important;
}

.trackfield-widget-filters select {
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    transition: border-color 0.15s ease-in-out !important;
}

.trackfield-widget-filters select:focus {
    outline: none !important;
    border-color: #0073aa !important;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2) !important;
}

.trackfield-widget-filters .clear-trackfield-filters:hover {
    background: #5a6268 !important;
}

.trackfield-records-container .athletics-records-table {
    margin: 0;
    font-size: 13px;
}

.trackfield-records-container .athletics-records-table thead th {
    background: #343a40;
    color: white;
    padding: 12px 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.trackfield-records-container .athletics-records-table tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid #dee2e6;
}

.trackfield-records-container .age-group {
    background: #e9ecef;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.trackfield-records-container .event-name {
    font-weight: 600;
    color: #495057;
    font-size: 13px;
}

.trackfield-records-container .athlete-name {
    color: #6c757d;
    font-size: 12px;
}

.trackfield-records-container .record-value {
    font-weight: 700;
    color: #28a745;
    font-size: 14px;
}

.trackfield-records-container .record-year {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #6c757d;
}

.trackfield-records-container .loading {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #6c757d !important;
    font-style: italic;
}

/* Widget responsive design */
@media (max-width: 768px) {
    .trackfield-widget-filters > div {
        flex-direction: column !important;
    }
    
    .trackfield-widget-filters > div > div {
        min-width: auto !important;
        width: 100% !important;
        margin-bottom: 8px;
    }
    
    .trackfield-records-container .athletics-records-table {
        font-size: 11px;
    }
    
    .trackfield-records-container .athletics-records-table thead th,
    .trackfield-records-container .athletics-records-table tbody td {
        padding: 6px 4px;
    }
}

/* Widget in sidebar styling */
.widget .athletics-trackfield-widget {
    margin: 0 -15px;
}

.widget .trackfield-widget-filters {
    margin: 0 15px 15px 15px !important;
    border-radius: 5px !important;
}

.widget .trackfield-records-container {
    margin: 0 15px;
}

/* Table header colors for Track & Field */
.trackfield-records-container .athletics-records-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Road Running Widget Specific Styles */
.athletics-roadrunning-widget {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.roadrunning-widget-filters {
    background: #f0f8ff !important;
    border-bottom: 1px solid #bee5eb;
}

.roadrunning-widget-filters h4 {
    color: #0c5460 !important;
    font-weight: 600 !important;
    text-align: center;
    margin: 0 0 10px 0 !important;
}

.roadrunning-widget-filters select {
    border: 1px solid #bee5eb !important;
    border-radius: 4px !important;
    transition: border-color 0.15s ease-in-out !important;
}

.roadrunning-widget-filters select:focus {
    outline: none !important;
    border-color: #17a2b8 !important;
    box-shadow: 0 0 0 2px rgba(23, 162, 184, 0.2) !important;
}

.roadrunning-widget-filters .clear-roadrunning-filters {
    background: #17a2b8 !important;
}

.roadrunning-widget-filters .clear-roadrunning-filters:hover {
    background: #138496 !important;
}

.roadrunning-records-container .athletics-records-table thead {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%) !important;
}

.roadrunning-records-container .athletics-records-table thead th {
    color: #212529 !important;
}

/* Widget in sidebar styling for Road Running */
.widget .athletics-roadrunning-widget {
    margin: 0 -15px;
}

.widget .roadrunning-widget-filters {
    margin: 0 15px 15px 15px !important;
    border-radius: 5px !important;
}

.widget .roadrunning-records-container {
    margin: 0 15px;
}

/* All Records Widget Specific Styles */
.athletics-allrecords-widget {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.allrecords-widget-filters {
    background: #fff3cd !important;
    border-bottom: 1px solid #ffeaa7;
}

.allrecords-widget-filters h4 {
    color: #856404 !important;
    font-weight: 600 !important;
    text-align: center;
    margin: 0 0 10px 0 !important;
}

.allrecords-widget-filters select {
    border: 1px solid #ffeaa7 !important;
    border-radius: 4px !important;
    transition: border-color 0.15s ease-in-out !important;
    font-size: 11px !important;
}

.allrecords-widget-filters select:focus {
    outline: none !important;
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2) !important;
}

.allrecords-widget-filters .clear-allrecords-filters {
    background: #ffc107 !important;
    color: #212529 !important;
}

.allrecords-widget-filters .clear-allrecords-filters:hover {
    background: #e0a800 !important;
}

.allrecords-container .athletics-records-table thead {
    background: linear-gradient(135deg, #fd79a8 0%, #fdcb6e 100%) !important;
}

.allrecords-container .athletics-records-table thead th {
    color: #fff !important;
}

/* Widget in sidebar styling for All Records */
.widget .athletics-allrecords-widget {
    margin: 0 -15px;
}

.widget .allrecords-widget-filters {
    margin: 0 15px 15px 15px !important;
    border-radius: 5px !important;
}

.widget .allrecords-container {
    margin: 0 15px;
}

/* Common widget responsive design */
@media (max-width: 768px) {
    .roadrunning-widget-filters > div,
    .allrecords-widget-filters > div {
        flex-direction: column !important;
    }
    
    .roadrunning-widget-filters > div > div,
    .allrecords-widget-filters > div > div {
        min-width: auto !important;
        width: 100% !important;
        margin-bottom: 8px;
    }
}
