/* ==================== FORM COMPONENTS ==================== */

/* Search Input */
.search-container {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.search-input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    padding-left: calc(var(--spacing-xl) + var(--spacing-md));
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--info-light);
}

.search-icon {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.search-clear:hover {
    background: var(--background);
    color: var(--text-primary);
}

.search-clear svg {
    width: 16px;
    height: 16px;
}

/* ==================== CARDS ==================== */
.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-clickable {
    cursor: pointer;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

.card-body {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.card-footer {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--divider);
}

/* ==================== QUICK ACTION CARD ==================== */
.quick-action-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    transition: all var(--transition-fast);
    border: 2px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .quick-action-card {
    border-color: rgba(255, 255, 255, 0.15);
}

.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

/* ==================== ATHLETE CARD ==================== */
.athlete-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--spacing-md);
    align-items: center;
    padding: var(--spacing-md);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: var(--spacing-md);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.athlete-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.athlete-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    font-weight: 700;
    font-size: 1.25rem;
}

.athlete-info {
    min-width: 0;
}

.athlete-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.athlete-club {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.athlete-meta {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.favorite-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    color: var(--text-tertiary);
}

.favorite-btn:hover {
    background: var(--background);
}

.favorite-btn.active {
    color: var(--warning);
}

.favorite-btn svg {
    width: 24px;
    height: 24px;
}

.favorite-btn.active svg {
    fill: currentColor;
}

/* ==================== BADGE ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
    font-size: 0.70rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--info-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-info {
    background: #E3F2FD;
    color: #1976D2;
}

[data-theme="dark"] .badge-info {
    background: rgba(25, 118, 210, 0.2);
    color: #64B5F6;
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-error {
    background: var(--error-light);
    color: var(--error);
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xs) var(--spacing-xs);
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin-bottom: var(--spacing-lg);
    color: var(--text-tertiary);
    opacity: 0.5;
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    max-width: 400px;
}

/* ==================== SECTION HEADER ==================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-action {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    transition: color var(--transition-fast);
}

.section-action:hover {
    color: var(--primary-dark);
}

/* ==================== DIVIDER ==================== */
.divider {
    height: 1px;
    background: var(--divider);
    margin: var(--spacing-lg) 0;
}

/* ==================== SKELETON LOADING ==================== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--border) 0%,
        var(--divider) 50%,
        var(--border) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--spacing-sm);
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
}

.skeleton-card {
    height: 120px;
    margin-bottom: var(--spacing-md);
}

/* ==================== LIST ==================== */
.list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.list-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.list-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: var(--spacing-sm);
    border-bottom: 1px solid var(--divider);
    margin-bottom: var(--spacing-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: var(--spacing-md) var(--spacing-lg);
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

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

/* ==================== TOAST NOTIFICATION ==================== */
.toast {
    position: fixed;
    top: calc(var(--spacing-lg) + 64px);
    right: var(--spacing-lg);
    left: var(--spacing-lg);
    z-index: var(--z-toast);
    background: var(--surface);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    animation: slideDown var(--transition-base);
    max-width: 500px;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (min-width: 768px) {
    .toast {
        left: auto;
    }
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error .toast-icon {
    color: var(--error);
}

.toast-info .toast-icon {
    color: var(--info);
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.toast-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--background);
    color: var(--text-primary);
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

/* ==================== FILTER TABS ==================== */
.filter-tab {
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-tab:hover {
    background: var(--background);
    border-color: var(--primary);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-tab.active:hover {
    background: var(--primary-dark);
}

/* Search Mode Tabs - Lighter Style */
.search-mode-tab {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.search-mode-tab span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-mode-tab svg {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

.search-mode-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 174, 239, 0.05);
}

.search-mode-tab:hover svg {
    opacity: 1;
    transform: translateY(-1px);
}

.search-mode-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 174, 239, 0.3);
}

.search-mode-tab.active svg {
    opacity: 1;
}

.search-mode-tab.active:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0, 174, 239, 0.4);
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .search-mode-tab {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    .search-mode-tab svg {
        width: 16px;
        height: 16px;
        margin-right: 4px;
    }
}

/* Filter Chips (Lighter style for filters) */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 174, 239, 0.05);
}

.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 2px 6px rgba(0, 174, 239, 0.25);
}

