/**
 * FPETARCO Records Public CSS (T033)
 *
 * Styling for the public records listing page.
 * Matches the rankings page style for consistency.
 *
 * @package FPETARCO_Competition_Management
 * @since   2.0.0
 * @since   2.2.0 Redesigned to card-based layout matching rankings page
 */

/* ==========================================================================
   Records Listing Page
   ========================================================================== */

.fpetarco-records-listing {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.fpetarco-records-listing .page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.fpetarco-records-listing .page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.fpetarco-records-listing .page-description {
    font-size: 1.125rem;
    color: #666;
    margin: 0;
}

/* ==========================================================================
   Filter Bar - Matching Rankings Style
   ========================================================================== */

.records-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f5f5f5;
    border-radius: 8px;
}

.records-filters .filter-group {
    flex: 1;
    min-width: 250px;
}

.records-filters .filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.records-filters .filter-input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: border-color 0.3s ease;
}

.records-filters .filter-input:focus {
    outline: none;
    border-color: #0066cc;
}

.records-filters .filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.records-filters .filter-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.records-filters .filter-btn:hover {
    border-color: #0066cc;
    background: #f0f7ff;
}

.records-filters .filter-btn.active {
    border-color: #0066cc;
    background: #0066cc;
    color: #fff;
}

/* ==========================================================================
   Records Container
   ========================================================================== */

.records-container {
    min-height: 200px;
}

.records-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.records-loading .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0066cc;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-records,
.error-message {
    text-align: center;
    padding: 3rem;
    font-size: 1.125rem;
    color: #666;
    background: #f5f5f5;
    border-radius: 8px;
}

.error-message {
    color: #d32f2f;
    background: #ffebee;
}

/* ==========================================================================
   Category Sections (Bow Type Groups)
   ========================================================================== */

.category-section {
    margin-bottom: 3rem;
}

.category-header {
    background: #f5f5f5;
    padding: 1rem 1.5rem;
    border-left: 5px solid #0066cc;
    margin-bottom: 1.5rem;
}

.category-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

/* ==========================================================================
   Competition Type Sub-sections (Indoor/Outdoor)
   ========================================================================== */

.competition-type-section {
    margin-bottom: 1.5rem;
}

.competition-type-title {
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    margin: 0 0 1rem 0;
    padding-left: 0.5rem;
}

.type-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-badge.indoor {
    background: #ff6b35;
    color: #fff;
}

.type-badge.outdoor {
    background: #00a651;
    color: #fff;
}

/* ==========================================================================
   Gender Sub-sections
   ========================================================================== */

.gender-section {
    margin-bottom: 2rem;
    padding-left: 1rem;
    border-left: 3px solid #e0e0e0;
}

.gender-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

/* ==========================================================================
   Record Cards - Grid Layout
   ========================================================================== */

.record-list {
    display: grid;
    gap: 0.75rem;
}

.record-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.record-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #0066cc;
}

/* Record Category Header - Prominent Badge */
.record-category-header {
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.record-category-badge {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0066cc;
    letter-spacing: 0.3px;
}

/* Record Card Content - Main Area */
.record-card-content {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
}

/* Athlete Photo */
.record-card .athlete-photo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e0e0e0;
}

/* Record Info */
.record-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.athlete-name-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.record-info .athlete-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s ease;
}

.record-info a.athlete-name:hover {
    color: #0066cc;
}

.record-date-separator {
    color: #ccc;
    font-weight: 300;
}

.record-date-inline,
.record-date-link {
    font-size: 0.95rem;
    color: #666;
}

.record-date-link {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.record-date-link:hover {
    color: #004499;
    text-decoration: underline;
}

.record-info .athlete-club {
    font-size: 0.95rem;
    color: #666;
}

/* Club with logo */
.record-info .result-club {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.record-info .result-club-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
    border-radius: 2px;
}

.record-info .result-club-name {
    font-size: 0.95rem;
    color: #666;
}

.record-info .record-category {
    font-size: 0.875rem;
    color: #999;
    font-style: italic;
}

/* Record Score */
.record-score {
    text-align: right;
}

.record-score .score-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0066cc;
}

