/* Fonts are loaded in includes/header.php */

:root {
    color-scheme: dark;

    --bg: #131629;
    --surface: #1c2038;
    --surface-2: #252a45;
    --surface-3: #323856;
    --border: #2e3453;
    --border-soft: rgba(255, 255, 255, 0.07);

    --text: #eef0fa;
    --muted: #9ba3c4;

    --heat-1: #ff8a3d;
    --heat-2: #ff4d4d;
    --ink-on-heat: #1a0e08;
    --star: #ffc24b;
    --mint: #4fd1a5;
    --danger: #ff6b6b;

    --radius: 16px;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.38);

    --font-display: "Archivo Black", system-ui, sans-serif;
    --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--bg);
    background-image:
        radial-gradient(900px 520px at 88% -12%, rgba(255, 138, 61, 0.10), transparent 62%),
        radial-gradient(760px 520px at -10% 0%, rgba(124, 92, 255, 0.09), transparent 58%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--heat-1); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 20px;
    background: linear-gradient(180deg, rgba(28, 32, 56, 0.94), rgba(19, 22, 41, 0.88));
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
}

.brand img {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 3px 8px rgba(255, 109, 64, 0.45));
}

.nav-menu { position: relative; }

.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    border-radius: 11px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.04);
}

.nav-toggle::-webkit-details-marker { display: none; }

.nav-toggle:hover,
.nav-menu[open] .nav-toggle {
    background: rgba(255, 138, 61, 0.16);
    border-color: rgba(255, 138, 61, 0.4);
}

.nav-menu nav {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: flex;
    flex-direction: column;
    min-width: 190px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    z-index: 60;
}

.nav-menu nav a {
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
}

.nav-menu nav a:hover {
    background: var(--surface-2);
    color: var(--heat-1);
}

/* ---------- Layout ---------- */

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 26px 20px 48px;
}

.site-footer {
    text-align: center;
    padding: 8px 20px 32px;
    color: var(--muted);
    font-size: 0.78rem;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -0.015em;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.page-heading h1 {
    margin: 0;
    font-size: 1.6rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
}

.card h2 {
    margin: 0 0 14px;
    font-size: 1.05rem;
}

/* ---------- Pizza list ---------- */

.pizza-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pizza-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pizza-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 138, 61, 0.45);
    box-shadow: var(--shadow);
}

.pizza-thumb {
    flex: 0 0 76px;
    width: 76px;
    height: 76px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-2);
}

.pizza-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pizza-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.pizza-thumb-placeholder img {
    object-fit: contain;
    opacity: 0.5;
}

.pizza-card-body {
    flex: 1;
    min-width: 0;
}

.pizza-card h2 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.25;
}

.meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 7px 0;
}

.chip {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
}

.pizza-date {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.pizza-date .price {
    color: var(--mint);
    font-weight: 700;
}

/* ---------- Score badge (the scoreboard moment) ---------- */

.score-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.score-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 9px 11px;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--heat-1), var(--heat-2));
    color: var(--ink-on-heat);
    font-family: var(--font-display);
    line-height: 1;
    box-shadow: 0 8px 20px rgba(255, 77, 77, 0.3);
}

.score-num { font-size: 1.3rem; }

.score-max {
    margin-top: 4px;
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 700;
    opacity: 0.72;
}

.score-badge-empty {
    background: none;
    border: 1px dashed var(--surface-3);
    color: var(--muted);
    box-shadow: none;
}

.score-count {
    font-size: 0.68rem;
    color: var(--muted);
    font-weight: 600;
}

/* ---------- Pizza detail ---------- */

.pizza-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.pizza-detail-head h1 {
    margin: 0 0 10px;
    font-size: 1.85rem;
    line-height: 1.12;
}

.pizza-detail-head .score-badge {
    min-width: 74px;
    padding: 13px;
}

.pizza-detail-head .score-num { font-size: 1.6rem; }

.added-by {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: var(--muted);
}

/* ---------- Forms ---------- */

label {
    display: block;
    margin: 16px 0 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 11px 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
}

textarea { resize: vertical; }

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(255, 138, 61, 0.65);
    box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.16);
}

input[type="file"] {
    width: 100%;
    padding: 11px;
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: 11px;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.83rem;
}

input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 7px 13px;
    border: none;
    border-radius: 8px;
    background: var(--surface-3);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.checkbox-label input {
    width: auto;
    accent-color: var(--heat-2);
}

.form-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

/* ---------- Star rating input ---------- */

.rating-group {
    border: 0;
    margin: 0 0 14px;
    padding: 0;
}

.rating-group legend {
    padding: 0;
    margin-bottom: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
}

