:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #131c2e;
    --bg-card: #18233a;
    --bg-card-hover: #1e2c48;
    --text-bright: #ffffff;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --accent-blue: #0284c7;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --yt-red: #ff0000;
    
    --border-color: #2a3b5c;
    --border-bright: #3d5480;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --text-bright: #0f172a;
    --text-primary: #1e293b;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --border-bright: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-bright);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0284c7, #06b6d4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #fff;
    box-shadow: 0 2px 10px rgba(6, 182, 212, 0.35);
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-bright);
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-cyan);
}

.btn-primary {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border-color: #0284c7;
    color: #ffffff !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0369a1, #075985);
    box-shadow: 0 2px 12px rgba(2, 132, 199, 0.4);
}

.btn-admin {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.5);
    color: #fbbf24;
}

.btn-admin:hover {
    background: rgba(245, 158, 11, 0.25);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* YouTube Banner (Direct External Link) */
.youtube-banner {
    background: linear-gradient(135deg, #200508 0%, #151b2e 100%);
    border: 2px solid #b91c1c;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.15);
}

.youtube-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.badge-live-yt {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #ef4444;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.yt-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 1.4s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.4; }
    100% { transform: scale(0.9); opacity: 1; }
}

.youtube-banner-left h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 0.2rem;
}

.youtube-banner-left p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-yt-watch {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff !important;
    padding: 0.75rem 1.4rem;
    font-size: 1rem;
    font-weight: 800;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-yt-watch:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

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

.tab-btn {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

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

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

/* Main Container */
.main-content {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem 1rem;
    width: 100%;
    flex: 1;
}

/* Section Header */
.section-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-bright);
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.search-box-compact {
    width: 280px;
}

/* High Contrast Cards */
.high-contrast-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

/* Disciplines Grid & Accordion */
.disciplines-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.discipline-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.discipline-card.approved {
    border-color: #10b981;
}

.discipline-card:hover {
    border-color: var(--accent-cyan);
}

.discipline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
}

.discipline-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.event-num-badge {
    background: #0284c7;
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-family: var(--font-mono);
}

.event-name-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-bright);
}

.event-sub-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.discipline-filters-row {
    margin-bottom: 1.25rem;
}

.discipline-filter-pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    background: var(--bg-card);
    padding: 0.35rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.discipline-pill {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.discipline-pill:hover {
    color: var(--text-bright);
    background: rgba(255, 255, 255, 0.05);
}

.discipline-pill.active {
    background: var(--accent-cyan);
    color: #000;
    font-weight: 700;
}

.discipline-card.current {
    border: 2px solid var(--accent-cyan) !important;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.25);
    position: relative;
}

.discipline-card.current::before {
    content: "🔴 PRÁVĚ PROBÍHÁ NA BAZÉNU";
    position: absolute;
    top: -11px;
    left: 16px;
    background: #ff4757;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(255, 71, 87, 0.4);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-badge.current {
    background: rgba(255, 71, 87, 0.18);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.5);
}

.status-badge.waiting {
    background: rgba(255, 165, 2, 0.15);
    color: #ffa502;
    border: 1px solid rgba(255, 165, 2, 0.4);
}

.status-badge.approved {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.live-dot-pulse {
    width: 8px;
    height: 8px;
    background: #ff4757;
    border-radius: 50%;
    display: inline-block;
    animation: pulseDot 1.4s infinite ease-in-out;
}

@keyframes pulseDot {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

.status-approved {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid #10b981;
}

.status-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.discipline-content {
    border-top: 1px solid var(--border-color);
    padding: 1.25rem;
    background: var(--bg-card);
}

/* Results Table */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.results-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

.results-table td {
    padding: 0.75rem;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.results-table tr:hover td {
    background: var(--bg-card-hover);
}

.results-table .time-cell {
    font-family: var(--font-mono);
    font-weight: 800;
    color: #10b981;
    font-size: 1.05rem;
    text-align: right;
}

.place-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.85rem;
}

.place-1 { background: #ffd700; color: #000; box-shadow: 0 0 8px rgba(255, 215, 0, 0.4); }
.place-2 { background: #e2e8f0; color: #000; }
.place-3 { background: #cd7f32; color: #fff; }

/* PDF Grid */
.pdf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.pdf-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-left: 5px solid var(--accent-cyan);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pdf-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0.35rem;
}

/* Sponsors Grid & Footer Strip */
.sponsors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.sponsor-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
}

.sponsor-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.sponsor-tier-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    margin-bottom: 0.6rem;
}

.sponsor-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 0.25rem;
}

.sponsor-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sponsors-strip {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.strip-label {
    font-weight: 800;
    color: var(--accent-cyan);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.strip-items {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    flex-wrap: wrap;
    justify-content: center;
}

/* Search Box */
.search-container {
    margin-bottom: 1.5rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-bright);
    font-size: 1.05rem;
    outline: none;
    transition: all 0.2s;
}

.search-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.swimmer-chips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

.swimmer-chip {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    cursor: pointer;
}

.swimmer-chip:hover {
    border-color: var(--accent-cyan);
    background: var(--bg-card);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 2px solid var(--border-color);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.admin-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 700;
    padding: 0.5rem 0.85rem;
    cursor: pointer;
    border-radius: 6px;
}

.admin-tab-btn.active {
    background: var(--accent-blue);
    color: #fff;
}

.admin-approval-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.admin-approval-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    gap: 0.75rem;
}

.admin-approval-row.approved {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-bright);
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--accent-cyan);
    outline: none;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* Mobile responsive */
@media (max-width: 680px) {
    .header-container {
        padding: 0.65rem 0.75rem;
    }

    .brand-title {
        font-size: 1.1rem;
    }

    .youtube-banner {
        padding: 1rem;
    }

    .btn-yt-watch {
        width: 100%;
        justify-content: center;
    }

    .section-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box-compact {
        width: 100%;
    }

    .discipline-header {
        padding: 0.85rem;
    }

    .discipline-title-row {
        gap: 0.4rem;
    }

    .event-name-text {
        font-size: 1rem;
    }

    .results-table td, .results-table th {
        padding: 0.55rem 0.4rem;
        font-size: 0.85rem;
    }

    .results-table .time-cell {
        font-size: 0.95rem;
    }

    .pdf-grid {
        grid-template-columns: 1fr;
    }

    .sponsors-grid {
        grid-template-columns: 1fr;
    }

    .tabs {
        gap: 0.25rem;
    }

    .tab-btn {
        padding: 0.55rem 0.85rem;
        font-size: 0.9rem;
    }
}

.footer-admin-link {
    color: var(--text-muted, #64748b);
    text-decoration: none;
    font-size: 0.78rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.6;
}

.footer-admin-link:hover {
    color: var(--accent-cyan, #00d2ff);
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
}