.filter-chip.active:hover {
    background: var(--primary-dark);
    box-shadow: 0 3px 8px rgba(0, 174, 239, 0.35);
}

/* Results Counter */
.search-results-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #0098d1 100%);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 174, 239, 0.25);
    white-space: nowrap;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-results-counter .results-count {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.search-results-counter .results-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.search-results-counter.counter-update {
    animation: counterPulse 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes counterPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@media (max-width: 480px) {
    .search-results-counter {
        padding: 6px 12px;
    }

    .search-results-counter .results-count {
        font-size: 1rem;
    }

    .search-results-counter .results-label {
        font-size: 0.75rem;
    }
}

/* Year Groups (for year search mode) */
.year-group {
    margin-bottom: 32px;
}

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

.year-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #0098d1 100%);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 174, 239, 0.2);
}

.year-group-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    flex: 1;
}

.year-group-badge {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.year-group-age {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    font-style: italic;
}

.year-group-athletes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.year-group-athletes .athlete-card {
    margin-bottom: 0;
}

/* Clickable Badges */
.badge-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.badge-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    filter: brightness(1.1);
}

.badge-clickable:active {
    transform: translateY(0);
}

/* Event Modal */
.event-modal-overlay {
    z-index: 2000;
}

.event-modal-content {
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Event Modal Header */
.event-modal-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 24px;
}

.event-modal-header .close-modal-btn {
    position: absolute;
    top: 0;
    right: 0;
    flex-shrink: 0;
}

/* PDF Buttons Container */
.pdf-buttons-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.event-modal-tab {
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.event-modal-tab:hover {
    color: var(--primary);
    background: rgba(0, 174, 239, 0.05);
}

.event-modal-tab.active {
    color: var(--primary);
    background: rgba(0, 174, 239, 0.1);
}

.event-modal-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.section-card {
    animation: slideInUp 0.3s ease;
}

.section-card-clickable:hover > div {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 174, 239, 0.15);
    transform: translateY(-2px);
}

.btn-secondary {
    padding: 10px 16px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 174, 239, 0.05);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Disabled button styles */
button:disabled,
button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==================== OVERLAY / MODAL ==================== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.overlay-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

/* Event Modal: Reduced padding on mobile */
.event-modal-content {
    padding: 16px !important;
    max-width: 95vw;
}

@media (min-width: 641px) {
    .event-modal-content {
        padding: 24px !important;
        max-width: 900px;
    }
}

/* Stats Modal: Same responsive treatment */
.stats-modal-content {
    padding: 16px !important;
    max-width: 95vw;
}

@media (min-width: 641px) {
    .stats-modal-content {
        padding: 24px !important;
        max-width: 900px;
    }
}

/* Prevent horizontal scrolling on stats content */
#stats-content {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Prevent chart container from scrolling horizontally */
#stats-content > div {
    overflow-x: hidden;
}

/* Meldezeit label: Hide on mobile */
.meldezeit-label {
    display: inline;
}

@media (max-width: 640px) {
    .meldezeit-label {
        display: none;
    }
}

/* Swimmer table date display: Full date on desktop, compact on mobile */
.date-desktop {
    display: inline;
}

.date-mobile {
    display: none;
}

@media (max-width: 640px) {
    .date-desktop {
        display: none;
    }

    .date-mobile {
        display: inline;
    }

    /* Hide Lage column on mobile */
    .col-lage {
        display: none;
    }
}

/* Status badges: Full text on desktop, short badge on mobile */
.status-badge-full {
    display: inline;
}

.status-badge-short {
    display: none !important;
}

