/* ═══════════════════════════════════════════════════════════════════════
   WhichBandWhichTown — Premium Dark Theme Design System
   ═══════════════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ─────────────────────────────────────────── */
:root {
    /* Background layers */
    --bg-base: #0a0a0f;
    --bg-surface: #12121a;
    --bg-elevated: #1a1a2e;
    --bg-hover: #222240;
    --bg-active: #2a2a4e;

    /* Accent palette */
    --accent-primary: #8b5cf6;
    --accent-primary-hover: #a78bfa;
    --accent-secondary: #ec4899;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #f97316 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.10) 100%);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #8896a8;
    --text-accent: #a78bfa;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.10);
    --border-accent: rgba(139, 92, 246, 0.3);

    /* Glassmorphism */
    --glass-bg: rgba(18, 18, 26, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 20px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 24px rgba(139, 92, 246, 0.15);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Map accent */
    --hub-circle-fill: rgba(139, 92, 246, 0.12);
    --hub-circle-stroke: rgba(139, 92, 246, 0.5);
    --route-color: #a78bfa;

    /* Layout */
    --sidebar-width: 400px;
    --header-height: 64px;
}

/* ── Reset & Base ──────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior: none;
    overflow: hidden;
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100%;
    overscroll-behavior: none;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ── Header ────────────────────────────────────────────────────────── */
.app-header {
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    flex-shrink: 0;
}

.mode-toggle-header-btn {
    background: var(--surface-bg);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mode-toggle-header-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.header-attribution {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
}

.attribution-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.attribution-link:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.attribution-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.attribution-text-link {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.attribution-logo {
    height: 24px;
    width: auto;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.5));
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.4));
    animation: gentle-pulse 3s ease-in-out infinite;
}

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

.header-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.header-subtitle {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* ── Main Layout ───────────────────────────────────────────────────── */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
}

/* ── Sidebar ───────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Panel (Glass Card) ────────────────────────────────────────────── */
.panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.panel:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
}

.panel-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-icon {
    font-size: 1rem;
}

.panel-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

.action-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-transform: uppercase;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-active);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* ── Search ────────────────────────────────────────────────────────── */
#band-search-panel {
    position: relative;
    z-index: 10;
}

.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.search-spinner {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-medium);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    transform: translateY(-50%);
    display: none;
    animation: search-spin 0.6s linear infinite;
}

.search-spinner.active {
    display: block;
}

@keyframes search-spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    list-style: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.search-results.active {
    display: block;
    animation: slideDown 0.2s ease-out;
}

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

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

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

.search-result-item:hover,
.search-result-item.highlighted {
    background: var(--bg-hover);
    color: var(--text-accent);
}

/* ── Bands List ────────────────────────────────────────────────────── */
.bands-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.band-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.band-item:hover {
    border-color: var(--border-accent);
}

.band-color-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.band-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-medium);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.band-checkbox:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.band-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.band-name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.band-remove {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.band-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.band-star {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.band-star:hover {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.band-star.active {
    color: #f59e0b;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.3));
}

.empty-state {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    text-align: center;
    padding: 8px 0;
    font-style: italic;
}

/* ── Constraints ───────────────────────────────────────────────────── */
.constraint-group {
    margin-bottom: 14px;
}

.constraint-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.constraint-value {
    font-weight: 700;
    color: var(--text-accent);
    font-variant-numeric: tabular-nums;
}

.date-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.date-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}
/* ── Range Slider ──────────────────────────────────────────────────── */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-hover);
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.6);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

/* ── Checkbox ──────────────────────────────────────────────────────── */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-medium);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

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

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.checkbox-custom {
    display: none; /* using direct styling instead */
}

/* ── Hub Cards ─────────────────────────────────────────────────────── */
.hub-count {
    margin-left: auto;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    display: none;
}

.hub-count.active {
    display: inline-block;
}

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

.hub-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.hub-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.hub-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.hub-card:hover::before {
    opacity: 1;
}

.hub-card.active {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow), 0 0 0 1px var(--accent-primary);
    background: var(--bg-active);
}

.hub-card.active::before {
    opacity: 1;
}

