/* ========================================
   SHARED STYLES - GuitarComp
   Common styles for all pages
   ======================================== */

/* Reset & CSS Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #8B4513;
    --primary-dark: #5D2E0C;
    --primary-light: #D4A574;
    --accent: #C9A227;
    --bg-cream: #FDF8F3;
    --bg-warm: #FAF5F0;
    --bg-light: #F5F0EB;
    --bg-dark: #2C1810;
    --text: #1a1a1a;
    --text-dark: #1a1a1a;
    --text-muted: #595959; /* Improved contrast: was #666, now meets WCAG AA */
    --border: #e0d5c9;
    --success: #2E7D32;
    --warning: #F57C00;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --focus-ring: 0 0 0 3px rgba(201, 162, 39, 0.5);
}

/* ========================================
   ACCESSIBILITY - Skip Navigation
   ======================================== */
.skip-link {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--bg-dark);
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    text-decoration: none;
    z-index: 10000;
    transition: top 0.2s;
    opacity: 0;
    pointer-events: none;
}

.skip-link:focus {
    top: 0;
    opacity: 1;
    pointer-events: auto;
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ========================================
   ACCESSIBILITY - Focus Indicators
   ======================================== */
/* Global focus style for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* Remove default outline when using focus-visible */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
    outline: none;
}

/* Enhanced focus for buttons */
.btn:focus-visible,
.match-btn:focus-visible,
.clear-btn:focus-visible,
.event-filter-btn:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    box-shadow: var(--focus-ring);
}

/* Enhanced focus for nav links */
nav a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Enhanced focus for cards (when focusable) */
.competition-card:focus-visible,
.unlock-card:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(201, 162, 39, 0.2);
}

/* Enhanced focus for form inputs */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
}

/* Focus indicator for hamburger menu */
.hamburger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Focus indicator for modal close button */
.modal-content .close:focus-visible,
.day-modal-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Focus for remove buttons */
.remove-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 50%;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   HEADER
   ======================================== */
header {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: inline-block;
    width: 210px;
    height: 42px;
    background: url(images/guitarcomp-logo.png) left center / contain no-repeat;
    text-decoration: none;
    text-indent: -9999px;
    white-space: nowrap;
    overflow: hidden;
}

/* ========================================
   NAVIGATION
   ======================================== */
nav {
    display: flex;
    gap: 2rem;
}

nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover,
nav a.active {
    color: var(--accent);
}

/* ========================================
   HAMBURGER MENU
   ======================================== */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    z-index: 10000;
    background: transparent;
    border: none;
}

.hamburger span {
    width: 28px;
    height: 3px;
    background: white;
    margin: 3px 0;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9998;
}

.nav-overlay.active {
    display: block;
}

/* ========================================
   PAGE HEADER — shared page-title band.
   One typographic scale for every page top; on body.mk-theme pages
   the theme swaps the face to Cormorant (body.mk-theme h1 outranks
   .page-header h1 by design — do not raise specificity here).
   ======================================== */
.page-header {
    margin-bottom: 1.5rem;
    text-align: left;
}

.page-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 0 0.35rem;
}

.page-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 1rem;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    background: var(--bg-dark);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    margin-top: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: clamp(1rem, 3vw, 1.5rem);
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--accent);
    text-decoration: none;
    padding: 0.5rem;
}