@media (max-width: 640px) {
    .status-badge-full {
        display: none !important;
    }

    .status-badge-short {
        display: inline-block !important;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stats specific styles */
.stat-item {
    background: var(--background);
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.stat-item h3 {
    margin: 0 0 8px 0 !important;
    font-size: 1rem !important;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-value {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.stat-improvement {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.stat-improvement.positive {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.stat-improvement.negative {
    background: rgba(244, 67, 54, 0.1);
    color: #F44336;
}

/* ==================== MENU ITEMS ==================== */
.menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 1rem;
    font-weight: 500;
}

.menu-item:hover {
    background: var(--background);
    color: var(--primary);
}

.menu-item.active {
    background: var(--info-light);
    color: var(--primary);
    font-weight: 600;
}

.menu-item svg {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.menu-item:hover svg,
.menu-item.active svg {
    color: var(--primary);
}

/* ==================== EVENT CARDS - TIMELINE MAGIC ==================== */

/* Base event card styling */
.event-card {
    position: relative;
    margin-bottom: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Upcoming events - vibrant and active */
.event-card.event-upcoming .event-year {
    color: var(--primary);
    text-shadow: 0 0 20px rgba(0, 174, 239, 0.3);
    transition: all 0.4s ease;
}

.event-card.event-upcoming .event-title {
    color: var(--text-primary);
}

/* Past events - elegant archived look */
.event-card.event-past {
    opacity: 0.75;
}

.event-card.event-past:hover {
    opacity: 0.9;
}

.event-card.event-past .card {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(0, 0, 0, 0.02) 100%);
    border-color: var(--border);
    position: relative;
    overflow: hidden;
}

.event-card.event-past .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--text-tertiary) 20%,
        var(--text-tertiary) 80%,
        transparent 100%);
    opacity: 0.2;
}

.event-card.event-past .event-year {
    color: var(--text-tertiary);
    opacity: 0.6;
    font-style: italic;
    position: relative;
}

.event-card.event-past .event-year::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text-tertiary);
    opacity: 0.3;
}

.event-card.event-past .event-title {
    color: var(--text-secondary);
}

/* Archived badge styling */
.badge-archived {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.badge-archived::before {
    content: '📦';
    margin-right: 4px;
    font-size: 0.7em;
}

.badge-archived::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.event-card.event-past:hover .badge-archived::after {
    left: 100%;
}

/* Hover effects */
.event-card.event-upcoming:hover {
    transform: translateX(8px);
}

.event-card.event-past:hover {
    transform: translateX(4px);
}

/* Archived stamp watermark */
.archived-stamp {
    position: absolute;
    top: 50%;
    right: 40px;
    transform: translateY(-50%) rotate(-15deg);
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-tertiary);
    opacity: 0.05;
    letter-spacing: 4px;
    pointer-events: none;
    user-select: none;
    z-index: 1;
    font-family: 'Impact', 'Arial Black', sans-serif;
    text-shadow:
        2px 2px 0 rgba(0,0,0,0.1),
        -2px -2px 0 rgba(255,255,255,0.1);
}

.event-card.event-past:hover .archived-stamp {
    opacity: 0.08;
    transform: translateY(-50%) rotate(-12deg) scale(1.05);
    transition: all 0.4s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .archived-stamp {
        font-size: 2rem;
        right: 20px;
    }
}



/* ==================== Event Card Optimizations ==================== */

/* Upcoming Event Card */
.upcoming-event-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all 0.2s;
}

.upcoming-event-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 174, 239, 0.1);
    transform: translateY(-2px);
}

/* Featured upcoming event card */
.upcoming-event-card-featured {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upcoming-event-card-featured:hover {
    border-color: var(--text-tertiary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.event-countdown-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--text-secondary);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 0 0 var(--radius-sm) 0;
    position: relative;
    top: -2px;
}

.event-countdown-badge.countdown-today {
    background: var(--error);
}

.event-countdown-badge.countdown-soon {
    background: #f59e0b;
}

.event-countdown-badge.countdown-upcoming {
    background: var(--text-secondary);
}

.youtube-broadcast-card .youtube-countdown-badge {
    background: var(--error) !important;
    color: white !important;
}

.upcoming-event-card-featured .event-meta-compact {
    margin-top: 10px;
}

.event-card-content {
    padding: 10px 14px 14px;
    position: relative;
}

.upcoming-event-card-featured .add-home-event-to-calendar-btn {
    width: 32px;
    height: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.upcoming-event-card-featured .add-home-event-to-calendar-btn svg {
    width: 16px;
    height: 16px;
}

.upcoming-event-card-featured .event-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
}

.event-name-large {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    flex: 1;
}

.event-description-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-alert-banner {
    position: relative;
    margin: 12px 14px;
    padding: 10px 12px 10px 32px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(234, 88, 12, 0.10));
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    color: #92400e;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
}

[data-theme="dark"] .event-alert-banner {
    color: var(--warning);
}

