/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Texturina:wght@300;400;500;600;700&display=swap');

/* Coral Pixels */
@font-face {
    font-family: 'Coral Pixels';
    src: url('/static/fonts/coral-pixels.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* Bitcount Grid Double */
@font-face {
    font-family: 'Bitcount Grid Double';
    src: url('/static/fonts/bitcount-grid-double.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* Bitcount Grid Single */
@font-face {
    font-family: 'Bitcount Grid Single';
    src: url('/static/fonts/bitcount-grid-single.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* Jetbrains Mono Nerd Font */
@font-face {
    font-family: 'JetBrains Mono Nerd';
    src: url('/static/fonts/jetbrains-mono-nerd.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

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

:root {
    --font-body: 'Texturina', Georgia, serif;
    --font-h1: 'Coral Pixels', monospace;
    --font-h2: 'Bitcount Grid Double', monospace;
    --font-h3: 'Bitcount Grid Single', monospace;
    --font-input: 'JetBrains Mono Nerd', 'Fira Code', monospace;

    /* ZenBones Light theme */
    --bg-light: #fef6ec;
    --bg-light-accent: #f5e6d3;
    --bg-light-card: #fffdf8;
    --text-light: #463b2d;
    --text-light-muted: #8b7b6b;
    --border-light: #e3d5c1;
    --accent-light: #d97736;
    --accent-light-hover: #b85f28;
    --input-bg-light: #fffaf2;
    --input-border-light: #c4b39a;
    --link-light: #b85f28;
    --shadow-light: rgba(139, 108, 82, 0.1);

    /* Coffee Dark theme */
    --bg-dark: #1c1a17;
    --bg-dark-accent: #2a2520;
    --bg-dark-card: #312c25;
    --text-dark: #d9c4a8;
    --text-dark-muted: #8b7b6b;
    --border-dark: #463b2d;
    --accent-dark: #d97736;
    --accent-dark-hover: #e8944a;
    --input-bg-dark: #3a342b;
    --input-border-dark: #5a4f40;
    --link-dark: #e8944a;
    --shadow-dark: rgba(0, 0, 0, 0.3);

    /* Layout */
    --max-width: 720px;
    --spacing: 1.5rem;
    --radius: 0.5rem;
}

/* ===== BASE ===== */
html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    text-align: center;
}

/* Light theme (ZenBones) */
body.theme-light {
    background-color: var(--bg-light);
    color: var(--text-light);
}

/* Dark theme (Coffee Dark) */
body.theme-dark {
    background-color: var(--bg-dark);
    color: var(--text-dark);
}

/* ===== TYPOGRAPHY ===== */
h1 {
    font-family: var(--font-h1);
    font-size: 2rem;
    font-weight: normal;
    letter-spacing: 0.05em;
}

h2 {
    font-family: var(--font-h2);
    font-size: 1.3rem;
    font-weight: normal;
    margin: 2rem 0 1rem;
}

h3 {
    font-family: var(--font-h3);
    font-size: 1.1rem;
    font-weight: normal;
}

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

body.theme-light a {
    color: var(--link-light);
}
body.theme-light a:hover {
    color: var(--accent-light-hover);
}

body.theme-dark a {
    color: var(--link-dark);
}
body.theme-dark a:hover {
    color: var(--accent-dark);
}

/* ===== LAYOUT ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.decor-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.decor-slot {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.theme-light .decor-slot {
    background: var(--bg-light-accent);
    border: 1px solid var(--border-light);
}
body.theme-dark .decor-slot {
    background: var(--bg-dark-accent);
    border: 1px solid var(--border-dark);
}

/* ===== MUSIC PLAYER (placeholder) ===== */
.music-player {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin: 1rem 0;
    overflow-x: auto;
    white-space: nowrap;
}

body.theme-light .music-player {
    background: var(--bg-light-card);
    border: 1px solid var(--border-light);
}
body.theme-dark .music-player {
    background: var(--bg-dark-card);
    border: 1px solid var(--border-dark);
}

.music-player .now-playing {
    font-family: var(--font-h3);
    font-size: 0.8rem;
    opacity: 0.7;
}

.music-player .album-art {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    flex-shrink: 0;
    background: var(--accent-dark);
}

.music-player .track-name {
    font-weight: 500;
}

/* ===== LINK LISTS ===== */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    margin: 1.5rem 0;
    font-family: var(--font-h3);
    font-size: 0.95rem;
}

.nav-links span {
    opacity: 0.4;
    margin: 0 0.25rem;
}

/* ===== SEPARATOR ===== */
.separator {
    text-align: center;
    font-family: var(--font-h2);
    font-size: 0.85rem;
    opacity: 0.5;
    margin: 2rem 0 1rem;
    letter-spacing: 0.1em;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-input);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

body.theme-light .btn-primary {
    background: var(--accent-light);
    color: #fff;
}
body.theme-light .btn-primary:hover {
    background: var(--accent-light-hover);
}

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

.btn-signout {
    margin-top: 2rem;
    padding: 0.5rem 1.2rem;
    font-size: 0.8rem;
    border-radius: var(--radius);
}

body.theme-light .btn-signout {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-light-muted);
}
body.theme-light .btn-signout:hover {
    background: var(--bg-light-accent);
}

body.theme-dark .btn-signout {
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-dark-muted);
}
body.theme-dark .btn-signout:hover {
    background: var(--bg-dark-accent);
}

/* ===== AUTH CARDS ===== */
.auth-card {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    border-radius: var(--radius);
}

body.theme-light .auth-card {
    background: var(--bg-light-card);
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 12px var(--shadow-light);
}
body.theme-dark .auth-card {
    background: var(--bg-dark-card);
    border: 1px solid var(--border-dark);
    box-shadow: 0 2px 12px var(--shadow-dark);
}

.auth-card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-family: var(--font-h3);
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
    opacity: 0.8;
}

.form-group label .required {
    color: var(--accent-dark);
    margin-right: 2px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius);
    font-family: var(--font-input);
    font-size: 0.85rem;
    border: 1px solid var(--input-border-light);
    transition: border-color 0.2s;
}

body.theme-light input,
body.theme-light textarea {
    background: var(--input-bg-light);
    color: var(--text-light);
}
body.theme-light input:focus,
body.theme-light textarea:focus {
    outline: none;
    border-color: var(--accent-light);
}

body.theme-dark input,
body.theme-dark textarea {
    background: var(--input-bg-dark);
    color: var(--text-dark);
    border-color: var(--input-border-dark);
}
body.theme-dark input:focus,
body.theme-dark textarea:focus {
    outline: none;
    border-color: var(--accent-dark);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* ===== ALERTS / ERRORS ===== */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: left;
}

.alert-error {
    border-left: 3px solid #d93636;
}
body.theme-light .alert-error {
    background: #fef0f0;
    color: #991b1b;
}
body.theme-dark .alert-error {
    background: rgba(217, 54, 54, 0.1);
    color: #fca5a5;
}

.alert-success {
    border-left: 3px solid #36d97a;
}
body.theme-light .alert-success {
    background: #f0fef6;
    color: #166534;
}
body.theme-dark .alert-success {
    background: rgba(54, 217, 122, 0.1);
    color: #86efac;
}

/* ===== TOOGLE SWITCH ===== */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 24px;
    transition: background 0.2s;
}

body.theme-light .toggle-slider {
    background: #d4c5ae;
}
body.theme-dark .toggle-slider {
    background: #5a4f40;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-dark);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ===== PENDING DIALOG ===== */
.pending-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.pending-dialog {
    padding: 2.5rem;
    border-radius: var(--radius);
    text-align: center;
    max-width: 420px;
}

body.theme-light .pending-dialog {
    background: var(--bg-light-card);
    color: var(--text-light);
}
body.theme-dark .pending-dialog {
    background: var(--bg-dark-card);
    color: var(--text-dark);
}

/* ===== ADMIN TABLE ===== */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
    padding: 0.5rem;
    text-align: left;
}

body.theme-light .admin-table th {
    background: var(--bg-light-accent);
    border-bottom: 2px solid var(--border-light);
}
body.theme-light .admin-table td {
    border-bottom: 1px solid var(--border-light);
}
body.theme-dark .admin-table th {
    background: var(--bg-dark-accent);
    border-bottom: 2px solid var(--border-dark);
}
body.theme-dark .admin-table td {
    border-bottom: 1px solid var(--border-dark);
}

/* ===== ACCESS GRID ===== */
.access-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.5rem 0;
}

.access-checkbox {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
}

/* ===== DETAILS/SUMMARY (admin cards) ===== */
details.signup-card {
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}
body.theme-light details.signup-card {
    border: 1px solid var(--border-light);
}
body.theme-dark details.signup-card {
    border: 1px solid var(--border-dark);
}
details.signup-card[open] {
    margin-bottom: 1rem;
}
details summary {
    cursor: pointer;
    user-select: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    html { font-size: 16px; }
    .container { padding: 1rem; }
    h1 { font-size: 1.5rem; }
    .nav-links { gap: 0.3rem 1rem; }
}