footer p {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

/* ========================================
   COMMON UTILITIES
   ======================================== */
.hidden {
    display: none !important;
}

/* Mobile auth links - hidden on desktop, shown in mobile hamburger menu */
.mobile-auth-links {
    display: none;
}

/* ========================================
   RESPONSIVE - MOBILE (767px)
   ======================================== */
@media (max-width: 767px) {
    header {
        padding: 0.75rem 1rem;
    }

    .logo {
        width: 165px;
        height: 33px;
    }

    .hamburger {
        display: flex;
    }

    nav {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        background: linear-gradient(180deg, var(--bg-dark) 0%, var(--primary-dark) 100%);
        flex-direction: column;
        padding: 100px 2rem 2rem;
        gap: 0;
        transition: right 0.3s ease;
        z-index: 9999;
        box-shadow: -10px 0 30px rgba(0,0,0,0.3);
    }

    nav.active {
        right: 0;
    }

    nav a {
        padding: 1.25rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        font-size: 1.15rem;
    }

    /* Mobile auth links in hamburger menu */
    .mobile-auth-links {
        display: block;
        margin-top: auto;
        padding-top: 1rem;
    }

    .mobile-auth-divider {
        border: none;
        border-top: 1px solid rgba(255,255,255,0.2);
        margin: 0 0 1rem 0;
    }

    .mobile-auth-link {
        display: block;
        padding: 1rem 0;
        color: white;
        text-decoration: none;
        font-size: 1rem;
        font-weight: 500;
        text-align: center;
        border-radius: 8px;
        margin-bottom: 0.5rem;
        transition: background 0.2s;
    }

    .mobile-auth-link:hover {
        background: rgba(255,255,255,0.1);
    }

    .mobile-auth-signup {
        background: var(--accent);
        color: var(--bg-dark);
    }

    .mobile-auth-signup:hover {
        background: var(--accent-light);
    }
}

/* ========================================
   RESPONSIVE - SMALL MOBILE (479px)
   ======================================== */
@media (max-width: 479px) {
    .logo {
        font-size: 1.15rem;
    }
}

/* ========================================
   RESPONSIVE - EXTRA SMALL (359px)
   ======================================== */
@media (max-width: 359px) {
    .logo {
        font-size: 1rem;
    }

    nav {
        width: 100%;
        max-width: 100%;
    }
}

/* ========================================
   TOUCH DEVICES - Minimum Tap Target Sizes
   Per WCAG 2.5.5, minimum tap target should be 44x44px
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* Buttons */
    .btn,
    button {
        min-height: 44px;
    }

    /* Links that act as buttons */
    a.btn,
    .auth-buttons a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Navigation links */
    nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Modal close buttons */
    .modal-content .close,
    .day-modal-close,
    [aria-label*="Close"],
    [aria-label*="close"] {
        min-width: 44px;
        min-height: 44px;
    }

    /* Form inputs */
    input,
    select,
    textarea {
        min-height: 44px;
    }

    /* User dropdown button */
    .btn-user {
        min-height: 44px;
    }

    /* Icon buttons */
    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }

    /* Checkboxes and radio buttons - increase touch area */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 24px;
        min-height: 24px;
    }

    /* Pagination buttons */
    .pagination button {
        min-width: 44px;
        min-height: 44px;
    }

    /* Tab buttons */
    .view-btn,
    .admin-tab {
        min-height: 44px;
    }

    /* Competition card action buttons */
    .card-actions button,
    .card-actions a {
        min-height: 44px;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ========================================
   ERROR REPORT MODAL
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none; /* Hidden by default, JS sets to flex when opening */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    font-family: 'Playfair Display', serif;
}

.modal-content > p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.modal-content .close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0.25rem;
    transition: color 0.2s;
    /* Button reset for accessibility */
    background: none;
    border: none;
    font-family: inherit;
}

.modal-content .close:hover {
    color: var(--text-dark);
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-content label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: -0.5rem;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.modal-content textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-content button[type="submit"] {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    margin-top: 0.5rem;
}

.modal-content button[type="submit"]:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.modal-content button[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Success state */
#report-success {
    text-align: center;
    padding: 2rem 1rem;
}

#report-success .success-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

#report-success p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

#report-success .success-note {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Save Competition Button */
.btn-save-competition {
    background: transparent;
    border: 1px solid #ddd;
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save-competition:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(139, 90, 43, 0.05);
}

.btn-save-competition.saved {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-save-competition.saved:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-save-competition.loading {
    opacity: 0.6;
    pointer-events: none;
    cursor: wait;
}

/* Report Error Button */
.btn-report-error {
    background: transparent;
    border: 1px solid #ddd;
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-report-error:hover {
    border-color: var(--warning);
    color: var(--warning);
    background: rgba(245, 124, 0, 0.05);
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .modal-content {
        padding: 1.5rem;
        margin: 0.5rem;
    }

    .modal-content h2 {
        font-size: 1.25rem;
        padding-right: 2rem;
    }
}

/* ========================================
   INDEX PAGE - MAIN APPLICATION STYLES
   ======================================== */

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* User Dropdown (when logged in) */
.user-dropdown {
    position: relative;
}

.btn-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-user:hover {
    background: rgba(255,255,255,0.2);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.user-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1001;
    overflow: hidden;
}

.user-dropdown-menu.show {
    display: block;
}

.user-dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.user-dropdown-menu a:hover {
    background: var(--bg-cream);
}

.user-dropdown-menu hr {
    margin: 0.25rem 0;
    border: none;
    border-top: 1px solid #eee;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
}

.header-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
}

.header-stats span {
    color: var(--accent);
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: #dbb32e;
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: var(--bg-cream);
}

/* Main Layout */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
}

/* Sidebar */
.sidebar {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    height: fit-content;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

.sidebar h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Search Tip */
.search-tip {
    background: #f5f0eb;
    border-left: 3px solid var(--primary);
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-radius: 0 6px 6px 0;
}

.search-tip strong {
    color: var(--text);
}

/* Repertoire Input */
.repertoire-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    overflow: visible;
}

.repertoire-input input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #e0d5c9;
    border-radius: 8px;
    font-size: 0.95rem;
}

