/* -----------------------------
 *  Global layout primitives
 *  ----------------------------- */

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

body, button {
    /*font-family: system-ui, sans-serif;*/
    font-family: "Snell Roundhand", "Brush Script MT", cursive;
    background: #fffcf6;
    color: #9b8a56;
}

body.preload {
    visibility: hidden;
}

/* Hide utility */
[hidden] {
    display: none !important;
}

* {
    -webkit-tap-highlight-color: transparent;
}

/* Remove focus outline for mouse interaction */
button,
a,
img,
div {
    outline: none;
}

/* Prevent image drag & selection */
img {
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
}

/* -----------------------------
 *  Login Screen
 *  ----------------------------- */

.login-screen {
    position: fixed;
    inset: 0;
    background: #fffcf6;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 360px;

    background: #fdf6d9;
    padding: 2rem 1.5rem;
    border-radius: 18px;

    box-shadow: 
        0 0 0 1px rgba(255,255,255,0.06),
        0 6px 24px rgba(0,0,0,0.25),
        0 0 20px rgba(255,255,255,0.06);
    text-align: center;
}

.login-card h2 {
    margin: 0 0 1.5rem 0;
    font-weight: 600;
}

.login-card input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.9rem;

    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 0.95rem;
    text-align: center;
}

.login-card input:focus {
    outline: none;
    border-color: #111;
}

.login-card button {
    width: 100%;
    padding: 0.8rem;

    border-radius: 10px;
    border: none;

    background: #ad9b66;
    color: #faeeca;

    font-size: 1.2rem;
    font-weight: 500;
}

.login-card button:disabled {
    opacity: 0.5;
}

.login-error {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #c0392b;
    min-height: 1.2em;
}

/* -----------------------------
 *  Main layout
 *  ----------------------------- */

main {
    padding: 1rem;
    padding-bottom: 5.5rem; /* space for bottom nav */
    max-width: 480px;
    margin: 0 auto;
}

/* -----------------------------
 *  Event header card
 *  ----------------------------- */

 .event-header {
    background: #fdf6d9;
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    padding-bottom: 0.25rem; 
    margin-bottom: 1.5rem;

    position: relative;
    z-index: 1;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.06),
        0 6px 24px rgba(0,0,0,0.25),
        0 0 20px rgba(255,255,255,0.06);
    
    transition: box-shadow 0.3s ease;
}

/* Title */
.event-name {
    margin: 0 0 1.25rem 0;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
}

/* Two-column stats */
.event-stats {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

/* Vertical divider between stat blocks */
.stat-block + .stat-block {
    position: relative;
}

.stat-block + .stat-block::before {
    content: "";
    position: absolute;
    left: -0.5rem;
    top: 10%;
    bottom: 10%;
    width: 1px;
    background: rgba(0, 0, 0, 0.08);
}

.stat-block {
    flex: 1;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.5rem;
    opacity: 0.6;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Account row */
.event-account {
    display: flex;
    flex-direction: column;   /* stack username above buttons */
    align-items: center;      /* center horizontally */
    gap: 0.4rem;              /* spacing between username and buttons */
    flex-wrap: wrap;
    text-align: center;
}

.event-user {
    font-size: 0.9rem;
    font-weight: 500;
}

.account-buttons {
    display: flex;
    gap: 0.4rem;              /* spacing between buttons */
}

.account-logout-btn,
.account-delete-btn {
    width: auto;
    height: auto;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.account-logout-btn .btn-icon,
.account-delete-btn .btn-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

/* Slight interaction feedback */
.account-logout-btn:active,
.account-delete-btn:active {
    transform: scale(0.95);
}

 /*
.event-header {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.25rem 1rem;
    text-align: center;
    margin-bottom: 1.25rem;
}

.event-name {
    margin: 0;
    font-size: 1.4rem;
}

.event-user {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    opacity: 0.7;
}

.event-quota {
    margin-top: 0.75rem;
}

.quota-number {
    font-size: 2rem;
    font-weight: 600;
    display: block;
}

.quota-label {
    font-size: 0.85rem;
    opacity: 0.7;
}
*/

/* -----------------------------
 *  Gallery section
 *  ----------------------------- */

.gallery-section {
    width: 100%;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

/* Square thumbnails */
.gallery img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.gallery img:active {
    transform: scale(0.97);
}

.photo-wrapper {
    position: relative;
    display: inline-block;
}

.photo-controls {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.photo-controls button {
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
}

.delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
}

#gallery {
    transition: opacity 0.25s ease-in-out;
}

#gallery.fade-out {
    opacity: 0;
}

#gallery.fade-in {
    opacity: 1;
}

/* -----------------------------
 *  Lightbox
 *  ----------------------------- */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 1000;
}

.lightbox img {
    max-width: 95%;
    max-height: 90%;
    border-radius: 12px;
    object-fit: contain;
}

/* Action container (top-right) */
.lightbox-actions {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    display: flex;
    gap: 0.75rem;
}

/* Buttons */
.lb-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: rgb(205,187,131,0.8);
    backdrop-filter: blur(6px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Icons */
.lb-btn img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

/* Interaction feedback */
.lb-btn:active {
    transform: scale(0.95);
}

.lightbox-caption {
    position: absolute;
    bottom: 35px;            /* small gap from bottom */
    left: 50%;
    transform: translateX(-50%);
    color: white;
    /*font-size: 0.9rem;*/
    background: rgba(205,187,131,0.5);
    padding: 12px 16px;
    border-radius: 6px;
    pointer-events: none;    /* so clicks pass through */
    max-width: 90%;
    text-align: center;
}

#lightboxImage {
    transition: opacity 0.6s ease-in-out;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* -----------------------------
 *  Bottom navigation
 *  ----------------------------- */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;

    height: 4.5rem;
    background: #fdf6d9;

    display: flex;
    justify-content: space-around;
    align-items: center;

    border-top: 1px solid rgba(0, 0, 0, 0.08);

    
    z-index: 10;

    border-radius: 18px; /* slightly rounder feels more premium */

    box-shadow:
        0 0 0 1px rgba(255,255,255,0.06),   /* subtle outline */
        0 -6px 24px rgba(0,0,0,0.25),       /* lifted from bottom */
        0 0 20px rgba(255,255,255,0.05);    /* soft glow */

    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.nav-btn {
    position: relative;
    width: 50px;
    height: 50px;
    border: none;
    background: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

/* Icon styling */
.nav-btn img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    display: block;
    z-index: 1;
}

/* Active state: circular highlight behind icon */
.nav-btn.active::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0.1);
    border-radius: 50%;
    z-index: 0;
}

/* Slight tap feedback */
.nav-btn:active {
    transform: scale(0.95);
}

.nav-camera {
    background: #cdbb83;               /* darker background for emphasis */
    border-radius: 12px;            /* rounded rectangle */
    padding: 0.5rem;                /* internal spacing */
    width: 60px;                     /* same size as other buttons */
    height: 60px;                    /* ensures alignment */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

/* Icon inside camera button */
.nav-camera img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    display: block;
    z-index: 1;
}

.nav-camera:disabled img {
    filter: grayscale(40%) opacity(0.2);
}

/* Optional highlight for active camera button */
.nav-camera.active::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);  /* subtle highlight */
    border-radius: 12px;
    z-index: 0;
}