.record-score .score-label {
    font-size: 0.875rem;
    color: #999;
}

/* Record Date - Now inline with name, keeping for legacy */
.record-date {
    font-size: 0.95rem;
    color: #666;
    text-align: right;
    min-width: 100px;
}

.record-date a.competition-link {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.record-date a.competition-link:hover {
    color: #004499;
    text-decoration: underline;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .fpetarco-records-listing .page-title {
        font-size: 2rem;
    }
    
    .record-card-content {
        grid-template-columns: 60px 1fr auto;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
    
    .record-card .athlete-photo {
        width: 60px;
        height: 60px;
    }
    
    .gender-section {
        padding-left: 0.75rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .fpetarco-records-listing {
        padding: 1rem 0.75rem;
    }
    
    .fpetarco-records-listing .page-title {
        font-size: 1.75rem;
    }
    
    .records-filters {
        flex-direction: column;
    }
    
    .records-filters .filter-buttons {
        flex-wrap: wrap;
    }
    
    .records-filters .filter-btn {
        flex: 1;
        min-width: calc(50% - 0.25rem);
        text-align: center;
    }
    
    .gender-section {
        padding-left: 0.5rem;
        border-left: 2px solid #e0e0e0;
    }
    
    .gender-title {
        font-size: 1.1rem;
    }
    
    /* Mobile card layout */
    .record-card-content {
        grid-template-columns: 55px 1fr;
        grid-template-rows: auto auto;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .record-card .athlete-photo {
        width: 55px;
        height: 55px;
        grid-row: 1 / 3;
        align-self: center;
    }
    
    .record-info {
        grid-column: 2;
    }
    
    .athlete-name-date {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }
    
    .record-date-separator {
        display: none;
    }
    
    .record-score {
        grid-row: 2;
        grid-column: 2;
        text-align: left;
        display: flex;
        align-items: baseline;
        gap: 0.5rem;
    }
    
    .record-score .score-value {
        font-size: 1.5rem;
    }
    
    .record-category-header {
        padding: 0.4rem 0.75rem;
    }
    
    .record-category-badge {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .fpetarco-records-listing .page-title {
        font-size: 1.5rem;
    }
    
    .record-card-content {
        grid-template-columns: 50px 1fr;
        gap: 0.5rem;
        padding: 0.625rem;
    }
    
    .record-card .athlete-photo {
        width: 50px;
        height: 50px;
    }
    
    .record-info .athlete-name {
        font-size: 1rem;
    }
    
    .record-info .athlete-club {
        font-size: 0.875rem;
    }
    
    .record-date-inline,
    .record-date-link {
        font-size: 0.85rem;
    }
    
    .record-score .score-value {
        font-size: 1.25rem;
    }
    
    .category-name {
        font-size: 1.25rem;
    }
    
    .gender-title {
        font-size: 1rem;
    }
    
    .record-category-badge {
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.records-filters .filter-btn:focus,
.records-filters .filter-input:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.record-card:focus-within {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* ==========================================================================
   Historical Records Page (for future US7)
   ========================================================================== */

.fpetarco-records-history {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.records-timeline {
    position: relative;
    padding-left: 30px;
}

.records-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dcdcde;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 25px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #0066cc;
    border: 2px solid #fff;
}

.timeline-item.current::before {
    background-color: #0d6d0d;
    width: 14px;
    height: 14px;
    left: -25px;
}

.timeline-item.current {
    border-left: 3px solid #0d6d0d;
}

.timeline-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.timeline-item-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0d6d0d;
}

.timeline-item-duration {
    font-size: 0.9rem;
    color: #666;
    background-color: #f5f5f5;
    padding: 4px 10px;
    border-radius: 4px;
}

.timeline-item-athlete {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.timeline-item-details {
    font-size: 0.9rem;
    color: #666;
}

.current-badge {
    display: inline-block;
    background-color: #0d6d0d;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    margin-left: 10px;
}
