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

:root {
    --primary:      #1a237e;
    --primary-dark: #0d1455;
    --primary-light:#3949ab;
    --accent:       #c62828;
    --gold:         #f9a825;
    --text:         #1a1a2e;
    --text-muted:   #6c757d;
    --bg:           #f5f5f5;
    --card:         #ffffff;
    --border:       #e0e0e0;
    --radius:       10px;
    --shadow:       0 2px 12px rgba(0,0,0,.08);
    --font-te:      'Noto Sans Telugu', sans-serif;
    --font-en:      'Inter', sans-serif;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-en);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top Nav ── */
.top-nav {
    background: var(--primary);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.nav-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; gap: 14px;
    padding: 0 16px; height: 58px;
}
.nav-brand {
    display: flex; align-items: center; gap: 10px;
    color: #fff; font-weight: 700; font-size: 1.1rem;
    text-decoration: none; white-space: nowrap;
    flex-shrink: 0;
}
.nav-brand i { color: var(--gold); font-size: 1.2rem; }
.brand-text { font-family: var(--font-en); }
.nav-search-wrap { flex: 1; max-width: 500px; }
.nav-search-form {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
    border-radius: 24px; padding: 7px 16px;
    transition: background .2s;
}
.nav-search-form:focus-within { background: rgba(255,255,255,.2); }
.nav-search-form i { color: rgba(255,255,255,.7); font-size: .9rem; flex-shrink:0; }
.nav-search-form input {
    background: none; border: none; outline: none;
    color: #fff; font-size: .88rem; width: 100%; font-family: inherit;
}
.nav-search-form input::placeholder { color: rgba(255,255,255,.6); }
.nav-actions { display: flex; gap: 6px; margin-left: auto; }
.nav-icon-btn {
    color: rgba(255,255,255,.8); width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: .95rem;
    transition: background .2s, color .2s;
}
.nav-icon-btn:hover { background: rgba(255,255,255,.15); color: #fff; text-decoration:none; }

/* ── Page Wrap ── */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; }

/* ── Hero ── */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #4a148c 100%);
    border-radius: var(--radius); padding: 40px 32px;
    text-align: center; color: #fff; margin-bottom: 28px;
    position: relative; overflow: hidden;
}
.hero::before {
    content: '\f7a2';
    font-family: 'Font Awesome 6 Free'; font-weight: 900;
    position: absolute; right: 30px; bottom: -20px;
    font-size: 9rem; opacity: .06; color: #fff;
}
.hero h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; font-family: var(--font-te); }
.hero p  { font-size: 1rem; opacity: .85; margin-bottom: 20px; }
.hero-search {
    display: flex; align-items: center; gap: 0;
    max-width: 480px; margin: 0 auto;
    background: #fff; border-radius: 28px; overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.hero-search input {
    flex: 1; border: none; outline: none; padding: 12px 18px;
    font-size: .95rem; font-family: var(--font-te);
}
.hero-search button {
    background: var(--accent); color: #fff; border: none;
    padding: 12px 20px; cursor: pointer; font-size: .95rem;
    transition: background .2s;
}
.hero-search button:hover { background: #b71c1c; }

/* ── Section headings ── */
.section-hd {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.section-hd h2 { font-size: 1.1rem; font-weight: 700; color: var(--text); display:flex; align-items:center; gap:8px; }
.section-hd h2 i { color: var(--primary); }
.section-hd a { font-size: .82rem; color: var(--primary); font-weight:600; }

/* ── Category Grid ── */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px; margin-bottom: 32px;
}
.cat-card {
    display: flex; flex-direction: column; align-items: center;
    gap: 10px; padding: 20px 12px;
    background: var(--card); border: 2px solid transparent;
    border-radius: var(--radius); text-decoration: none; color: var(--text);
    box-shadow: var(--shadow); transition: all .2s; cursor: pointer;
    text-align: center;
}
.cat-card:hover { border-color: var(--primary); background: #f0f4ff; text-decoration:none; transform: translateY(-2px); }
.cat-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: #fff;
}
.cat-name    { font-size: .82rem; font-weight: 700; color: var(--text); }
.cat-name-te { font-size: .8rem; color: var(--text-muted); font-family: var(--font-te); }
.cat-count   { font-size: .75rem; color: var(--text-muted); }

/* ── Song Cards Grid ── */
.songs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px; margin-bottom: 28px;
}
.song-card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px 18px;
    display: flex; flex-direction: column; gap: 8px;
    border: 1px solid var(--border); transition: all .2s;
    text-decoration: none; color: inherit;
}
.song-card:hover { border-color: var(--primary); box-shadow: 0 4px 20px rgba(26,35,126,.12); transform: translateY(-2px); text-decoration:none; }
.song-card-cat {
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; padding: 2px 8px; border-radius: 3px;
    display: inline-flex; align-items: center; gap: 4px;
    width: fit-content;
}
.song-card-title {
    font-size: 1rem; font-weight: 700; color: var(--text);
    font-family: var(--font-te); line-height: 1.35;
}
.song-card-title-en { font-size: .82rem; color: var(--text-muted); font-family: var(--font-en); }
.song-card-meta {
    display: flex; align-items: center; gap: 12px;
    font-size: .75rem; color: var(--text-muted); margin-top: auto;
}
.song-card-meta i { font-size: .7rem; }

