/**
 * LBWSW Results Styles
 * 
 * Styling for results display components
 */

/* ============================================
   Results Overview Display (in participant list)
   ============================================ */

.lbwsw-result-display {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9em;
}

.lbwsw-result-time {
    font-weight: bold;
    font-size: 1.1em;
    color: #2c3e50;
}

.lbwsw-result-ranks {
    font-size: 0.85em;
    color: #7f8c8d;
}

.lbwsw-no-result {
    color: #95a5a6;
    font-style: italic;
}

.lbwsw-result-dnf,
.lbwsw-result-dns {
    font-weight: bold;
    color: #e74c3c;
    text-transform: uppercase;
}

/* ============================================
   Live Results Box
   ============================================ */

.lbwsw-live-box {
    background: #ffffff;
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.lbwsw-live-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #ecf0f1;
}

.lbwsw-live-box-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: #2c3e50;
}

.lbwsw-live-indicator {
    background: #e74c3c;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Top 3 Section */
.lbwsw-live-box-top3 {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe8cc 100%);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.lbwsw-live-box-top3 h4 {
    margin: 0 0 1rem 0;
    color: #d35400;
    font-size: 1.2em;
}

.lbwsw-top3-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: top3-counter;
}

.lbwsw-top3-item {
    display: grid;
    grid-template-columns: 3rem 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #f39c12;
    counter-increment: top3-counter;
}