.alert-icon-badge {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: var(--warning);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-icon-badge svg {
    color: white;
}

.event-alert-banner span {
    display: block;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.event-meta-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.event-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--background);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.event-meta-chip svg {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

.event-meta-chip.event-location-link.clickable {
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.15s ease;
    margin-left: 6px;
}

.event-meta-chip.event-location-link.clickable:hover {
    background: var(--border);
}

.event-meta-chip.event-location-link.clickable svg {
    opacity: 0.8;
}

.event-meta-chip .location-label {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.event-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: 4px;
}

.event-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    flex: 1;
}

.add-home-event-to-calendar-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.add-home-event-to-calendar-btn:hover {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary);
}

.add-home-event-to-calendar-btn svg {
    width: 20px;
    height: 20px;
}

.event-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.event-detail-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.event-detail-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.event-badges {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xs);
    flex-wrap: wrap;
}

/* Event Meta Row - compact date/time/location display */
.event-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.event-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.event-meta-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.7;
}

.event-meta-text {
    white-space: nowrap;
}

/* Clickable location styling */
.event-location-link.clickable {
    cursor: pointer;
    padding: 2px 6px;
    margin: -2px -6px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.event-location-link.clickable:hover {
    background: rgba(0, 174, 239, 0.1);
    color: var(--primary);
}

/* ==================== NEXT EVENT HERO ==================== */
.next-event-hero-card {
    position: relative;
    margin-bottom: 24px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--surface) 0%, var(--background) 100%);
    border: 2px solid transparent;
}

.next-event-hero-card.hero-live {
    border-color: var(--error);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, var(--surface) 100%);
}

.next-event-hero-card.hero-upcoming {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(0, 174, 239, 0.1) 0%, var(--surface) 100%);
}

.hero-card-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, var(--primary) 0%, transparent 70%);
    opacity: 0.08;
    pointer-events: none;
}

.hero-live .hero-card-glow {
    background: radial-gradient(ellipse, var(--error) 0%, transparent 70%);
    opacity: 0.12;
    animation: hero-pulse 2s ease-in-out infinite;
}

@keyframes hero-pulse {
    0%, 100% { opacity: 0.08; }
    50% { opacity: 0.15; }
}

.hero-card-content {
    position: relative;
    padding: 20px;
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.hero-countdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.hero-countdown-live {
    background: var(--error);
    color: white;
    animation: countdown-glow 1.5s ease-in-out infinite;
}

@keyframes countdown-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.7); }
}

.hero-countdown-today {
    background: var(--error);
    color: white;
}

.hero-countdown-tomorrow {
    background: #f59e0b;
    color: white;
}

.hero-countdown-soon {
    background: var(--primary);
    color: white;
}