.star-row {
    position: relative;
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 2px;
}

.star-row input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.star-row label {
    margin: 0;
    padding: 2px 3px;
    font-size: 1.85rem;
    line-height: 1;
    color: var(--surface-3);
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.12s ease, transform 0.12s ease;
}

.star-row input:checked ~ label { color: var(--star); }

.star-row label:hover,
.star-row label:hover ~ label { color: #ffd782; }

.star-row label:hover { transform: scale(1.12); }

.star-row input:focus-visible + label {
    outline: 2px solid var(--heat-1);
    outline-offset: 2px;
}

/* ---------- Buttons ---------- */

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--heat-1), var(--heat-2));
    color: var(--ink-on-heat);
    font-family: var(--font-body);
    font-size: 0.93rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(255, 77, 77, 0.26);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

button:hover, .button:hover {
    transform: translateY(-1px);
    filter: brightness(1.07);
    box-shadow: 0 10px 26px rgba(255, 77, 77, 0.34);
}

button:active, .button:active { transform: translateY(0); }

button:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
    filter: none;
}

/* :where() keeps this at zero specificity so component rules below win */
form :where(button[type="submit"]) { margin-top: 20px; }

.button-danger {
    margin-top: 0;
    padding: 7px 14px;
    background: transparent;
    border: 1px solid rgba(255, 107, 107, 0.45);
    color: var(--danger);
    font-size: 0.8rem;
    box-shadow: none;
}

.button-danger:hover {
    background: rgba(255, 107, 107, 0.14);
    filter: none;
    box-shadow: none;
}

.rating-submit {
    display: flex;
    justify-content: center;
    margin: 4px 0 24px;
}

.rating-submit button {
    margin-top: 0;
    padding: 14px 40px;
    font-size: 1rem;
    border-radius: 14px;
}

/* ---------- Alerts ---------- */

.alert {
    margin: 0 0 12px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 0.87rem;
}

.alert-error {
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.32);
    color: #ffb3b3;
}

.alert-success {
    background: rgba(79, 209, 165, 0.12);
    border: 1px solid rgba(79, 209, 165, 0.32);
    color: #8fe8cc;
}

#photo-upload-error:not(:empty) {
    margin-bottom: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 0.87rem;
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.32);
    color: #ffb3b3;
}

/* ---------- Photos ---------- */

.photo-upload-form {
    padding-bottom: 18px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border-soft);
}

.photo-group-heading {
    margin: 18px 0 9px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
}

.photo-thumb {
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.photo-thumb:hover img { transform: scale(1.07); }

/* ---------- Tables ---------- */

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ratings-table {
    width: 100%;
    min-width: 460px;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.ratings-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.ratings-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-soft);
}

.ratings-table tr:last-child td { border-bottom: none; }

/* ---------- Admin ---------- */

.user-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
}

.reset-pw summary {
    cursor: pointer;
    list-style: none;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
}

.reset-pw summary::-webkit-details-marker { display: none; }

.reset-pw summary:hover { color: var(--heat-1); }

.reset-pw-form {
    display: flex;
    gap: 7px;
    margin-top: 9px;
}

.reset-pw-form input {
    width: 150px;
    padding: 7px 10px;
    font-size: 0.83rem;
}

.reset-pw-form button {
    margin-top: 0;
    padding: 7px 14px;
    font-size: 0.83rem;
}

.inline-form { display: inline; }

/* ---------- Auth pages ---------- */

.auth-wrap {
    max-width: 380px;
    margin: 40px auto 0;
    text-align: center;
}

.auth-art {
    display: block;
    margin: 0 auto 14px;
    filter: drop-shadow(0 14px 34px rgba(255, 109, 64, 0.32));
}

.auth-card {
    max-width: 380px;
    margin: 0 auto 48px;
    text-align: left;
}

.auth-card h1 {
    margin: 0 0 4px;
    text-align: center;
    font-size: 1.45rem;
}

.auth-card h2 {
    margin: 22px 0 0;
    font-size: 1rem;
}

.auth-sub {
    margin: 0 0 6px;
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
}

/* ---------- Empty states ---------- */

.empty-state {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.empty-state-block {
    text-align: center;
    padding: 40px 0;
}

.empty-state-block img {
    opacity: 0.85;
    margin-bottom: 14px;
    filter: drop-shadow(0 12px 28px rgba(255, 109, 64, 0.25));
}

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
    main { padding: 20px 16px 40px; }

    .page-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .page-heading h1 { font-size: 1.45rem; }

    .page-heading .button { margin-top: 0; }

    .pizza-detail-head h1 { font-size: 1.5rem; }

    .card { padding: 17px; }
}
