/* Modern Design System for WM2026 Masters Leichtathletik */

:root {
    --bg-primary: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-hover: #334155;
    --bg-glass: rgba(30, 41, 59, 0.85);
    --border-color: #334155;
    --border-color-light: #475569;
    --text-main: #f8fafc;
    --text-bright: #ffffff;
    --text-muted: #cbd5e1;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent-gold: #f59e0b;
    --accent-red: #ef4444;
    --accent-green: #10b981;
    --accent-purple: #8b5cf6;
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.9);
    --border-color: #cbd5e1;
    --border-color-light: #94a3b8;
    --text-main: #0f172a;
    --text-bright: #000000;
    --text-muted: #475569;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.flag-stripe {
    height: 4px;
    display: flex;
    width: 100%;
}

.flag-stripe .black {
    flex: 1;
    background: #000;
}

.flag-stripe .red {
    flex: 1;
    background: #dd0000;
}

.flag-stripe .gold {
    flex: 1;
    background: #ffcc00;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.app-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-badge {
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: #ffffff;
}

[data-theme="light"] .app-title {
    color: #0f172a;
}

/* Metrics Cards Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.metric-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.metric-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.metric-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.metric-icon.gold {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.metric-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.metric-icon.purple {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.metric-info .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.metric-info .value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-bright);
    line-height: 1.2;
}

/* Control Panel & Quick Filters */
.controls-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    color: var(--text-main);
}

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.btn-filter {
    background: var(--bg-primary);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-filter:hover,
.btn-filter.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

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

.form-control,
.form-select {
    background-color: var(--bg-primary);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    background-color: var(--bg-primary);
    color: var(--text-main);
}

/* Nav Tabs */
.nav-tabs-custom {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 2px;
}

.tab-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Data Table Styling & High-Contrast Text */
.table-responsive-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-lg);
    color: var(--text-main);
}

.table-custom {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    font-size: 0.92rem;
    color: var(--text-main) !important;
}

.table-custom th {
    background: var(--bg-primary);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    user-select: none;
    cursor: pointer;
}

.table-custom th:hover {
    color: var(--primary);
}

.table-custom td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-main) !important;
}

/* High Contrast Athlete Names */
.table-custom td strong,
.athlete-name {
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.95rem;
}

[data-theme="light"] .table-custom td strong,
[data-theme="light"] .athlete-name {
    color: #0f172a !important;
}

.table-custom tbody tr {
    transition: var(--transition);
    background-color: var(--bg-surface);
}

.table-custom tbody tr:hover {
    background-color: var(--bg-surface-hover) !important;
}

/* Accordion Specific High-Contrast Styling */
.accordion-item {
    background-color: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden;
}

.accordion-button {
    background-color: var(--bg-surface) !important;
    color: var(--text-bright) !important;
    font-weight: 700 !important;
    font-size: 1rem;
    box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
    background-color: var(--bg-surface-hover) !important;
    color: #60a5fa !important;
    border-bottom: 1px solid var(--border-color);
}

.accordion-body {
    background-color: var(--bg-surface) !important;
    color: var(--text-main) !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar for horizontal table scrolling */
.table-responsive-card::-webkit-scrollbar,
.accordion-body::-webkit-scrollbar {
    height: 6px;
}

.table-responsive-card::-webkit-scrollbar-track,
.accordion-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.table-responsive-card::-webkit-scrollbar-thumb,
.accordion-body::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* Status Badges */
.badge-status {
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    text-transform: capitalize;
}

.badge-accepted {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.mark-pill {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-weight: 700;
    color: #ffffff !important;
    background: var(--bg-primary);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

[data-theme="light"] .mark-pill {
    color: #0f172a !important;
}

/* Country Tag & Flag */
.country-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main) !important;
}

.country-code-tag {
    font-weight: 700;
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-bright) !important;
    border: 1px solid var(--border-color);
}

/* Pagination Footer */
.table-footer {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    color: var(--text-main);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-page {
    background: var(--bg-primary);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-page:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-page.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-page:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Upload & Drag Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color-light);
    border-radius: var(--radius-lg);
    padding: 3rem 1.5rem;
    text-align: center;
    background: var(--bg-primary);
    transition: var(--transition);
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.drop-zone-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* Loading overlay */
.spinner-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

/* Custom Age Group Badges */
.badge-ak-men {
    background-color: #38bdf8 !important;
    color: #032838 !important;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.32em 0.65em;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(56, 189, 248, 0.25);
    display: inline-block;
}

.badge-ak-women {
    background-color: #f472b6 !important;
    color: #3b071e !important;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.32em 0.65em;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(244, 114, 182, 0.25);
    display: inline-block;
}

.badge-ak-default {
    background-color: #64748b !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.32em 0.65em;
    border-radius: 6px;
    display: inline-block;
}

/* Status Circle Indicators (Confirmed Status) */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    box-sizing: border-box;
}

.status-dot.confirmed {
    background-color: #10b981;
    border: 1px solid #059669;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.status-dot.not-confirmed {
    background-color: #ef4444;
    border: 1px solid #dc2626;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.status-dot.open {
    background-color: transparent;
    border: 2px solid #cbd5e1;
}

[data-theme="light"] .status-dot.open {
    border-color: #64748b;
}

.col-status-icon {
    width: 32px;
    text-align: center !important;
    padding-left: 0.4rem !important;
    padding-right: 0.4rem !important;
}

#lastUpdateText {
    color: var(--text-bright) !important;
}