.hero-countdown-upcoming {
    background: var(--text-tertiary);
    color: white;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-event-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.hero-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hero-meta-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.hero-location-link.clickable {
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.hero-location-link.clickable:hover {
    background: rgba(0, 174, 239, 0.15);
}

.hero-location-link.clickable .location-text {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.hero-location-link.clickable svg {
    opacity: 1;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
}

.hero-btn svg {
    width: 16px;
    height: 16px;
}

.hero-btn-primary {
    background: var(--primary);
    color: white;
}

.hero-btn-primary:hover {
    background: var(--primary-dark, #0099cc);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 174, 239, 0.3);
}

.hero-live .hero-btn-primary {
    background: var(--error);
}

.hero-live .hero-btn-primary:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.hero-btn-secondary {
    background: rgba(0, 174, 239, 0.15);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.hero-btn-secondary:hover {
    background: rgba(0, 174, 239, 0.25);
}

.hero-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.hero-btn-ghost:hover {
    background: var(--surface);
    color: var(--text-primary);
}

/* Highlight pulse for scrolled-to card */
@keyframes highlight-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 174, 239, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(0, 174, 239, 0.2); }
    100% { box-shadow: 0 0 0 0 rgba(0, 174, 239, 0); }
}

.event-card.highlight-pulse .card {
    animation: highlight-pulse 0.6s ease-out 3;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .hero-card-content {
        padding: 16px;
    }

    .hero-event-name {
        font-size: 1.25rem;
    }

    .hero-meta {
        gap: 12px;
        font-size: 0.8125rem;
    }

    .hero-btn {
        padding: 8px 12px;
        font-size: 0.8125rem;
    }

    .hero-countdown {
        font-size: 0.7rem;
        padding: 3px 10px;
    }
}

.event-location-link.clickable .location-text {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.event-location-link.clickable:hover .location-text {
    text-decoration-style: solid;
}

.event-location-link.clickable .event-meta-icon {
    color: var(--primary);
    opacity: 1;
}

/* Event description ellipsis */
.event-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Small screens - more compact */
@media (max-width: 480px) {
    .event-meta-row {
        gap: 4px 8px;
        font-size: 0.8125rem;
    }

    .event-meta-icon {
        width: 12px;
        height: 12px;
    }

    /* Hide text labels on small screens, show only icons for location */
    .event-meta-item:not(.event-location-link) .event-meta-text {
        /* Keep visible */
    }
}

/* ==================== NOTIFICATIONS PAGE ==================== */

.notification-group {
    margin-bottom: var(--spacing-lg);
}

.notification-group-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: var(--spacing-sm) var(--spacing-md);
    letter-spacing: 0.5px;
}

.notification-card {
    display: flex;
    align-items: start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-sm);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.notification-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 174, 239, 0.1);
}

.notification-card.selected {
    background: rgba(0, 174, 239, 0.08);
    border-color: var(--primary);
}

.notification-card.unread {
    background: linear-gradient(to right, rgba(0, 174, 239, 0.05), var(--surface));
    border-left: 3px solid var(--primary);
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-body {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Checkbox styling - positioned right center */
.notification-checkbox {
    position: absolute;
    top: 50%;
    right: var(--spacing-md);
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.notification-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.notification-checkbox .checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-checkbox input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.notification-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.notification-checkbox:hover .checkbox-custom {
    border-color: var(--primary);
}

/* Action buttons in header */
.notification-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }

    .notification-actions {
        width: 100%;
        justify-content: space-between;
    }

    .btn-danger {
        width: 100%;
        justify-content: center;
        font-size: 0.8125rem;
        padding: 10px 16px;
    }
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 8px 16px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #c62828;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

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

.menu-badge {
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    background: var(--error);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

.header-notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--error);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: var(--radius-full);
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--surface);
}

.text-button {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s;
}

.text-button:hover {
    opacity: 0.8;
}

/* ==================== ATHLETE CARD HIGHLIGHT ==================== */

.athlete-card.highlighted {
    background: linear-gradient(to right, rgba(255, 193, 7, 0.15), var(--surface));
    border-left: 3px solid #ffc107;
    animation: pulse-highlight 2s ease-in-out infinite;
}

.favorite-btn.highlighted {
    color: #ffc107 !important;
    animation: pulse-star 1.5s ease-in-out infinite;
}

.favorite-btn.highlighted svg {
    filter: drop-shadow(0 0 4px rgba(255, 193, 7, 0.6));
}

@keyframes pulse-highlight {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
    50% {
        box-shadow: 0 0 8px 2px rgba(255, 193, 7, 0.3);
    }
}

@keyframes pulse-star {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* Event Card Title */
.event-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* PDF Buttons */
.event-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.event-pdf-btn:hover {
    background: var(--surface);
    color: var(--primary);
    border-color: var(--primary);
}

.event-pdf-btn:active {
    transform: scale(0.95);
}

.event-pdf-btn svg {
    flex-shrink: 0;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    /* Hide year badge on mobile */
    .upcoming-event-card .hide-mobile {
        display: none !important;
    }
    
    /* Compact event cards on mobile */
    .upcoming-event-card .card-body {
        padding: 12px !important;
    }
    
    /* Smaller title on very small screens */
    @media (max-width: 375px) {
        .event-card-title {
            font-size: 0.9375rem;
        }
        
        .event-pdf-btn {
            padding: 5px 8px;
            font-size: 0.6875rem;
        }
        
        .event-pdf-btn svg {
            width: 14px;
            height: 14px;
        }
    }
}

/* Tablet and up - show more details */
@media (min-width: 641px) {
    .event-card-title {
        font-size: 1.125rem;
    }
}

/* ==================== Mobile Search Optimizations ==================== */

/* Events Section Spacing */
.events-section {
    margin-bottom: 20px;
}

.events-section .section-header {
    margin-bottom: 8px;
}

.events-section .card {
    padding: 4px;
}

.events-section .event-card-title {
    font-size: 0.9375rem;
    margin-bottom: 4px;
}

/* Search Section Spacing */
.search-section {
    /* Reduce spacing when keyboard is active */
}

.search-section .search-header {
    margin-bottom: 12px;
}

/* Search Mode Container */
.search-mode-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-mode-tabs {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    /* Reduce spacing on mobile */
    .events-section {
        margin-bottom: 20px;
    }
    
    .events-section .section-header {
        margin-bottom: 12px;
    }
    
    .search-section .search-header {
        margin-bottom: 8px;
    }
    
    .search-mode-container {
        margin-bottom: 12px;
        gap: 12px;
    }
    
    /* Compact section title */
    .search-section .section-title {
        font-size: 1.125rem;
        margin: 0;
    }
    
    /* Search container - less margin */
    .search-container {
        margin-bottom: 16px;
    }
    
    /* When input is focused (keyboard active), reduce spacing even more */
    .search-input:focus ~ .search-results,
    .search-input:focus {
        /* Keyboard is active */
    }
}

/* Extra small screens - even more compact */
@media (max-width: 375px) {
    .events-section {
        margin-bottom: 16px;
    }
    
    .events-section .section-header {
        margin-bottom: 8px;
    }
    
    .search-section .search-header {
        margin-bottom: 6px;
    }
    
    .search-mode-container {
        margin-bottom: 8px;
    }
    
    .search-section .section-title {
        font-size: 1rem;
    }
    
    .search-container {
        margin-bottom: 12px;
    }
    
    /* Smaller mode tabs */
    .search-mode-tab {
        padding: 8px 12px;
        font-size: 0.8125rem;
    }
    
    .search-mode-tab svg {
        width: 16px;
        height: 16px;
        margin-right: 4px;
    }
}

/* Landscape mode on mobile - ultra compact */
@media (max-width: 640px) and (max-height: 500px) {
    .events-section {
        display: none; /* Hide events when keyboard is likely active */
    }

    .search-section .search-header {
        margin-bottom: 4px;
    }

    .search-mode-container {
        margin-bottom: 6px;
    }

    .search-container {
        margin-bottom: 8px;
    }

    .section-title {
        font-size: 0.9375rem;
    }
}

/* ==================== ATHLETE PAGE RESPONSIVE ==================== */

/* Athlete header layout - buttons left/right of avatar */
.athlete-header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 16px;
}

.athlete-action-left {
    margin-right: auto;
}

.athlete-action-right {
    margin-left: auto;
}

.athlete-info {
    text-align: center;
    width: 100%;
}

/* Athlete meta row - badges + stats button */
.athlete-meta-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.athlete-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.year-badge .year-short {
    display: none;
}

/* Compact Stats CTA Button */
.stats-cta-compact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border: 1px solid rgba(255, 165, 0, 0.8);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(255, 165, 0, 0.3);
}

