/* ── Saregam — Indian Classical Music Raga Explorer ──────── */
/* Color palette inspired by Indian aesthetics */

:root {
    --saffron: #FF9933;
    --saffron-dark: #E68A2E;
    --saffron-light: #FFAD5C;
    --indigo: #1a0a2e;
    --indigo-mid: #2d1b4e;
    --indigo-light: #4a2d6e;
    --cream: #FFF8F0;
    --cream-dark: #F5EDE0;
    --gold: #D4A843;
    --gold-light: #F0D68A;
    --maroon: #800020;
    --maroon-light: #A0334D;
    --text: #2C1810;
    --text-light: #6B5D53;
    --text-muted: #9B8E84;
    --border: #E8DDD2;
    --shadow: rgba(26, 10, 46, 0.08);
    --shadow-md: rgba(26, 10, 46, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --transition: 0.2s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--cream);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Top Navigation ──────────────────────────────────────── */

.top-nav {
    background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-mid) 100%);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 2px 12px var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    color: var(--saffron);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-om {
    font-size: 1.8rem;
    line-height: 1;
}

.nav-brand:hover {
    color: var(--saffron-light);
}

.nav-tagline {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-style: italic;
}

/* ── Hero ────────────────────────────────────────────────── */

.hero {
    background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-light) 50%, var(--maroon) 100%);
    color: white;
    padding: 3rem 2rem 2.5rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.hero-sub {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ── Detail Hero ─────────────────────────────────────────── */

.detail-hero {
    background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-light) 50%, var(--maroon) 100%);
    color: white;
    padding: 2rem 2rem 2.5rem;
    text-align: center;
}

.detail-hero h1 {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    margin-bottom: 0.3rem;
}

.back-link {
    display: inline-block;
    color: var(--saffron-light);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0.8;
    transition: opacity var(--transition);
}

.back-link:hover {
    opacity: 1;
}