.hub-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.hub-region {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.hub-active-badge {
    font-size: 0.65rem;
    font-weight: 600;
    background: var(--accent-gradient);
    color: white;
    padding: 2px 8px;
    border-radius: 8px;
    display: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hub-card.active .hub-active-badge {
    display: inline-block;
}

.hub-dates {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.hub-show-count {
    font-size: 0.78rem;
    color: var(--text-accent);
    font-weight: 500;
}

.hub-concerts {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hub-concert-item {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    padding: 3px 0;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    gap: 6px;
}

.hub-concert-item:last-child {
    border-bottom: none;
}

.solo-tour-stop {
    border-radius: var(--radius-sm);
    padding: 5px 6px;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.solo-tour-stop:hover {
    background: var(--bg-hover);
}

.solo-tour-stop:hover .hub-concert-band {
    color: var(--text-accent);
}

.solo-tour-stop:active {
    background: var(--bg-active);
}

.hub-concert-band {
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hub-concert-venue {
    color: var(--text-tertiary);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hub-concert-date {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* ── Empty & Loading States ────────────────────────────────────────── */
.hubs-empty,
.hubs-loading {
    text-align: center;
    padding: 24px 8px;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

.hubs-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border-medium);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ── Map Area ──────────────────────────────────────────────────────── */
.map-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur, 8px));
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}

.map-container {
    width: 100%;
    height: 100%;
    background: var(--bg-base);
}

.map-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-tertiary);
    background:
        radial-gradient(ellipse at center, rgba(139, 92, 246, 0.05) 0%, transparent 70%),
        var(--bg-base);
}

.map-placeholder-icon {
    font-size: 4rem;
    opacity: 0.3;
    animation: gentle-pulse 4s ease-in-out infinite;
}

.map-placeholder h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.map-placeholder p {
    font-size: 0.85rem;
    max-width: 300px;
    text-align: center;
}

.map-api-note {
    font-size: 0.75rem !important;
    color: var(--text-tertiary) !important;
    margin-top: 8px;
    opacity: 0.7;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
    }

    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: unset;
        height: 50%;
        max-height: 50%;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }

    .map-area {
        height: 50%;
        min-height: unset;
    }
}

/* ── Co-Touring Recommendations ──────────────────────────── */

.hub-recommendations {
    margin-top: 12px;
    border-top: 1px solid rgba(139, 92, 246, 0.15);
    padding-top: 12px;
}

.hub-recs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.hub-recs-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.find-recs-btn {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.1));
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.find-recs-btn:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(251, 191, 36, 0.2));
    border-color: rgba(245, 158, 11, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.find-recs-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.find-recs-btn .btn-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.rec-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(251, 191, 36, 0.03));
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    animation: fadeSlideUp 0.3s ease forwards;
    opacity: 0;
}

.rec-card:nth-child(2) { animation-delay: 0.1s; }
.rec-card:nth-child(3) { animation-delay: 0.2s; }
.rec-card:nth-child(4) { animation-delay: 0.3s; }
.rec-card:nth-child(5) { animation-delay: 0.4s; }

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

.rec-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.rec-artist-name {
    font-size: 14px;
    font-weight: 700;
    color: #f59e0b;
}

.rec-relevance {
    font-size: 10px;
    font-weight: 600;
    color: rgba(245, 158, 11, 0.7);
    background: rgba(245, 158, 11, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.rec-shared-info {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.rec-event-info {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 6px;
}

.rec-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.rec-add-btn {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rec-add-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.5);
}

.rec-ticket-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: color 0.2s;
}

.rec-ticket-link:hover {
    color: #60a5fa;
}

.rec-distance {
    font-size: 11px;
    color: var(--text-tertiary);
}

.rec-empty {
    text-align: center;
    padding: 12px;
    color: var(--text-tertiary);
    font-size: 12px;
}

.rec-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    color: #f59e0b;
    font-size: 12px;
}

/* Hub Card Minimized state */
.hub-card.minimized {
    padding: 10px 14px;
    opacity: 0.65;
    border-style: dashed;
    border-color: var(--border-medium);
    transition: all var(--transition-fast);
}