.stats-cta-compact:hover {
    background: linear-gradient(135deg, #FFE44D 0%, #FFB732 100%);
    border-color: #FFA500;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.4);
}

.stats-cta-compact svg {
    width: 16px;
    height: 16px;
    stroke: #000;
}

.stats-cta-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #000;
}

.stats-label-short {
    display: none;
}

.stats-cta-badge {
    background: rgba(0, 0, 0, 0.2);
    color: #000;
    font-size: 0.5625rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1;
}

/* Mini Stats Button (next to Schwimmart) */
.stats-mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.1) 100%);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 10px;
    font-size: 0.65rem;
    color: #FFD700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stats-mini-btn svg {
    stroke: #FFD700;
}

.stats-mini-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.35) 0%, rgba(255, 165, 0, 0.2) 100%);
    border-color: rgba(255, 215, 0, 0.6);
    transform: scale(1.05);
}

/* Race card layout */
.race-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
}

.race-info {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.race-times {
    text-align: left;
    padding-top: 8px;
    border-top: 1px solid var(--divider);
}

/* Mobile optimizations for athlete page */
@media (max-width: 640px) {
    /* Compact header on mobile */
    .athlete-header-card {
        padding: 16px !important;
    }

    .athlete-header-content {
        margin-bottom: 12px;
    }

    .athlete-info h1 {
        font-size: 1.375rem !important;
        word-wrap: break-word;
    }

    .athlete-info p {
        font-size: 1rem !important;
        word-wrap: break-word;
    }

    /* Hide "Vergangen", DSV badge, gender badge, improvement labels, and disabled calendar buttons on mobile */
    .past-badge,
    .dsv-badge,
    .gender-badge,
    .improvement-label,
    .disabled-calendar-btn {
        display: none !important;
    }

    /* Show short year label on mobile */
    .year-badge .year-full {
        display: none !important;
    }
    .year-badge .year-short {
        display: inline !important;
    }

    /* Show short stats label on mobile */
    .stats-label-full,
    .stats-header-full {
        display: none !important;
    }
    .stats-label-short,
    .stats-header-short {
        display: inline !important;
    }

    /* Wrap race details on mobile */
    .race-details {
        flex-wrap: wrap !important;
    }

    .race-details span {
        word-break: break-word;
    }

    /* Smaller icon on mobile */
    .race-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.25rem !important;
    }

    /* Compact badges on mobile */
    .placement-full {
        display: none !important;
    }

    .placement-short {
        display: inline !important;
    }

    /* Hide record label text, keep trophy */
    .record-label {
        display: none !important;
    }

    /* Hide event badge on mobile - takes too much space */
    .event-badge {
        display: none !important;
    }
}

