/* ============================================================
   ChoirStage — Stylesheet
   Aesthetic: Refined editorial, warm ivory + deep ink + gold accent
   ============================================================ */

:root {
    --bg:          #F7F4EE;
    --bg-card:     #FFFFFF;
    --ink:         #1A1610;
    --ink-muted:   #6B6358;
    --gold:        #C4922A;
    --gold-light:  #E8C97A;
    --rose:        #B84C4C;
    --green:       #3A7D5A;
    --border:      #DDD8CE;
    --shadow:      0 2px 16px rgba(26,22,16,0.08);
    --radius:      10px;
    --font-display: 'Playfair Display', serif;
    --font-body:    'DM Sans', sans-serif;
}

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

html { font-size: 16px; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Navbar ── */
.navbar {
    background: var(--ink);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.navbar-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--gold-light);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.brand-icon { font-size: 1.8rem; line-height: 1; }
.navbar-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.navbar-links a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}
.navbar-links a:hover { color: #fff; }
.nav-user { color: var(--gold-light); font-size: 0.85rem; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--gold);
    color: #fff;
    box-shadow: 0 2px 8px rgba(196,146,42,0.35);
}
.btn-primary:hover { background: #B07E22; box-shadow: 0 4px 14px rgba(196,146,42,0.45); }

.btn-secondary {
    background: var(--bg-card);
    color: var(--ink);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }

.btn-ghost {
    background: transparent;
    color: #ccc;
    border: 1.5px solid #555;
}
.btn-ghost:hover { border-color: #aaa; color: #fff; }

.btn-danger {
    background: var(--rose);
    color: #fff;
}
.btn-danger:hover { background: #9e3a3a; }

.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.8rem; }
.btn-icon { padding: 0.4rem 0.6rem; }

/* ── Main layout ── */
.main-content {
    flex: 1;
    padding: 2.5rem 1.5rem;
    max-width: 1080px;
    margin: 0 auto;
    width: 100%;
}

/* ── Alerts ── */
.alert {
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.alert-error   { background: #FEE8E8; color: var(--rose);  border-left: 4px solid var(--rose); }
.alert-success { background: #E6F4EC; color: var(--green); border-left: 4px solid var(--green); }

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}
.card-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}
.card-header h2, .card-header h3 {
    font-family: var(--font-display);
    font-weight: 700;
}

/* ── Page header ── */
.page-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header h1 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.15;
}
.page-header .subtitle {
    color: var(--ink-muted);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 1.25rem;
}
label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 0.4rem;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--bg);
    color: var(--ink);
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(196,146,42,0.15);
    background: #fff;
}
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.78rem; color: var(--ink-muted); margin-top: 0.3rem; }

/* ── Auth pages ── */
.auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px - 60px);
}
.auth-box {
    width: 100%;
    max-width: 440px;
}
.auth-box h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 0.4rem;
}
.auth-box .auth-sub {
    color: var(--ink-muted);
    margin-bottom: 1.8rem;
    font-size: 0.9rem;
}
.auth-link { text-align: center; margin-top: 1.2rem; font-size: 0.88rem; color: var(--ink-muted); }
.auth-link a { color: var(--gold); font-weight: 500; text-decoration: none; }
.auth-link a:hover { text-decoration: underline; }

/* ── Dashboard choir grid ── */
.choir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.choir-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    position: relative;
}
.choir-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(26,22,16,0.12); border-color: var(--gold); }
.choir-card h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.choir-card .choir-role {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: var(--gold-light);
    color: #6B4C00;
    width: fit-content;
}
.choir-card .choir-role.admin { background: var(--ink); color: var(--gold-light); }
.choir-card .choir-desc { font-size: 0.88rem; color: var(--ink-muted); }

/* ── Song list ── */
.song-list { display: flex; flex-direction: column; gap: 1rem; }
.song-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: border-color 0.2s;
}
.song-item:hover { border-color: var(--gold); }
.song-info h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
}
.song-info .artist { font-size: 0.85rem; color: var(--ink-muted); }
.song-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ── Song detail ── */
.song-detail-header {
    margin-bottom: 2rem;
}
.song-detail-header h1 {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}
.song-detail-header .artist-line {
    font-size: 1rem;
    color: var(--ink-muted);
    margin-top: 0.2rem;
}

/* ── Audio Player ── */
.player-section { margin-bottom: 2.5rem; }
.player-section h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gold);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(196,146,42,0.4);
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}
.play-btn:hover  { background: #B07E22; }
.play-btn:active { transform: scale(0.95); }

.seek-bar-wrap { flex: 1; min-width: 180px; }
.seek-bar {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    cursor: pointer;
}
.seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.time-display { font-size: 0.85rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; min-width: 80px; text-align: right; }

/* ── Track mixer rows ── */
.track-list { display: flex; flex-direction: column; gap: 0.75rem; }
.track-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s;
}
.track-row:hover { border-color: var(--gold-light); }
.mute-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.mute-btn.muted { background: var(--rose); border-color: var(--rose); color: #fff; }
.mute-btn:hover  { border-color: var(--gold); }
.track-label {
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 100px;
    flex-shrink: 0;
}
.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    outline: none;
    cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
}
.vol-pct { font-size: 0.78rem; color: var(--ink-muted); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

/* ── Sheet files ── */
.sheets-section h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}
.sheet-list { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.sheet-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 1rem;
    text-decoration: none;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, color 0.2s;
}
.sheet-item:hover { border-color: var(--gold); color: var(--gold); }
.sheet-icon { font-size: 1.2rem; }

/* ── Admin upload form ── */
.upload-section {
    margin-top: 2.5rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}
.upload-section h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

/* ── Pending members table ── */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
    border-bottom: 2px solid var(--border);
    padding: 0.5rem 0.75rem;
}
td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ── Breadcrumb ── */
.breadcrumb {
    font-size: 0.82rem;
    color: var(--ink-muted);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.breadcrumb a { color: var(--gold); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border); }

/* ── Misc ── */
.text-muted  { color: var(--ink-muted); }
.text-center { text-align: center; }
.mt-1  { margin-top: 0.5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.gap-2 { gap: 0.75rem; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ink-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.95rem; }

/* ── Footer ── */
.footer {
    background: var(--ink);
    color: #666;
    text-align: center;
    padding: 1rem;
    font-size: 0.78rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .main-content { padding: 1.5rem 1rem; }
    .page-header h1 { font-size: 1.7rem; }
    .song-item { flex-direction: column; align-items: flex-start; }
    .navbar { padding: 0 1rem; }
    .navbar-links { gap: 0.75rem; }
    .nav-user { display: none; }
}