.lbwsw-top3-item:nth-child(1) {
    border-left-color: #f1c40f;
    background: linear-gradient(to right, #fff9e6, white);
}

.lbwsw-top3-item:nth-child(2) {
    border-left-color: #bdc3c7;
    background: linear-gradient(to right, #f5f5f5, white);
}

.lbwsw-top3-item:nth-child(3) {
    border-left-color: #cd7f32;
    background: linear-gradient(to right, #fff4e6, white);
}

.lbwsw-top3-item .lbwsw-rank {
    font-weight: bold;
    font-size: 1.3em;
    color: #2c3e50;
}

.lbwsw-top3-item .lbwsw-name {
    font-weight: 500;
}

.lbwsw-top3-item .lbwsw-time {
    font-weight: bold;
    color: #27ae60;
    font-size: 1.1em;
}

/* Latest Finishers Section */
.lbwsw-live-box-finishers {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.lbwsw-live-box-finishers h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.lbwsw-finishers-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lbwsw-finisher-item {
    display: grid;
    grid-template-columns: 3rem 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.lbwsw-finisher-item:last-child {
    border-bottom: none;
}

.lbwsw-finisher-item .lbwsw-rank {
    color: #7f8c8d;
    font-weight: 500;
}

.lbwsw-finisher-item .lbwsw-name {
    color: #2c3e50;
}

.lbwsw-finisher-item .lbwsw-time {
    font-weight: 600;
    color: #3498db;
}

/* No Results State */
.lbwsw-no-results,
.lbwsw-no-finishers {
    text-align: center;
    padding: 2rem 1rem;
    color: #95a5a6;
}

.lbwsw-no-results .dashicons {
    font-size: 3em;
    width: 3em;
    height: 3em;
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

.lbwsw-no-results p {
    margin: 0;
    font-size: 1.1em;
}

/* Footer */
.lbwsw-live-box-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #ecf0f1;
    text-align: center;
    color: #7f8c8d;
}

/* ============================================
   Age Class Tables
   ============================================ */

.lbwsw-ak-tables {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.lbwsw-ak-tables-header {
    margin-bottom: 1.5rem;
}

.lbwsw-ak-tables-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.4em;
}

/* Tab Navigation */
.lbwsw-ak-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ecf0f1;
}

.lbwsw-ak-tab {
    background: #ecf0f1;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.lbwsw-ak-tab:hover {
    background: #bdc3c7;
    transform: translateY(-1px);
}

.lbwsw-ak-tab.active {
    background: #3498db;
    color: white;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

/* Age Class Table Content */
.lbwsw-ak-table h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.2em;
}

.lbwsw-ak-gender-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .lbwsw-ak-gender-tables {
        grid-template-columns: 1fr;
    }
}

.lbwsw-ak-gender-table h5 {
    margin: 0 0 0.75rem 0;
    color: #34495e;
    font-size: 1.1em;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

/* Results Table */
.lbwsw-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.lbwsw-results-table thead {
    background: #ecf0f1;
}

.lbwsw-results-table th {
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #bdc3c7;
}

.lbwsw-results-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.lbwsw-results-table tbody tr:hover {
    background: #f8f9fa;
}

.lbwsw-results-table tbody tr:nth-child(1) {
    background: linear-gradient(to right, #fff9e6, transparent);
    font-weight: 500;
}

.lbwsw-results-table tbody tr:nth-child(2) {
    background: linear-gradient(to right, #f5f5f5, transparent);
}

.lbwsw-results-table tbody tr:nth-child(3) {
    background: linear-gradient(to right, #fff4e6, transparent);
}

/* ============================================
   Admin Results Page
   ============================================ */

.lbwsw-summary-total {
    background: #ecf0f1;
    font-weight: bold;
}

.lbwsw-results-import-tab,
.lbwsw-results-series-tab {
    max-width: 1200px;
}

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

@media (max-width: 768px) {
    .lbwsw-live-box {
        padding: 1rem;
    }
    
    .lbwsw-top3-item,
    .lbwsw-finisher-item {
        grid-template-columns: 2.5rem 1fr auto;
        gap: 0.5rem;
        font-size: 0.9em;
    }
    
    .lbwsw-ak-tabs {
        justify-content: center;
    }
    
    .lbwsw-ak-tab {
        font-size: 0.9em;
        padding: 0.4rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .lbwsw-live-box-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .lbwsw-top3-item,
    .lbwsw-finisher-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    
    .lbwsw-top3-item .lbwsw-rank,
    .lbwsw-finisher-item .lbwsw-rank {
        grid-column: 1;
        grid-row: 1;
    }
    
    .lbwsw-top3-item .lbwsw-name,
    .lbwsw-finisher-item .lbwsw-name {
        grid-column: 1;
        grid-row: 2;
    }
    
    .lbwsw-top3-item .lbwsw-time,
    .lbwsw-finisher-item .lbwsw-time {
        grid-column: 1;
        grid-row: 3;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .lbwsw-live-indicator,
    .lbwsw-live-box-footer,
    .lbwsw-ak-tabs {
        display: none;
    }
    
    .lbwsw-live-box,
    .lbwsw-ak-tables {
        border: 1px solid #333;
        box-shadow: none;
    }
    
    .lbwsw-ak-table {
        display: block !important;
        page-break-inside: avoid;
    }
}

/* ============================================
   Shortcode: Ergebnisse
   ============================================ */

.lbwsw-ergebnisse {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Accordion Styling */
.ergebnisse__accordion {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    background: white;
}

.ergebnisse__accordion-title {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    background: linear-gradient(135deg, #f5f7fa 0%, #fff 100%);
    user-select: none;
    transition: all 0.3s ease;
}

.ergebnisse__accordion-title:hover {
    background: linear-gradient(135deg, #ecf0f5 0%, #f5f7fa 100%);
}

details[open] > .ergebnisse__accordion-title {
    background: linear-gradient(135deg, #e8eef5 0%, #f0f3fa 100%);
    border-bottom: 1px solid #dee2e6;
}

.ergebnisse__accordion-icon {
    display: inline-block;
    margin-right: 0.75rem;
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

details[open] > .ergebnisse__accordion-title .ergebnisse__accordion-icon {
    transform: rotate(180deg);
}

.ergebnisse__accordion-content {
    padding: 1.5rem;
    background: white;
    border-top: 1px solid #dee2e6;
}

/* Tabs */
.ergebnisse__tabs {
    margin-bottom: 1.5rem;
}

.ergebnisse__tab-buttons {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 1.5rem;
}

.ergebnisse__tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
}

.ergebnisse__tab-btn:hover {
    color: #495057;
    background: #f8f9fa;
}

.ergebnisse__tab-btn.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
}

.ergebnisse__tab-content {
    display: none;
}

.ergebnisse__tab-content.active {
    display: block;
}

/* Form Groups */
.ergebnisse__form-group {
    margin-bottom: 1rem;
}

.ergebnisse__form-group:last-child {
    margin-bottom: 0;
}

.ergebnisse__form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.ergebnisse__select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.ergebnisse__select:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.ergebnisse__select:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* Radio Group */
.ergebnisse__radio-group {
    display: flex;
    gap: 2rem;
    margin-top: 0.75rem;
}

.ergebnisse__radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.ergebnisse__radio input[type="radio"] {
    cursor: pointer;
}

/* Filters Section */
.ergebnisse__filters {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.ergebnisse__filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
}

.ergebnisse__filter-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.ergebnisse__filter-reset {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.ergebnisse__filter-reset:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.ergebnisse__filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.ergebnisse__filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ergebnisse__filter-item label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2c3e50;
}

.ergebnisse__filter-select,
.ergebnisse__filter-text {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
}

.ergebnisse__filter-text {
    font-family: inherit;
}

.ergebnisse__filter-text:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* Results Section */
.ergebnisse__results {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
}

.ergebnisse__results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
}

.ergebnisse__results-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.ergebnisse__results-info {
    font-size: 0.9rem;
    color: #6c757d;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.ergebnisse__top10-btn {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.3);
}

.ergebnisse__top10-btn:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

.ergebnisse__top10-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3);
}

.ergebnisse__results-source {
    font-weight: 500;
    color: #495057;
}

/* Table Styling */
.ergebnisse__table-wrapper {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.ergebnisse__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.ergebnisse__table thead {
    background: linear-gradient(135deg, #f5f7fa 0%, #ecf0f5 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.ergebnisse__table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
    user-select: none;
}

.ergebnisse__table th.sortable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.ergebnisse__table th.sortable:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.ergebnisse__sort-icon {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.8rem;
    color: #adb5bd;
}

.ergebnisse__table th.sortable.asc .ergebnisse__sort-icon::after {
    content: ' ▲';
    color: #0d6efd;
}

.ergebnisse__table th.sortable.desc .ergebnisse__sort-icon::after {
    content: ' ▼';
    color: #0d6efd;
}

.ergebnisse__table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: #495057;
}

.ergebnisse__table tbody tr {
    transition: background-color 0.15s;
}

.ergebnisse__table tbody tr:hover {
    background-color: #f8f9fa;
}

.ergebnisse__table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.ergebnisse__col-rank {
    width: 70px;
    text-align: center;
}

.ergebnisse__col-name {
    min-width: 180px;
    font-weight: 500;
}

.ergebnisse__col-ak {
    width: 80px;
}

.ergebnisse__col-gender {
    width: 100px;
}

.ergebnisse__col-time {
    width: 100px;
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.ergebnisse__col-status {
    width: 100px;
    text-align: center;
}

/* New columns for "Einzelne Ergebnisse" - Individual Results Table */
.ergebnisse__col-lastname {
    width: 120px;
    font-weight: 500;
}

.ergebnisse__col-firstname {
    width: 120px;
}

.ergebnisse__col-club {
    width: 140px;
    min-width: 80px;
}

.ergebnisse__col-birthyear {
    width: 90px;
    text-align: center;
}

.ergebnisse__col-competition {
    width: 150px;
    min-width: 100px;
}

.ergebnisse__col-bib {
    width: 70px;
    text-align: center;
}

.ergebnisse__col-rank-total {
    width: 100px;
    text-align: center;
}

.ergebnisse__col-rank-ak {
    width: 100px;
    text-align: center;
}

.ergebnisse__col-age-class {
    width: 80px;
    text-align: center;
}

/* Status Badges */
.ergebnisse__status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ergebnisse__status-finished {
    background: #d1e7dd;
    color: #0f5132;
}

.ergebnisse__status-dnf {
    background: #f8d7da;
    color: #842029;
}

.ergebnisse__status-dns {
    background: #e2e3e5;
    color: #383d41;
}

/* Pagination */
.ergebnisse__pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.ergebnisse__page-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.ergebnisse__page-btn:hover:not(:disabled) {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.ergebnisse__page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ergebnisse__page-info {
    color: #6c757d;
    font-size: 0.95rem;
}

/* Loading State */
.ergebnisse__loading {
    text-align: center;
    padding: 2rem !important;
    color: #6c757d;
}

.ergebnisse__loading::after {
    content: '';
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    margin-left: 0.5rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Empty State */
.ergebnisse__empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.ergebnisse__empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.ergebnisse__empty-text {
    font-size: 1.1rem;
    font-weight: 500;
}

/* ============================================
   Sort Options (Nach Teilnehmer mode)
   ============================================ */

.ergebnisse__sort-options {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    display: none;
}

.ergebnisse__sort-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.ergebnisse__sort-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ergebnisse__sort-item label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
}

.ergebnisse__sort-item select {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 0.95rem;
    cursor: pointer;
}

.ergebnisse__sort-item select:hover {
    border-color: #80bdff;
}

.ergebnisse__sort-item select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* ============================================
   Participant Aggregated Results
   ============================================ */

.ergebnisse__participant-header {
    background: #e7f3ff;
    font-weight: 600;
    border-top: 2px solid #3498db;
    border-bottom: 1px solid #bdc3c7;
}

.ergebnisse__participant-info {
    padding: 0.75rem 1rem !important;
    color: #2c3e50;
    font-size: 1rem;
}

.ergebnisse__result-row {
    background: #ffffff;
    border-left: 3px solid transparent;
}

.ergebnisse__result-row:hover {
    background: #f5f5f5;
}

.ergebnisse__result-best {
    background: #fffacd;
    border-left-color: #f39c12;
}

.ergebnisse__result-best:hover {
    background: #ffe680;
}

/* ============================================
   Series Participant View - Flex/Grid Layout
   ============================================ */

.ergebnisse__results-series {
    padding: 1rem;
}

.ergebnisse__sort-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.ergebnisse__sort-btn {
    padding: 0.5rem 1rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s, transform 0.1s;
}

.ergebnisse__sort-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.ergebnisse__sort-btn:active {
    transform: translateY(0);
}

.ergebnisse__series-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ergebnisse__gender-section {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ergebnisse__gender-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, transform 0.1s;
}

.ergebnisse__gender-header:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f618d 100%);
    transform: translateX(2px);
}

.ergebnisse__gender-emoji {
    font-size: 1.2rem;
    min-width: 24px;
}

.ergebnisse__gender-label {
    font-size: 1rem;
    flex: 1;
}

.ergebnisse__gender-count {
    font-size: 0.9rem;
    opacity: 0.9;
}

.ergebnisse__participants-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
}

.ergebnisse__participant-item {
    background: #f9fafb;
    border: 1px solid #e0e7ff;
    border-radius: 6px;
    overflow: hidden;
    transition: background 0.2s, box-shadow 0.2s;
}

.ergebnisse__participant-item:hover {
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.15);
}

.ergebnisse__participant-summary {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.ergebnisse__participant-summary:hover {
    background: #f0f7ff;
}

.ergebnisse__participant-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.ergebnisse__participant-toggle.open {
    transform: rotate(90deg);
}

.ergebnisse__participant-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ergebnisse__participant-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.ergebnisse__profile-btn {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid #3498db;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s, border-color 0.2s;
}

.ergebnisse__profile-btn:hover {
    background: #ecf0f1;
    border-color: #2980b9;
}

.ergebnisse__participant-stats {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
}

.ergebnisse__participant-medals {
    font-size: 0.85rem;
    color: #f39c12;
    line-height: 1.4;
}

.ergebnisse__participant-details {
    background: #f5f7fa;
    border-top: 1px solid #e0e7ff;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    padding: 0;
    display: block;
}

.ergebnisse__participant-details.show {
    max-height: 9999px;
    padding: 0.75rem 1rem;
    overflow: visible;
}

.ergebnisse__detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e7ff;
    align-items: center;
    font-size: 0.9rem;
    min-height: auto;
}

.ergebnisse__detail-year {
    flex: 0 0 10%;
    font-weight: 500;
    color: #3498db;
    text-align: center;
}

.ergebnisse__detail-event {
    flex: 0 0 25%;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ergebnisse__detail-ak {
    flex: 0 0 15%;
    text-align: center;
    color: #7f8c8d;
}

.ergebnisse__detail-time {
    flex: 0 0 15%;
    font-weight: 600;
    color: #27ae60;
}

.ergebnisse__detail-rank-ak {
    flex: 0 0 10%;
    text-align: center;
    color: #555;
}

.ergebnisse__detail-rank-total {
    flex: 0 0 10%;
    text-align: center;
    color: #555;
}

/* Detail row highlighting for best personal time */
.ergebnisse__detail-row:has(.ergebnisse__detail-time:contains('⭐')) {
    background: #fffacd;
}

/* ============================================
   Flat View - Table Layout
   ============================================ */

.ergebnisse__results-flat {
    padding: 1rem;
}

.ergebnisse__table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ergebnisse__table thead {
    background: #f5f7fa;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
}

.ergebnisse__table th {
    padding: 0.75rem;
    text-align: left;
    white-space: nowrap;
}

.ergebnisse__table td {
    padding: 0.75rem;
    border-bottom: 1px solid #ecf0f1;
    vertical-align: middle;
}

.ergebnisse__table tbody tr:hover {
    background: #f9fafb;
}

.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.sortable:hover {
    background: #e8ecf1;
}

/* ============================================
   Accordion Styles (Series nach Teilnehmer)
   ============================================ */

.ergebnisse__gender-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    cursor: pointer;
    user-select: none;
    font-weight: 700;
    color: #ffffff;
    transition: background 0.2s ease, transform 0.1s ease;
}

.ergebnisse__gender-header:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f618d 100%);
    transform: translateX(2px);
}

.ergebnisse__gender-header-content {
    padding: 1rem !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ergebnisse__gender-emoji {
    font-size: 1.2rem;
}

.ergebnisse__gender-label {
    font-size: 1rem;
}

.ergebnisse__gender-count {
    margin-left: auto;
    font-size: 0.9rem;
    opacity: 0.9;
}

.ergebnisse__accordion-toggle {
    display: inline-block;
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    line-height: 20px;
    flex-shrink: 0;
}

.ergebnisse__accordion-toggle.open {
    transform: rotate(90deg);
}

.ergebnisse__participant-header {
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.ergebnisse__participant-header:hover {
    background: #ecf0f1;
}
    color: #34495e;
}

.ergebnisse__accordion-toggle.open {
    transform: rotate(90deg);
}

.ergebnisse__gender-group-body {
    display: none;
    border-left: 3px solid #bdc3c7;
    padding-left: 1.5rem;
}

.ergebnisse__gender-group-body.show {
    display: block;
}

.ergebnisse__participant-header {
    background: #f8f9fa;
    padding: 1rem;
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
    margin: 0.5rem 0;
    font-weight: 500;
    color: #2c3e50;
    border-left: 4px solid #3498db;
    transition: background-color 0.2s ease;
}

.ergebnisse__participant-header:hover {
    background: #e8f4f8;
}

.ergebnisse__participant-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ergebnisse__participant-stats {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-left: auto;
}

.ergebnisse__participant-podium {
    font-size: 0.85rem;
    color: #7f8c8d;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* OLD TABLE LAYOUT - DEPRECATED - use flex-based detail rows below */

.ergebnisse__detail-row.show {
    display: table-row;
}

.ergebnisse__result-best {
    background: linear-gradient(to right, #fffacd 0%, #ffffff 100%);
    font-weight: 600;
}

.ergebnisse__result-best::before {
    content: '⭐ ';
    color: #f39c12;
    margin-right: 0.25rem;
}

/* Status Badges */
.ergebnisse__status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ergebnisse__status-dnf {
    background: #fadbd8;
    color: #c0392b;
}

.ergebnisse__status-dns {
    background: #f5b7b1;
    color: #a93226;
}

.ergebnisse__status-finished {
    background: #d5f4e6;
    color: #0e6251;
}

/* Sortable Column Headers */
.ergebnisse__sortable-header {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    padding-right: 1rem;
    position: relative;
}

.ergebnisse__sortable-header:hover {
    background: rgba(52, 152, 219, 0.1);
}

.ergebnisse__sort-indicator {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.ergebnisse__sort-indicator.asc {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid #3498db;
}

.ergebnisse__sort-indicator.desc {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #3498db;
}

/* Top 10 Modal / Panel */
.ergebnisse__top10-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ergebnisse__top10-modal.show {
    display: flex;
}

.ergebnisse__top10-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 1000px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.ergebnisse__top10-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 1rem;
    gap: 1rem;
}

.ergebnisse__top10-title-area {
    flex: 1;
}

.ergebnisse__top10-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: #2c3e50;
}

.ergebnisse__top10-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.ergebnisse__top10-export-csv {
    background: #27ae60;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
}

.ergebnisse__top10-export-csv:hover {
    background: #229954;
}

.ergebnisse__top10-close {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
}

.ergebnisse__top10-close:hover {
    background: #c0392b;
}

.ergebnisse__top10-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.ergebnisse__top10-gender {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border-top: 4px solid #3498db;
}

.ergebnisse__top10-gender.weiblich {
    border-top-color: #e91e63;
}

.ergebnisse__top10-gender.divers {
    border-top-color: #ff9800;
}

.ergebnisse__top10-gender h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.ergebnisse__top10-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: top10-counter;
}

.ergebnisse__top10-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #3498db;
    counter-increment: top10-counter;
}

.ergebnisse__top10-rank {
    font-weight: bold;
    font-size: 1.2rem;
    min-width: 2rem;
    text-align: center;
}

.ergebnisse__top10-rank::before {
    content: counter(top10-counter);
}

.ergebnisse__top10-item:nth-child(1) .ergebnisse__top10-rank {
    color: #f39c12;
}

.ergebnisse__top10-item:nth-child(1)::before {
    content: '🥇 ';
    margin-right: 0.5rem;
}

.ergebnisse__top10-item:nth-child(2) .ergebnisse__top10-rank {
    color: #95a5a6;
}

.ergebnisse__top10-item:nth-child(2)::before {
    content: '🥈 ';
    margin-right: 0.5rem;
}

.ergebnisse__top10-item:nth-child(3) .ergebnisse__top10-rank {
    color: #cd7f32;
}

.ergebnisse__top10-item:nth-child(3)::before {
    content: '🥉 ';
    margin-right: 0.5rem;
}

.ergebnisse__top10-info {
    flex: 1;
}

.ergebnisse__top10-name {
    font-weight: 600;
    color: #2c3e50;
    display: block;
}

.ergebnisse__top10-details {
    font-size: 0.85rem;
    color: #7f8c8d;
    display: block;
}

.ergebnisse__top10-meta {
    font-size: 0.8rem;
    color: #95a5a6;
    display: block;
    margin-top: 0.25rem;
    font-style: italic;
}

.ergebnisse__top10-slug {
    cursor: help;
    font-weight: 600;
    color: #3498db;
    border-bottom: 1px dotted #3498db;
    transition: color 0.2s, border-color 0.2s;
}

.ergebnisse__top10-slug:hover {
    color: #2980b9;
    border-bottom-color: #2980b9;
}

.ergebnisse__top10-time {
    font-weight: bold;
    color: #27ae60;
    min-width: 80px;
    text-align: right;
}

/* ============================================
   Profile Link & Modal
   ============================================ */

.ergebnisse__profile-link {
    cursor: pointer;
    color: #3498db;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    padding-bottom: 2px;
}

.ergebnisse__profile-link:hover {
    color: #2980b9;
    border-bottom-color: #3498db;
    text-decoration: underline;
}

.ergebnisse__profile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1001;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ergebnisse__profile-modal.show {
    display: flex;
}

.ergebnisse__profile-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.3);
    max-width: 1000px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
}

.ergebnisse__profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid #ecf0f1;
}

.ergebnisse__profile-title h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    color: #2c3e50;
}

.ergebnisse__profile-meta {
    margin: 0.5rem 0;
    font-size: 1rem;
    color: #7f8c8d;
}

.ergebnisse__profile-club {
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
    color: #16a085;
    font-weight: 500;
}

.ergebnisse__profile-close {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.2s;
}

.ergebnisse__profile-close:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.ergebnisse__profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.ergebnisse__stat-box {
    background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    border-left: 4px solid #3498db;
}

.ergebnisse__stat-label {
    display: block;
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
}

.ergebnisse__stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
}

.ergebnisse__profile-podium {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-top: 4px solid #f39c12;
}

.ergebnisse__profile-podium h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.ergebnisse__podium-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.ergebnisse__podium-item {
    background: white;
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
    border: 2px solid #ecf0f1;
}

.ergebnisse__podium-label {
    display: block;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.ergebnisse__podium-count {
    display: block;
    font-size: 1.6rem;
    font-weight: bold;
    color: #f39c12;
}

.ergebnisse__profile-trend {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border-top: 4px solid #27ae60;
}

.ergebnisse__profile-trend h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.ergebnisse__trend-table {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.ergebnisse__trend-data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
}

.ergebnisse__trend-data thead {
    background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
}

.ergebnisse__trend-data th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
}

.ergebnisse__trend-data td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #ecf0f1;
}

.ergebnisse__trend-data tbody tr:hover {
    background: #f5f7fa;
}

.ergebnisse__trend-time {
    font-weight: 600;
    color: #27ae60;
}

/* Responsive */
@media (max-width: 768px) {
    .lbwsw-ergebnisse {
        padding: 1rem;
    }
    
    .ergebnisse__tab-buttons {
        flex-wrap: wrap;
    }
    
    .ergebnisse__tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .ergebnisse__filter-grid {
        grid-template-columns: 1fr;
    }
    
    .ergebnisse__radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .ergebnisse__pagination {
        flex-direction: column;
        gap: 1rem;
    }
    
    .ergebnisse__table {
        font-size: 0.85rem;
    }
    
    .ergebnisse__table th,
    .ergebnisse__table td {
        padding: 0.5rem;
    }
    
    .ergebnisse__col-name {
        min-width: 120px;
    }
    
    .ergebnisse__col-time {
        width: 80px;
    }
}