/* ==================== TOGGLE SWITCH ==================== */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    transition: all 0.3s ease;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 4px var(--info-light);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== FAVORITES PAGE - COMPACT SEARCH ==================== */

.compact-search-wrapper .list {
    max-height: 40vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
    margin-top: var(--spacing-md);
}

.compact-search-wrapper .list:empty {
    border: none;
}

.compact-search-wrapper .athlete-card {
    padding: var(--spacing-sm) var(--spacing-md);
    margin: 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    transition: background var(--transition-fast);
}

.compact-search-wrapper .athlete-card:hover {
    background: var(--surface-hover);
}

.compact-search-wrapper .athlete-card:last-child {
    border-bottom: none;
}

.compact-search-wrapper .section-title {
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
}

.compact-search-wrapper .search-results-counter {
    font-size: 0.75rem;
}

.compact-search-wrapper .empty-state {
    padding: var(--spacing-lg);
    border: none;
}

.compact-search-wrapper .empty-icon {
    width: 32px;
    height: 32px;
}

/* Favorites Section - Card Style */
.favorites-section .athlete-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.favorites-section .athlete-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.favorites-section .section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* ==================== ATHLETE PAGE - RACE CARDS ==================== */

/* Race card clickable cursor */
.race-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.race-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Race badges styling */
.race-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--divider);
}

/* Compact badges on all screens - save space */
.placement-badge .placement-full {
    display: none;
}

.placement-badge .placement-short {
    display: inline;
}

/* Hide ALL badges on mobile - all details shown in modal instead */
@media (max-width: 480px) {
    /* Hide entire badge container - no badges on mobile at all */
    .race-badges {
        display: none !important;
    }
}

/* On larger screens, show placement compact (P1, P2, etc) */
@media (min-width: 481px) {
    .placement-badge .placement-full {
        display: none;
    }

    .placement-badge .placement-short {
        display: inline;
    }
}

/* ==================== CHRONOLOGICAL RACE LIST (Trainer View) ==================== */

.chrono-race-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chrono-race-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.chrono-race-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.chrono-race-card.past {
    opacity: 0.6;
    background: var(--background);
}

/* Header row: Date | Time | WK/L/B */
.chrono-race-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.chrono-date {
    font-weight: 600;
    color: var(--text-primary);
}

.chrono-time {
    color: var(--primary);
    font-weight: 600;
}

.chrono-wk-info {
    margin-left: auto;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
    background: var(--background);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
}

/* Event name row */
.chrono-event-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Main row: Icon + Race name */
.chrono-race-main {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.chrono-stroke-icon {
    font-size: 1.25rem;
}

.chrono-race-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

/* Times row: Melde | Proto | Delta */
.chrono-race-times {
    display: flex;
    gap: 16px;
    padding-top: 8px;
    border-top: 1px solid var(--divider);
}

.chrono-time-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
}