/* ── Single Song View ── */
.song-view-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
@media(max-width:900px){ .song-view-wrap { grid-template-columns:1fr; } }

.song-header {
    background: var(--card); border-radius: var(--radius);
    padding: 24px 28px; margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.song-header-cat {
    font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; margin-bottom: 10px;
    display: inline-flex; align-items: center; gap: 6px;
}
.song-title {
    font-size: 1.8rem; font-weight: 700;
    font-family: var(--font-te); color: var(--text);
    line-height: 1.3; margin-bottom: 6px;
}
.song-title-en { font-size: 1rem; color: var(--text-muted); margin-bottom: 14px; }
.song-meta-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--text-muted); }
.song-meta-row span { display: flex; align-items: center; gap: 5px; }

/* Stage controls bar */
.stage-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: var(--card); border-radius: var(--radius);
    padding: 10px 16px; margin-bottom: 16px;
    box-shadow: var(--shadow); border: 1px solid var(--border);
}
.stage-bar-label { font-size: .75rem; font-weight: 700; color: var(--text-muted); margin-right: 4px; }
.stage-btn {
    border: 1px solid var(--border); background: #fff;
    border-radius: 6px; padding: 5px 11px; font-size: .8rem;
    cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
    color: var(--text); font-family: inherit; transition: all .15s;
}
.stage-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.stage-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.stage-btn-danger { border-color: #e53935; color: #e53935; }
.stage-btn-danger:hover { background: #e53935; color: #fff; }

/* Lyrics display */
.lyrics-box {
    background: var(--card); border-radius: var(--radius);
    padding: 28px 32px; box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: font-size .2s;
}
.lyrics-box .lyric-line {
    display: block; line-height: 2;
    font-family: var(--font-te); font-size: 1.05em;
}
.lyrics-box .chord-line {
    display: block; font-family: monospace;
    font-size: .82em; color: #c62828; font-weight: 600;
    letter-spacing: .04em; line-height: 1.6;
}
.lyrics-box .lyric-break { display: block; height: .6em; }

/* Section block: label + content side by side */
.lyrics-box .song-section {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0 6px;
    margin-bottom: 6px;
}
.lyrics-box .section-label {
    font-family: var(--font-te);
    font-size: 1.05em; font-weight: 700;
    color: var(--primary);
    padding-top: 2px; line-height: 2;
    white-space: nowrap;
}
.lyrics-box .section-content { display: block; }

/* Repeat / refrain markers: ||2||, ||సుప్రభాత|| */
.lyrics-box .repeat-marker {
    font-size: .82em; color: #888;
    font-style: italic; margin-left: 4px;
}
.lyrics-box .refrain-marker {
    font-size: .82em; color: var(--primary);
    font-style: italic; margin-left: 4px;
}

/* Stage Mode */
body.stage-mode {
    background: #0a0a0a;
}
body.stage-mode .top-nav,
body.stage-mode .site-footer,
body.stage-mode .song-sidebar,
body.stage-mode .stage-bar { display: none; }
body.stage-mode .page-wrap { max-width: 100%; padding: 0; }
body.stage-mode .song-header {
    background: #111; color: #fff; border-radius: 0;
    border-bottom: 1px solid #333; margin-bottom: 0;
}
body.stage-mode .song-title,
body.stage-mode .song-header-cat { color: var(--gold); }
body.stage-mode .song-title-en,
body.stage-mode .song-meta-row { color: #aaa; }
body.stage-mode .lyrics-box {
    background: #0a0a0a; color: #f0f0f0; border: none;
    border-radius: 0; padding: 32px 48px; box-shadow: none;
    min-height: 100vh;
}
body.stage-mode .lyrics-box .lyric-line { color: #f0f0f0; }
body.stage-mode .lyrics-box .chord-line { color: #ff8f00; }
body.stage-mode .lyrics-box .section-label { color: var(--gold); }
body.stage-mode .lyrics-box .repeat-marker { color: #666; }
body.stage-mode .lyrics-box .refrain-marker { color: var(--gold); }
.stage-exit-btn {
    position: fixed; top: 12px; right: 12px; z-index: 999;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
    color: #fff; border-radius: 6px; padding: 6px 14px;
    font-size: .82rem; cursor: pointer; display: none;
    align-items: center; gap: 6px; font-family: inherit;
}
body.stage-mode .stage-exit-btn { display: flex; }

/* Auto-scroll indicator */
.scroll-indicator {
    position: fixed; bottom: 16px; right: 16px; z-index: 998;
    background: rgba(0,0,0,.7); color: #fff;
    border-radius: 20px; padding: 6px 14px; font-size: .8rem;
    display: none; align-items: center; gap: 6px;
}
.scroll-indicator.active { display: flex; }

/* ── Sidebar ── */
.song-sidebar {}
.sidebar-box {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px;
    margin-bottom: 16px; border: 1px solid var(--border);
}
.sidebar-box h3 { font-size: .82rem; font-weight: 700; color: var(--text-muted); text-transform:uppercase; letter-spacing:.06em; margin-bottom:12px; }
.related-song {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 8px 0; border-bottom: 1px solid #f0f0f0;
    text-decoration: none; color: inherit;
}
.related-song:last-child { border-bottom: none; }
.related-song:hover .related-title { color: var(--primary); }
.related-num { font-size: .72rem; color: var(--text-muted); min-width: 18px; padding-top:2px; }
.related-title { font-size: .83rem; font-weight: 600; font-family: var(--font-te); line-height:1.4; }

/* ── Search results ── */
.search-result {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px 20px;
    margin-bottom: 12px; border: 1px solid var(--border);
    display: block; color: inherit; text-decoration: none;
    transition: border-color .2s;
}
.search-result:hover { border-color: var(--primary); text-decoration:none; }
.search-result-title { font-size: 1.05rem; font-weight:700; font-family:var(--font-te); color:var(--primary); margin-bottom:4px; }
.search-result-excerpt { font-size: .82rem; color: var(--text-muted); line-height:1.6; }
.search-result-excerpt mark { background: #fff3cd; color: var(--text); border-radius:2px; padding:0 2px; }

/* ── Category page ── */
.cat-page-header {
    border-radius: var(--radius); padding: 24px 28px; margin-bottom: 24px;
    color: #fff; position: relative; overflow: hidden;
}
.cat-page-header h1 { font-size: 1.6rem; font-weight:700; font-family:var(--font-te); margin-bottom:4px; }
.cat-page-header p { opacity: .85; font-size: .88rem; }

/* ── Pagination ── */
.pagination { display:flex; gap:4px; justify-content:center; margin-top:24px; flex-wrap:wrap; }
.pagination a, .pagination span {
    display:inline-flex; align-items:center; justify-content:center;
    width:36px; height:36px; border-radius:6px;
    font-size:.82rem; font-weight:600; text-decoration:none;
    border: 1px solid var(--border); color: var(--text); background: var(--card);
    transition: all .15s;
}
.pagination a:hover { background: var(--primary); color:#fff; border-color:var(--primary); text-decoration:none; }
.pagination span.cur { background: var(--primary); color:#fff; border-color:var(--primary); }

/* ── Footer ── */
.site-footer {
    background: var(--primary-dark); color: rgba(255,255,255,.8);
    padding: 30px 16px; margin-top: 40px; text-align: center;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-brand { display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom:8px; }
.footer-brand i { color: var(--gold); }
.footer-brand strong { color: #fff; font-size: 1.05rem; }
.footer-tagline { font-size: .85rem; font-family: var(--font-te); margin-bottom: 14px; opacity: .8; }
.footer-links { display:flex; gap:20px; justify-content:center; margin-bottom:12px; }
.footer-links a { color: rgba(255,255,255,.7); font-size: .82rem; }
.footer-links a:hover { color: #fff; text-decoration:none; }
.footer-copy { font-size: .75rem; opacity: .5; }

/* ── Admin overrides (inherit base) ── */
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 20px 16px; }

/* ── Breadcrumb ── */
.breadcrumb { display:flex; align-items:center; gap:6px; font-size:.8rem; color:var(--text-muted); margin-bottom:16px; flex-wrap:wrap; }
.breadcrumb a { color:var(--primary); }
.breadcrumb span { opacity:.5; }

/* ── Utilities ── */
.btn {
    display:inline-flex; align-items:center; gap:6px;
    padding:8px 18px; border-radius:6px; border:none;
    font-size:.85rem; font-weight:600; cursor:pointer;
    font-family:inherit; text-decoration:none; transition:all .15s;
}
.btn-primary   { background:var(--primary);color:#fff; }
.btn-primary:hover { background:var(--primary-dark); text-decoration:none; color:#fff; }
.btn-accent    { background:var(--accent);color:#fff; }
.btn-accent:hover { background:#b71c1c; text-decoration:none; color:#fff; }
.btn-secondary { background:#f0f0f0;color:var(--text);border:1px solid var(--border); }
.btn-secondary:hover { background:#e0e0e0; text-decoration:none; color:var(--text); }
.btn-sm { padding:5px 12px; font-size:.78rem; }
.btn-gold { background:var(--gold);color:#333; }
.btn-gold:hover { background:#f57f17; text-decoration:none; color:#333; }

.badge {
    display:inline-flex; align-items:center; gap:4px;
    padding:2px 9px; border-radius:4px; font-size:.7rem; font-weight:700;
}

.alert { padding:12px 16px; border-radius:6px; margin-bottom:16px; font-size:.85rem; }
.alert-success { background:#e8f5e9; color:#1B5E20; border-left:4px solid #4caf50; }
.alert-danger  { background:#ffebee; color:#B71C1C; border-left:4px solid #e53935; }
.alert-info    { background:#e3f2fd; color:#0d47a1; border-left:4px solid #2196f3; }

/* ── Responsive ── */
@media(max-width:640px){
    .hero { padding:28px 18px; }
    .hero h1 { font-size:1.4rem; }
    .cat-grid { grid-template-columns: repeat(auto-fill,minmax(130px,1fr)); }
    .songs-grid { grid-template-columns: 1fr; }
    .nav-search-wrap { display:none; }
    .nav-brand .brand-text { display:none; }
    body.stage-mode .lyrics-box { padding:20px 18px; }
}

/* ── Dark mode (stage) transitions ── */
body, .lyrics-box, .song-header { transition: background .3s, color .3s; }