.repertoire-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.repertoire-input button {
    padding: 0.8rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.repertoire-input button:hover {
    background: var(--primary-dark);
}

/* Search Suggestions Dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
}

.search-suggestions.hidden {
    display: none;
}

/* Ensure sidebar doesn't clip suggestions when dropdown is visible */
.sidebar.suggestions-open {
    overflow: visible !important;
}

.search-suggestions-header {
    padding: 0.5rem 0.75rem;
    background: var(--bg-warm);
    border-bottom: 1px solid #e0d5c9;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.search-suggestion-item {
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0ebe4;
    transition: background 0.15s;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
    background: var(--bg-warm);
}

.search-suggestion-item .title {
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

.search-suggestion-item .composer {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.search-suggestion-item .meta {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

.search-suggestion-item .meta .period {
    background: var(--primary);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.search-suggestion-item .meta .duration {
    color: var(--text-muted);
}

.input-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.input-row select {
    padding: 0.6rem;
    border: 2px solid #e0d5c9;
    border-radius: 8px;
    background: white;
    flex: 1;
}

.input-row input[type="number"] {
    width: 70px;
    padding: 0.6rem;
    border: 2px solid #e0d5c9;
    border-radius: 8px;
    text-align: center;
}

.piece-error {
    font-size: 0.8rem;
    color: #c62828;
    background: rgba(198, 40, 40, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.input-error {
    border-color: #c62828 !important;
    background: rgba(198, 40, 40, 0.05) !important;
}

.duration-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

/* Piece List */
.piece-list {
    list-style: none;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    max-height: 280px;
    overflow-y: auto;
}

.piece-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-cream);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--accent);
}

.piece-info {
    display: flex;
    flex-direction: column;
}

.piece-title {
    font-weight: 500;
    font-size: 0.95rem;
}

.piece-composer {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.piece-meta {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.3rem;
    align-items: center;
}

.tag {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.tag.bach { background: #e3f2fd; color: #1565c0; }       /* Bach (displays as Baroque) */
.tag.baroque { background: #fef3c7; color: #d97706; }    /* Baroque era */
.tag.renaissance { background: #e0e7ff; color: #4f46e5; } /* Renaissance era */
.tag.contemporary { background: #f3e5f5; color: #7b1fa2; }
.tag.spanish { background: #fff3e0; color: #e65100; }
.tag.concerto { background: #e8f5e9; color: #2e7d32; }
.tag.romantic { background: #fce4ec; color: #c2185b; }
.tag.classical { background: #fff8e1; color: #f57f17; }
.tag.general { background: #eceff1; color: #546e7a; }

.piece-duration {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}

.remove-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.3rem;
    padding: 0.25rem;
    line-height: 1;
}

.remove-btn:hover {
    color: #c62828;
}

/* Event Type Filter */
.event-filter-section {
    border-bottom: 1px solid #e0d5c9;
    padding-bottom: 1.25rem;
    margin-bottom: 0.75rem;
}

.event-filter-section h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.event-filter-options {
    display: flex;
    gap: 0.5rem;
}

.event-filter-btn {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 2px solid #e0d5c9;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    text-align: center;
}

.event-filter-btn:hover {
    border-color: var(--primary-light);
    background: var(--bg-cream);
}

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

.event-filter-btn .filter-icon {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

/* Profile Section */
.profile-section {
    border-top: 1px solid #e0d5c9;
    padding-top: 1.25rem;
    margin-top: 1.25rem;
}

.profile-section h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-field.full-width {
    grid-column: 1 / -1;
}

.profile-field label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.profile-field input,
.profile-field select {
    padding: 0.5rem;
    border: 1px solid #e0d5c9;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Filter Mode Banner (shown when viewing selected pieces from profile) */
.filter-mode-banner {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 2px solid #1976d2;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.filter-mode-content p {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #1565c0;
}

.filter-mode-content p:first-child {
    font-size: 1rem;
    color: #0d47a1;
}

.filter-mode-profile {
    font-size: 0.8rem !important;
    color: #2e7d32 !important;
    background: rgba(46, 125, 50, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.exit-filter-btn {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #1976d2;
    border-radius: 6px;
    color: #1976d2;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.exit-filter-btn:hover {
    background: #1976d2;
    color: white;
}

/* Repertoire Stats */
.repertoire-stats {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
}

.stat-row .check {
    color: #81c784;
}

.stat-row .missing {
    color: #ffab91;
}

.total-time {
    text-align: center;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 1.1rem;
}

.total-time strong {
    color: var(--accent);
    font-size: 1.3rem;
}

/* Match Button */
.match-btn {
    width: 100%;
    padding: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--accent) 0%, #b8941f 100%);
    color: var(--bg-dark);
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.match-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(201, 162, 39, 0.4);
}

.match-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.clear-btn {
    width: 100%;
    padding: 0.6rem;
    background: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
}

.clear-btn:hover {
    border-color: #c62828;
    color: #c62828;
}

/* Suggestions */
.suggestions-section {
    background: var(--bg-cream);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid #e0d5c9;
}

.suggestions-header {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestion-group {
    margin-bottom: 0.75rem;
}

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

.suggestion-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.suggestion-tag {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-tag:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.suggestion-tag .dur {
    font-size: 0.65rem;
    opacity: 0.7;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Welcome State */
.welcome-state {
    background: white;
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.welcome-state h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.welcome-state p {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 2rem;
}

.welcome-steps {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.step {
    text-align: center;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0 auto 0.75rem;
}

.step-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 120px;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.stat-card {
    background: white;
    padding: 1rem 0.75rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    text-align: center;
    min-width: 0;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
    line-height: 1.2;
    word-break: break-word;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: 0.25rem;
}

/* Selection Indicator (shown when matching uses selected pieces) */
.selection-indicator {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.selection-indicator .selection-icon {
    font-size: 1.25rem;
}

.selection-indicator .selection-text {
    flex: 1;
    font-size: 0.9rem;
    color: #1565c0;
}

.selection-indicator .selection-link {
    color: #1565c0;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
}

.selection-indicator .selection-link:hover {
    text-decoration: underline;
}

/* Exit Filter Mode Button */
.exit-filter-btn {
    margin-left: auto;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    background: #fff;
    border: 1px solid #1565c0;
    color: #1565c0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.exit-filter-btn:hover {
    background: #1565c0;
    color: #fff;
}

/* Session Filter Mode Styles */
body.session-filter-active .sidebar h2.filter-mode {
    color: #1565c0;
    position: relative;
}

body.session-filter-active .sidebar h2.filter-mode::after {
    content: '(temporary)';
    font-size: 0.7rem;
    font-weight: normal;
    margin-left: 0.5rem;
    color: #64b5f6;
}

.piece-item.filter-mode {
    border-left: 3px solid #1976d2;
    background: linear-gradient(90deg, rgba(25, 118, 210, 0.05) 0%, transparent 100%);
}

.piece-item.filter-mode .remove-btn {
    color: #1976d2;
}

.piece-item.filter-mode .remove-btn:hover {
    background: #e3f2fd;
}

/* Deadline Alert */
.deadline-alert {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 1px solid #ffcc80;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.deadline-icon {
    font-size: 2rem;
}

.deadline-text {
    flex: 1;
}

.deadline-text h4 {
    color: var(--warning);
    margin-bottom: 0.25rem;
}

.deadline-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Unlock Section */
.unlock-section {
    background: white;
    border-radius: 16px;
    padding: 1.25rem 1.5rem 1.5rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 0.75rem;
}

.unlock-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    margin-bottom: 0.35rem;
}

.unlock-section > p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

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

.unlock-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-cream);
    border-radius: 10px;
    border: 1px solid #e0d5c9;
    cursor: pointer;
    transition: all 0.2s;
}

.unlock-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.unlock-icon {
    font-size: 1.5rem;
}

.unlock-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.unlock-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.unlock-benefit {
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 500;
    margin-top: 0.25rem;
    display: block;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

.section-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
}

.section-count {
    background: var(--primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.section-count.success { background: var(--success); }
.section-count.warning { background: var(--warning); }
.section-count.stretch { background: linear-gradient(135deg, #ec407a 0%, #d81b60 100%); }

/* Competition Grid */
.competition-grid {
    display: grid;
    /* Use min() to prevent overflow on screens smaller than 380px */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
    gap: 1.5rem;
}

/* Competition Card */
.competition-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s;
}

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

/* Tier Badges */
.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tier-badge.elite {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #5d4037;
}

.tier-badge.professional {
    background: linear-gradient(135deg, #7c4dff 0%, #651fff 100%);
    color: white;
}

.tier-badge.emerging {
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
    color: white;
}

.tier-badge.accessible {
    background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
    color: white;
}

.tier-badge.youth {
    background: linear-gradient(135deg, #ff7043 0%, #f4511e 100%);
    color: white;
}

.tier-badge.stretch {
    background: linear-gradient(135deg, #ec407a 0%, #d81b60 100%);
    color: white;
}

/* Distance Badge */
.distance-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: var(--bg-cream);
    border-radius: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.distance-badge.nearby {
    background: #e8f5e9;
    color: var(--success);
}

/* Card Header Meta */
.card-header-meta {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.card-header {
    background: linear-gradient(135deg, var(--success) 0%, #1b5e20 100%);
    color: white;
    padding: 1.25rem;
}

.card-header.partial {
    background: linear-gradient(135deg, var(--warning) 0%, #e65100 100%);
}

.card-header.explore {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.card-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.card-location {
    font-size: 0.9rem;
    opacity: 0.9;
}

.card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Match Indicator */
.match-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-cream);
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.match-circle {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: white;
    background: var(--success);
}

.match-circle.partial {
    background: var(--warning);
}

.match-text {
    flex: 1;
}

.match-title {
    font-weight: 600;
    font-size: 0.95rem;
}

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

/* Round Times */
.round-times {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.round-times h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.rounds-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
}

.round-row {
    display: flex;
    gap: 0.5rem;
}

.round-label {
    font-weight: 600;
    color: var(--primary);
    min-width: 45px;
}

.round-value {
    color: var(--text-dark);
}

/* Card Details */
.card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.detail-item {
    font-size: 0.9rem;
}

.detail-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.detail-value {
    font-weight: 500;
}

.detail-value.prize {
    color: var(--accent);
}

/* Requirements */
.required-pieces {
    background: var(--bg-cream);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.required-pieces h4 {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.required-list {
    list-style: none;
    font-size: 0.9rem;
}

.required-list li {
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.required-list .check {
    color: var(--success);
    font-weight: bold;
}

.required-list .missing {
    color: #c62828;
    font-weight: bold;
}

/* Match Pieces Checkboxes */
.match-pieces-list li {
    padding: 0.4rem 0.5rem;
    margin: 0.25rem 0;
    border-radius: 6px;
    transition: background 0.2s;
}

.match-pieces-list li:hover {
    background: rgba(139, 69, 19, 0.08);
}

.match-piece-item.selected {
    background: #e8f5e9;
}

.match-piece-item.selected label span {
    font-weight: 500;
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid #eee;
}

.card-actions .btn {
    flex: 1;
    text-align: center;
}

/* Suggestions Box for Partial Matches */
.suggestions-box {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border: 1px solid #ffd54f;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.suggestions-box h4 {
    font-size: 0.85rem;
    color: var(--warning);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestion-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
}

.suggestion-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.suggestion-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.suggestion-content {
    flex: 1;
}

.suggestion-need {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.suggestion-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.suggestion-piece {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-piece:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.suggestion-piece .dur {
    color: var(--text-muted);
    font-size: 0.65rem;
}

.suggestion-piece:hover .dur {
    color: rgba(255,255,255,0.8);
}

/* ========================================
   ROUND-BY-ROUND MATCHING DISPLAY
   ======================================== */
.round-matches {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.round-matches h4 {
    font-size: 0.95rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.round-status {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid #ddd;
}

.round-status.qualified {
    border-left-color: var(--success);
    background: #f0fff0;
}

.round-status.not-qualified {
    border-left-color: var(--warning);
    background: #fff8f0;
}

.round-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.round-name {
    font-weight: 600;
    color: var(--text-dark);
}

.round-score {
    font-size: 0.85rem;
    font-weight: 500;
}

.round-score.pass {
    color: var(--success);
}

.round-score.fail {
    color: var(--warning);
}

.round-duration {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.round-duration.duration-ok {
    color: var(--success);
    font-weight: 500;
}

.round-duration.duration-warning {
    color: var(--warning);
    font-weight: 500;
    background: rgba(245, 124, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.round-score.warning {
    color: var(--warning);
}

.age-warning {
    background: rgba(245, 124, 0, 0.15);
    border-left: 3px solid var(--warning);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.85rem;
}

.national-only-warning {
    background: rgba(66, 133, 244, 0.12);
    border-left: 3px solid #4285f4;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.85rem;
    color: #1a5bb8;
}

/* Outside travel preference warning */
.outside-travel-warning {
    background: rgba(255, 152, 0, 0.12);
    border-left: 3px solid #ff9800;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.85rem;
    color: #e65100;
}

/* Travel preference separator */
.travel-separator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    grid-column: 1 / -1;
    width: 100%;
}

.travel-separator-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, transparent, #ff9800, transparent);
}

.travel-separator-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e65100;
    background: var(--bg-cream);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 2px solid #ff9800;
    white-space: nowrap;
}

/* Outside travel preference card styling */
.competition-card.outside-travel-preference {
    opacity: 0.85;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.competition-card.outside-travel-preference:hover {
    opacity: 1;
}

/* Travel warning badge in card header */
.travel-warning-badge {
    margin-left: 0.5rem;
    font-size: 0.9rem;
    cursor: help;
}

/* Age limit badges */
.age-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.age-badge {
    display: inline-block;
    background: #f0f4f8;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
    color: var(--text-dark);
}

.round-matched, .round-missing {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.round-matched ul, .round-missing ul {
    margin: 0.25rem 0 0 1.25rem;
    padding: 0;
}

.round-matched li {
    color: var(--success);
}

.round-missing li {
    color: var(--warning);
}

.req-type {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.round-program-note {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f0f4f8;
    border-radius: 6px;
    border-left: 3px solid var(--primary-light);
}

.round-program-note small {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Round summary in match indicator */
.round-summary {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* ========================================
   INDEX PAGE RESPONSIVE
   ======================================== */

/* Tablet (1024px) */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 300px 1fr;
        gap: 1.5rem;
        padding: 1rem;
    }
    .header-stats { display: none; }
}

/* Desktop/Laptop (1000px) */
@media (max-width: 1000px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        top: 0;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 0.875rem 0.5rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

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

    .welcome-steps {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* Mobile (768px) - Stack layout */
@media (max-width: 767px) {
    .auth-buttons { display: none; }

    .main-container {
        display: flex;
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .sidebar {
        position: relative;
        top: 0;
        width: 100%;
        max-height: none;
        order: 1;
    }

    /* Mobile stacking order: hero (welcome / how-to) on TOP, then the repertoire +
       filters block, then results. display:contents flattens .main-content so its
       children join the .main-container column flow and can be ordered individually.
       Desktop (the grid above) is untouched. */
    .main-content { display: contents; }
    #welcomeState { order: 0; }
    #featuredState { order: 2; }
    #resultsContainer { order: 2; }

    .card-header { padding: 1rem; }
    .card-header h3 { font-size: 1.1rem; }
    .card-body { padding: 1rem; }
    .card-details { grid-template-columns: 1fr 1fr; gap: 0.75rem; }

    .match-indicator {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .match-circle { width: 70px; height: 70px; font-size: 1.1rem; }

    .btn {
        width: 100%;
        text-align: center;
        padding: 0.875rem;
        min-height: 48px;
    }

    .quick-add-grid { grid-template-columns: repeat(2, 1fr); }

    .round-status { padding: 0.75rem; }
    .round-header { flex-direction: column; align-items: flex-start; gap: 0.25rem; }

    .filter-group select, .filter-group input {
        width: 100%;
        padding: 0.75rem;
        font-size: 16px;
    }
}

/* Small Mobile and below */
@media (max-width: 600px) {
    .header-stats {
        display: none;
    }

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

    .round-status {
        padding: 0.6rem;
    }

    .round-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .stats-bar {
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.75rem 0.5rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    .unlock-section {
        padding: 1rem;
    }

    .unlock-section h2 {
        font-size: 1.1rem;
    }

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

    .section-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }
}

/* Small Mobile (480px) */
@media (max-width: 479px) {
    .main-container { padding: 0.75rem; }
    .sidebar { padding: 0.875rem; }
    .card-details { grid-template-columns: 1fr; }
    .tier-badge { font-size: 0.7rem; padding: 0.2rem 0.5rem; }
    .quick-add-grid { grid-template-columns: 1fr; }
    .piece-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

/* Extra Small (360px) */
@media (max-width: 359px) {
    .match-circle { width: 60px; height: 60px; font-size: 1rem; }
}

/* ========================================
   FOOTER STYLES
   ======================================== */
.site-footer {
    background: var(--bg-dark);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    margin-top: 2rem;
}

.site-footer .footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.site-footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.site-footer .footer-links a {
    color: var(--accent);
    text-decoration: none;
}

.site-footer .footer-copyright {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.section-description {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.honeypot {
    position: absolute;
    left: -9999px;
}

.success-message {
    display: none;
}

/* ========================================
   DURATION STATUS STYLES
   ======================================== */
.round-duration {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    margin: 0.5rem 0;
}

.round-duration.duration-met {
    background: rgba(46, 125, 50, 0.1);
    color: var(--success);
    border-left: 3px solid var(--success);
}

.round-duration.duration-close {
    background: rgba(245, 124, 0, 0.1);
    color: var(--warning);
    border-left: 3px solid var(--warning);
}

.round-duration.duration-insufficient {
    background: rgba(211, 47, 47, 0.1);
    color: #D32F2F;
    border-left: 3px solid #D32F2F;
}

/* Backward compatibility */
.round-duration.duration-ok {
    background: rgba(46, 125, 50, 0.1);
    color: var(--success);
    border-left: 3px solid var(--success);
}

.round-duration.duration-warning {
    background: rgba(211, 47, 47, 0.1);
    color: #D32F2F;
    border-left: 3px solid #D32F2F;
}

/* ========================================
   AGE INELIGIBLE SECTION STYLES
   ======================================== */
.age-ineligible-header h2 {
    color: #666;
}

.section-count.age-ineligible {
    background: #666;
    color: white;
}

.competition-card.age-ineligible-card {
    opacity: 0.7;
    border: 1px dashed #999;
}

.competition-card.age-ineligible-card:hover {
    opacity: 0.85;
}

.card-header.age-ineligible {
    background: linear-gradient(135deg, #666 0%, #888 100%);
}

.age-warning.prominent {
    background: rgba(211, 47, 47, 0.1);
    color: #D32F2F;
    border: 1px solid rgba(211, 47, 47, 0.3);
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 500;
}

/* ===========================================
   ADSENSE STYLES
   =========================================== */

/* Container for all ads */
.ad-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 1.25rem 0;
}

/* Placeholder visual (remove when real ads are live) */
.ad-placeholder-visual {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.ad-placeholder-visual span {
    font-weight: 600;
    color: #666;
}

.ad-placeholder-visual small {
    font-size: 0.75rem;
    color: #aaa;
}

/* When real AdSense loads, hide placeholder */
.adsbygoogle[data-ad-status="filled"] + .ad-placeholder-visual {
    display: none;
}

/* ===========================================
   AD POSITIONS
   =========================================== */

/* Top banner ad */
.ad-top-banner {
    max-width: 728px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.ad-top-banner .ad-placeholder-visual {
    width: 728px;
    max-width: 100%;
    height: 90px;
    min-height: 90px;
}

/* Sidebar ad (desktop only) */
.ad-sidebar {
    width: 100%;
    margin: 1.5rem 0;
}

.ad-sidebar .ad-placeholder-visual {
    width: 100%;
    height: 250px;
    min-height: 250px;
}

/* In-feed ad (between competition cards) */
.ad-in-feed {
    width: 100%;
    max-width: 100%;
    margin: 1rem 0;
    grid-column: 1 / -1;
}

.ad-in-feed .ad-placeholder-visual {
    width: 100%;
    height: 120px;
    min-height: 120px;
}

/* Footer ad */
.ad-footer {
    max-width: 728px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.ad-footer .ad-placeholder-visual {
    width: 728px;
    max-width: 100%;
    height: 90px;
    min-height: 90px;
}

/* ===========================================
   AD RESPONSIVE
   =========================================== */

@media (max-width: 768px) {
    /* Hide sidebar ad on mobile */
    .ad-sidebar {
        display: none;
    }

    /* Adjust banner sizes for mobile */
    .ad-top-banner .ad-placeholder-visual,
    .ad-footer .ad-placeholder-visual {
        width: 100%;
        height: 60px;
        min-height: 60px;
    }

    .ad-in-feed .ad-placeholder-visual {
        height: 100px;
        min-height: 100px;
    }
}

/* ===========================================
   OPTIONAL: Hide ads for clean screenshots
   Add ?noads to URL to hide all ads
   =========================================== */
body.hide-ads .ad-container {
    display: none;
}

/* ===========================================
   REPERTOIRE SELECTION (Additive Feature)
   =========================================== */

/* Selection checkbox in repertoire list */
.piece-select-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

/* Highlight selected pieces */
.repertoire-item.piece-selected {
    background: rgba(139, 90, 43, 0.08);
    border-left: 3px solid var(--primary);
    padding-left: calc(1rem - 3px);
}

/* Selection summary panel */
.selection-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(139, 90, 43, 0.1), rgba(139, 90, 43, 0.05));
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid rgba(139, 90, 43, 0.2);
}

.selection-info {
    font-size: 0.9rem;
    color: var(--text-dark);
}

.selection-actions {
    display: flex;
    gap: 0.5rem;
}

/* ===========================================
   NOTIFICATION BELL (Header)
   =========================================== */

.notification-bell {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 0.75rem;
}

.notification-bell-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    position: relative;
}

.notification-bell-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.bell-icon {
    font-size: 1.1rem;
}

.notification-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #c62828;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===========================================
   NOTIFICATION BADGE (Inline in tab)
   =========================================== */

.notification-badge-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #c62828;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9px;
    margin-left: 0.5rem;
}

/* ===========================================
   NOTIFICATIONS LIST (Profile Page)
   =========================================== */

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-cream);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    transition: background 0.2s;
}

.notification-item.read {
    border-left-color: #e0d5c9;
    opacity: 0.7;
}

.notification-item.unread {
    background: rgba(139, 90, 43, 0.08);
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

.notification-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.notification-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.notification-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.btn-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-dark);
}

/* ===========================================
   RESPONSIVE: Selection & Notifications
   =========================================== */

@media (max-width: 768px) {
    .selection-summary {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .notification-item {
        flex-wrap: wrap;
    }

    .notification-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #e0d5c9;
    }
}

/* ===========================================
   FESTIVAL CARDS
   Lighter, informational design for festivals/masterclasses
   =========================================== */

/* Event Card Container - shared wrapper for both types */
.event-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s;
}

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

.event-card.competition {
    /* Inherits default competition styling */
}

/* Festival Card Modifier */
.event-card.festival {
    border-left: 4px solid #9c27b0;
}

.event-card.festival:hover {
    border-left-color: #7b1fa2;
}

/* Festival Header */
.card-header.festival {
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
    color: white;
    padding: 1.25rem;
}

.card-header.festival h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

/* Festival Badge */
.event-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.event-type-badge.festival-badge {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Festival Body - cleaner layout without match indicators */
.festival-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Festival Dates Section */
.festival-dates {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-cream);
    border-radius: 10px;
}

.festival-date-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.festival-date-item .date-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 50px;
}

.festival-date-item .date-value {
    color: var(--text-dark);
}

/* Masterclasses Section */
.festival-section {
    padding: 0.75rem;
    background: #f8f5f2;
    border-radius: 10px;
}

.festival-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.festival-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.festival-list li {
    font-size: 0.875rem;
    color: var(--text-dark);
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.festival-list li:last-child {
    border-bottom: none;
}

.festival-list .teacher-name,
.festival-list .artist-name {
    font-weight: 500;
}

.festival-list .instrument,
.festival-list .ensemble {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Festival Actions - cleaner, fewer buttons */
.festival-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e0d5c9;
}

.festival-actions .btn {
    flex: 1;
    text-align: center;
}

/* Sectioned List Headers */
.event-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    margin: 1.5rem 0 1rem 0;
    border-bottom: 2px solid var(--primary);
}

.event-section-header:first-child {
    margin-top: 0;
}

.event-section-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--text-dark);
    margin: 0;
}

.event-section-header .section-icon {
    font-size: 1.5rem;
}

.event-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.5rem;
    background: var(--primary);
    color: white;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Responsive Festival Cards */
@media (max-width: 768px) {
    .event-card.festival {
        border-left-width: 3px;
    }

    .card-header.festival {
        padding: 1rem;
    }

    .card-header.festival h3 {
        font-size: 1.1rem;
    }

    .festival-body {
        padding: 1rem;
    }

    .festival-section {
        padding: 0.6rem;
    }

    .event-section-header {
        flex-wrap: wrap;
    }

    .event-section-header h3 {
        font-size: 1.1rem;
    }
}

/* ========================================
   REDESIGN PHASE 3 — single ranked list, eligibility filter,
   eligibility chips, count line, age-ineligible group, featured state.
   Uses existing brand tokens (--primary/--accent/--border/Playfair/Inter).
   Color stays reserved for status; eligibility carries text labels.
   ======================================== */

/* Eligibility filter pills (sidebar Filters panel) */
.elig-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}
.elig-pill {
    padding: 0.35rem 0.7rem;
    border: 2px solid var(--border);
    border-radius: 14px;
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s;
}
.elig-pill:hover {
    border-color: var(--primary-light);
    background: var(--bg-cream);
}
.elig-pill.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

/* Single ranked results list + featured list: one responsive grid */
#resultsList,
#featuredList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
    gap: 1.5rem;
}
/* Non-card children (in-feed ads, the age-ineligible group, separators) span full width */
#resultsList > *:not(.competition-card),
#featuredList > *:not(.competition-card) {
    grid-column: 1 / -1;
}

/* Results count line (replaces the 4-stat vanity bar) */
.results-count {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin: 0.25rem 0 1.25rem;
}

/* Eligibility chips on cards (neutral; text labels carry the meaning) */
.elig-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--bg-light);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.elig-chip.elig-unverified {
    background: transparent;
    border-style: dashed;
    font-style: italic;
    font-weight: 500;
}

/* Age-ineligible: de-emphasized collapsible group at the bottom of the list */
details.age-ineligible-group {
    margin-top: 2rem;
    border-top: 2px dashed var(--border);
    padding-top: 1rem;
}
details.age-ineligible-group > summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
    list-style: none;
}
details.age-ineligible-group > summary::-webkit-details-marker { display: none; }
details.age-ineligible-group > summary::before { content: '\25B8'; margin-right: 0.5rem; }
details.age-ineligible-group[open] > summary::before { content: '\25BE'; }
details.age-ineligible-group .section-description {
    color: var(--text-muted);
    margin: 0.25rem 0 1rem;
    font-size: 0.9rem;
}
details.age-ineligible-group .competition-card { opacity: 0.78; }

/* Featured empty-state (shown before any repertoire is entered) */
#featuredState { margin-top: 1.5rem; }
#featuredState > h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