.detail-thaat {
    display: inline-block;
    background: rgba(255, 153, 51, 0.2);
    color: var(--saffron-light);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* ── Section Titles ──────────────────────────────────────── */

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--indigo);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.note-hint {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Keyboard ────────────────────────────────────────────── */

.keyboard-section {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.keyboard {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 1.5rem;
    background: linear-gradient(180deg, #f0e8dc 0%, #e8ddd0 100%);
    border-radius: var(--radius);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.06), 0 4px 16px var(--shadow);
    user-select: none;
}

.key {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 10px;
    border-radius: 0 0 8px 8px;
    cursor: pointer;
    transition: all 0.12s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.key-natural {
    width: 58px;
    height: 140px;
    background: linear-gradient(180deg, #fefefe 0%, #f5f0e8 60%, #ede5d8 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), inset 0 -2px 4px rgba(0, 0, 0, 0.04);
    z-index: 1;
}

.key-vikrit {
    width: 44px;
    height: 100px;
    background: linear-gradient(180deg, #3a2a1a 0%, #2a1a0a 60%, #1a0a00 100%);
    color: #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 -1px 3px rgba(0, 0, 0, 0.3);
    z-index: 2;
    margin: 0 -10px;
}

.key-symbol {
    font-size: 1rem;
    font-weight: 700;
    pointer-events: none;
}

.key-shortcut {
    font-size: 0.65rem;
    opacity: 0.5;
    margin-top: 2px;
    pointer-events: none;
}

.key-natural .key-symbol { color: var(--indigo); }
.key-vikrit .key-symbol { color: #ddd; }

/* Key states */
.key-natural:hover {
    background: linear-gradient(180deg, #fff 0%, #faf5ec 60%, #f5ede0 100%);
    transform: translateY(-1px);
}

.key-vikrit:hover {
    background: linear-gradient(180deg, #4a3a2a 0%, #3a2a1a 60%, #2a1a0a 100%);
    transform: translateY(-1px);
}

.key.active {
    transform: translateY(2px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.key-natural.active {
    background: linear-gradient(180deg, #fdf0dd 0%, #f8e4c4 60%, #f0d4a8 100%);
}

.key-vikrit.active {
    background: linear-gradient(180deg, #5a4a2a 0%, #4a3a1a 60%, #3a2a0a 100%);
}

/* Selected state (for note filtering on list page) */
.key.selected {
    box-shadow: 0 0 0 3px var(--saffron), 0 4px 12px rgba(255, 153, 51, 0.3);
}

.key-natural.selected {
    background: linear-gradient(180deg, #fff5e0 0%, #ffe8b8 60%, #ffd88a 100%);
}

.key-vikrit.selected {
    background: linear-gradient(180deg, #6a4a10 0%, #5a3a08 60%, #4a2a00 100%);
}

.key-natural.selected .key-symbol { color: var(--saffron-dark); }
.key-vikrit.selected .key-symbol { color: var(--saffron); }

/* Highlighted state (for raga notes on detail page) */
.key.highlighted {
    box-shadow: 0 0 0 3px var(--saffron), 0 4px 16px rgba(255, 153, 51, 0.4);
}

.key-natural.highlighted {
    background: linear-gradient(180deg, #fff5e0 0%, #ffe8b8 60%, #ffd88a 100%);
}

.key-vikrit.highlighted {
    background: linear-gradient(180deg, #6a4a10 0%, #5a3a08 60%, #4a2a00 100%);
}

.key-natural.highlighted .key-symbol { color: var(--saffron-dark); }
.key-vikrit.highlighted .key-symbol { color: var(--saffron); }

/* Dimmed state (notes NOT in raga) */
.key.dimmed {
    opacity: 0.35;
}

.keyboard-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    justify-content: center;
}

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

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--saffron);
    color: white;
}

.btn:hover {
    background: var(--saffron-dark);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--cream-dark);
    color: var(--text);
}

/* ── Filters ─────────────────────────────────────────────── */

.filters-section {
    padding: 0 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 2px 12px var(--shadow);
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--cream);
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color var(--transition);
    appearance: auto;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--saffron);
    box-shadow: 0 0 0 3px rgba(255, 153, 51, 0.15);
}

.filter-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

#filterCount {
    font-weight: 700;
    color: var(--saffron-dark);
    font-size: 1.1rem;
}

/* ── Raga Grid ───────────────────────────────────────────── */

.ragas-section {
    padding: 0 2rem 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.raga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.raga-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid transparent;
}

.raga-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--shadow-md);
    border-color: var(--saffron-light);
}

.raga-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.raga-card-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--indigo);
    line-height: 1.2;
}

.raga-card-thaat {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--saffron-dark);
    background: rgba(255, 153, 51, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    white-space: nowrap;
}

.raga-card-scale {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-family: 'Segoe UI', monospace;
}

.raga-card-scale span {
    display: block;
    padding: 0.15rem 0;
}

.raga-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.raga-card-notes {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.note-pip {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.note-pip-natural {
    background: var(--cream-dark);
    color: var(--indigo);
}

.note-pip-vikrit {
    background: var(--indigo);
    color: #ddd;
}

.note-pip-match {
    background: var(--saffron);
    color: white;
    border-color: var(--saffron-dark);
    box-shadow: 0 0 6px rgba(255, 153, 51, 0.4);
}

.raga-card-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.15rem 0.55rem;
    border-radius: 10px;
    background: var(--cream-dark);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.tag-active {
    background: var(--indigo);
    color: white;
    border-color: var(--indigo);
}

/* ── No Results ──────────────────────────────────────────── */

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ── Detail Page ─────────────────────────────────────────── */

.detail-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.detail-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.detail-card h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.detail-info {
    grid-column: 1 / -1;
}

.scale-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.4rem 0;
}

.scale-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 90px;
}

.scale-notes {
    font-size: 1.1rem;
    font-family: 'Georgia', serif;
    color: var(--indigo);
    letter-spacing: 0.04em;
}

.scale-notes.micro {
    font-size: 0.9rem;
    color: var(--text-light);
    font-family: 'Segoe UI', sans-serif;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
    font-size: 0.95rem;
}

.meta-icon {
    font-size: 1.2rem;
}

.detail-tags .tag-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.detail-tags .tag {
    font-size: 0.85rem;
    padding: 0.3rem 0.8rem;
}

.detail-keyboard-section {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 2px 8px var(--shadow);
    text-align: center;
}

.detail-keyboard-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--indigo);
    margin-bottom: 0.3rem;
}

.keyboard-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ── Footer ──────────────────────────────────────────────── */

.site-footer {
    background: var(--indigo);
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
    .hero h1 { font-size: 1.8rem; }
    .detail-hero h1 { font-size: 2rem; }
    .filters-grid { grid-template-columns: 1fr 1fr; }
    .raga-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .keyboard { padding: 1rem; gap: 2px; }
    .key-natural { width: 40px; height: 110px; }
    .key-vikrit { width: 32px; height: 76px; margin: 0 -8px; }
    .key-symbol { font-size: 0.8rem; }
    .top-nav { padding: 0.75rem 1rem; }
    .nav-tagline { display: none; }
}

@media (max-width: 480px) {
    .filters-grid { grid-template-columns: 1fr; }
    .key-natural { width: 32px; height: 90px; }
    .key-vikrit { width: 26px; height: 60px; margin: 0 -6px; }
    .key-symbol { font-size: 0.7rem; }
    .key-shortcut { display: none; }
}