.chrono-time-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.chrono-time-value {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chrono-time-value.result {
    color: var(--success);
    font-size: 0.875rem;
}

.chrono-time-value.improved {
    color: var(--success);
}

.chrono-time-value.slower {
    color: var(--error);
}

/* Responsive: even more compact on very small screens */
@media (max-width: 360px) {
    .chrono-race-header {
        font-size: 0.7rem;
        gap: 8px;
    }

    .chrono-race-times {
        gap: 10px;
    }

    .chrono-time-value {
        font-size: 0.75rem;
    }
}

/* ==================== PROFILE PAGE RESPONSIVE ==================== */

@media (max-width: 640px) {
    /* Notification status box: wrap button to new line on mobile */
    .notification-status-box {
        justify-content: center !important;
    }

    .notification-status-box > div:first-child {
        width: 100%;
        justify-content: center;
    }

    .notification-status-box button {
        width: 100%;
        justify-content: center;
    }

    .compact-search-wrapper .list {
        max-height: 30vh;
    }
}

/* ==================== PDF LINKS ==================== */

.pdf-link:hover {
    background: var(--background) !important;
    border-color: var(--primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pdf-link:active {
    transform: translateY(0);
}

.pdf-section h3 {
    font-weight: 600;
}

.pdf-section h4 {
    font-weight: 500;
}

/* PDF badge hover effect */
.badge[href]:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* ==================== SECTION TITLE RESPONSIVE ==================== */

/* Desktop: Show full text */
.section-title-mobile {
    display: none;
}

.section-title-desktop {
    display: inline;
}

/* Mobile: Show abbreviated text */
@media (max-width: 640px) {
    .section-title-mobile {
        display: inline;
    }

    .section-title-desktop {
        display: none;
    }
}

/* ==================== PDF INFO DIALOG ==================== */

.pdf-info-dialog {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pdf-info-dialog.visible {
    opacity: 1;
}

.pdf-info-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.pdf-info-dialog-content {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    max-width: 90vw;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.pdf-info-dialog.visible .pdf-info-dialog-content {
    transform: scale(1);
}

.pdf-info-dialog-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.pdf-info-dialog-close {
    margin-left: auto;
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.pdf-info-dialog-close:hover {
    background: var(--border);
    color: var(--text-primary);
}

.pdf-info-dialog-body {
    padding: 16px;
}

.pdf-info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.pdf-info-row:last-child {
    border-bottom: none;
}

.pdf-info-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pdf-info-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    word-break: break-all;
    max-width: 60%;
}

.pdf-info-date {
    color: var(--primary);
    font-weight: 600;
}

.pdf-info-dialog-footer {
    padding: 12px 16px;
    background: var(--background);
    border-top: 1px solid var(--border);
}

.pdf-info-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pdf-info-open-btn:hover {
    background: var(--primary-dark, #0097d4);
    transform: translateY(-1px);
}

/* PDF WK Badge with Notification-Style Info Button */
.pdf-wk-badge-wrapper {
    position: relative;
}

.pdf-info-notification {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    padding: 0;
    background: var(--text-secondary);
    color: white;
    border: 2px solid var(--surface);
    border-radius: 50%;
    font-size: 0.625rem;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    opacity: 0.7;
}

.pdf-info-notification:hover {
    background: var(--primary);
    opacity: 1;
    transform: scale(1.1);
}

.pdf-wk-badge-wrapper:hover .pdf-info-notification {
    opacity: 1;
}

/* PDF Sort Toggle Button */
.pdf-sort-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}


/* ==================== FEATURED BADGE RESPONSIVE ==================== */

@media (max-width: 640px) {
    .featured-badge {
        display: none !important;
    }
}

/* ==================== SELFIE BUTTON ANIMATED ==================== */

.selfie-btn-animated {
    position: relative;
    margin-left: auto;
    padding: 8px 14px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
    transition: all 0.3s ease;
    overflow: visible;
}

.selfie-btn-animated:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
}

.selfie-btn-animated:active {
    transform: translateY(0) scale(0.98);
}

.selfie-icon {
    width: 20px;
    height: 20px;
    animation: selfie-pulse 2s ease-in-out infinite;
}

@keyframes selfie-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.selfie-text {
    letter-spacing: 0.5px;
}

.selfie-new-badge,
.poll-new-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 2px 6px;
    background: var(--error);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 8px;
    letter-spacing: 0.5px;
    animation: new-badge-bounce 1s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(255, 61, 113, 0.5);
}

.poll-new-badge {
    top: -8px;
    right: 8px;
    z-index: 10;
}

@keyframes new-badge-bounce {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-3px) rotate(5deg);
    }
}