.hub-card.minimized:hover {
    opacity: 0.9;
    border-style: dashed;
    border-color: var(--border-accent);
}

.hub-card.minimized::before {
    display: none; /* Hide the top gradient accent for minimized cards */
}

/* Region Filter Badges */
.region-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.region-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    animation: fadeSlideIn 0.2s ease-out;
}

.region-badge:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25));
    border-color: rgba(99, 102, 241, 0.5);
}

.region-badge-remove {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0 2px;
    line-height: 1;
    transition: color var(--transition-fast);
}

.region-badge-remove:hover {
    color: var(--danger);
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus Styles for Accessibility */
button:focus-visible,
a:focus-visible,
input[type="checkbox"]:focus-visible,
select:focus-visible,
.slider:focus-visible,
.search-input:focus-visible,
.date-input:focus-visible,
.hub-card:focus-visible,
.hub-concert-item:focus-visible,
.rec-card:focus-visible,
.add-action:focus-visible,
.band-star:focus-visible {
    outline: 2px solid var(--accent-primary, #8b5cf6);
    outline-offset: 2px;
}

/* Hub Recommendations Expand/Collapse details and summary */
.hub-recs-details {
    margin-top: 12px;
    width: 100%;
}

.hub-recs-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent-primary-hover);
    user-select: none;
    list-style: none; /* Hide default list marker in Chrome/Firefox */
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.hub-recs-summary::-webkit-details-marker {
    display: none; /* Hide default list marker in Safari */
}

.hub-recs-summary:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.hub-recs-summary .hub-recs-arrow {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.hub-recs-summary .hub-recs-arrow::before {
    content: '▼';
    font-size: 0.75rem;
}

.hub-recs-details[open] .hub-recs-summary .hub-recs-arrow {
    transform: rotate(180deg);
}

.hub-recs-summary:focus-visible {
    outline: 2px solid var(--accent-primary, #8b5cf6);
    outline-offset: 2px;
}

/* Roadtrip Gap Placeholders */
.roadtrip-placeholder-item {
    margin: 8px 0;
    padding: 10px 12px;
    border: 1px dashed rgba(249, 115, 22, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(249, 115, 22, 0.02);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.roadtrip-placeholder-item:hover {
    background: rgba(249, 115, 22, 0.08);
    border-color: rgba(249, 115, 22, 0.6);
    transform: translateY(-1px);
}

.roadtrip-placeholder-item.active {
    background: rgba(249, 115, 22, 0.12);
    border-color: #f97316;
    border-style: solid;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.15);
}

.roadtrip-placeholder-item .placeholder-icon {
    font-size: 1rem;
    color: #f97316;
}

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

.roadtrip-placeholder-item .placeholder-label {
    margin-left: auto;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    font-weight: 500;
}


/* ── Login Overlay ────────────────────────────────────────────────── */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #12121a 0%, #0a0a0f 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
}

#login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    background: rgba(18, 18, 26, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 48px 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(139, 92, 246, 0.15);
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: loginCardAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    display: inline-block;
    filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.5));
    animation: pulseIcon 3s infinite ease-in-out;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.4)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 20px rgba(236, 72, 153, 0.6)); }
}

.login-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 28px;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #f97316 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

#login-password {
    width: 100%;
    padding: 14px 48px 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.25s ease;
}

#login-password:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25), inset 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-password-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toggle-password-btn:hover {
    color: var(--text-primary);
}

.login-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.login-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
    filter: brightness(1.1);
}

.login-submit-btn:active {
    transform: translateY(1px);
}

.login-error-msg {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 16px;
    min-height: 20px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.login-error-msg.visible {
    opacity: 1;
    transform: translateY(0);
    animation: shakeError 0.4s ease-in-out;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Spinner inside button */
.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Login Splash & Hidden Utilities ──────────────────────────────── */
.login-card.hidden {
    display: none !important;
}

.login-splash.hidden {
    display: none !important;
}

.login-splash {
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

.splash-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    margin: 28px auto 0 auto;
    animation: spin 0.8s linear infinite;
}

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

.api-counter {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1px 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: default;
}

.api-counter:hover {
    color: var(--accent-primary, #8b5cf6);
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
}

