* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0; background: #f7f7f9; color: #222;
}
.small { font-size: 0.85rem; color: #666; }
.error { color: #c0392b; }
.success { color: #27ae60; }
code { background: #eee; padding: 2px 6px; border-radius: 4px; word-break: break-all; }

/* --- Map homepage --- */
.map-page { display: flex; flex-direction: column; height: 100vh; margin: 0; }
.map-header {
    background: #3E227F; color: #fff; padding: 0.6rem 1.2rem;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 0.6rem;
    z-index: 500; flex-shrink: 0;
}
.map-header h1 { margin: 0; font-size: 1.3rem; color: #fff; }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.logo, img.logo {
    height: 34px !important;
    width: auto !important;
    max-width: 220px !important;
    max-height: 34px !important;
    display: block;
    object-fit: contain;
}
.logo-large, img.logo-large {
    height: 48px !important;
    width: auto !important;
    max-width: 300px !important;
    max-height: 48px !important;
    display: block;
    object-fit: contain;
}
.logo-small, img.logo-small {
    height: 40px !important;
    width: auto !important;
    max-width: 200px !important;
    max-height: 40px !important;
    display: block;
    margin: 0 auto 0.8rem;
    object-fit: contain;
}
.download-single {
    margin: 0; padding: 0.3rem 1rem 0;
}
.download-single a {
    display: inline-block; font-size: 0.85rem;
    color: #222; text-decoration: none;
    padding: 0.3rem 0.7rem; border: 1px solid #ccc;
    border-radius: 5px; background: #fafafa;
}
.download-single a:hover { background: #eee; }
.admin-link {
    font-size: 0.9rem; color: #222; text-decoration: none;
    padding: 0.4rem 0.9rem; border: 1px solid #ccc; border-radius: 6px;
    white-space: nowrap;
}
.map-header-right {
    display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
}
.admin-link:hover { background: #f0f0f0; }

.map-filters {
    display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
    font-size: 0.85rem; color: #fff;
}
.filter-caption { color: #fff; }
.map-filters input[type="date"] {
    padding: 0.35rem 0.5rem;
    border: none; border-radius: 4px; background: #fff; color: #333;
    font-size: 0.85rem; min-width: 130px;
}
.map-filters button {
    padding: 0.35rem 0.9rem; border: none; border-radius: 4px;
    background: #fff; color: #3E227F; cursor: pointer;
    font-size: 0.8rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.03em;
}
.map-filters button:hover { background: #e8e0f5; }

#map { flex: 1; min-height: 0; }

/* Sidebar notice floating over the map */
.side-notice {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: #3E227F;
    color: #fff;
    padding: 1.5rem 1rem;
    border-radius: 6px;
    max-width: 200px;
    text-align: center;
    z-index: 450;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.notice-tag { font-size: 0.85rem; margin: 0 0 0.6rem; }
.oxannie-logo {
    height: 32px; width: auto; display: block; margin: 0 auto 1rem;
    filter: brightness(0) invert(1);
}
.notice-body { font-size: 0.8rem; margin: 0.6rem 0; line-height: 1.4; }
.notice-mail {
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; margin-top: 0.6rem;
    padding: 0.4rem; border-radius: 6px;
    transition: background 0.15s;
}
.notice-mail:hover { background: rgba(255,255,255,0.15); }

/* Event access modal (opens over map when marker clicked) */
.event-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex; align-items: center; justify-content: center;
    z-index: 1500;
    padding: 1rem;
}
.event-modal.hidden { display: none; }
.event-modal-inner {
    background: #fff;
    max-width: 420px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    position: relative;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.event-modal-inner h2 { margin: 0.3rem 0; }
.event-modal-inner p { color: #555; margin: 0.4rem 0; }
.event-modal-inner form {
    display: flex; flex-direction: column; gap: 0.7rem;
    margin: 1rem 0;
}
.event-modal-inner input[type="password"] {
    padding: 0.7rem; border: 1px solid #ccc; border-radius: 8px;
    font-size: 1rem;
}
.event-modal-inner .modal-primary {
    display: block;
    padding: 0.7rem; background: #3E227F;
    color: #fff; border: none; border-radius: 8px;
    font-size: 1rem; cursor: pointer;
    text-decoration: none; text-align: center;
    font-weight: 600;
}
.event-modal-inner .modal-primary:hover { background: #2f1a63; }
.event-modal-inner a { color: #3E227F; }
.event-modal-close {
    display: block; margin: 1rem auto 0;
    width: 44px; height: 44px; line-height: 40px;
    border-radius: 50%; border: 2px solid #ccc;
    color: #666; font-size: 1.6rem; cursor: pointer;
    text-align: center;
}
.event-modal-close:hover { border-color: #666; color: #222; }

/* --- Password gates --- */
.gate-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.gate-box {
    background: #fff; padding: 2.5rem; border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08); max-width: 380px; width: 90%; text-align: center;
}
.gate-box input[type="password"] {
    width: 100%; padding: 0.7rem; margin: 1rem 0;
    border: 1px solid #ccc; border-radius: 8px; font-size: 1rem;
}
.gate-box button {
    width: 100%; padding: 0.7rem; background: #222; color: #fff;
    border: none; border-radius: 8px; font-size: 1rem; cursor: pointer;
}

/* --- Event page --- */
.event-header { background: #fff; padding: 1.5rem; text-align: center; border-bottom: 1px solid #eee; }
.event-header-top {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.5rem;
}
.breadcrumb-link {
    color: #3E227F; text-decoration: none; font-size: 0.9rem;
}
.breadcrumb-link:hover { text-decoration: underline; }
.manage-btn {
    font-size: 0.85rem; font-weight: 600;
    color: #fff; background: #3E227F;
    text-decoration: none;
    padding: 0.4rem 0.9rem; border-radius: 6px;
    transition: background 0.15s;
}
.manage-btn:hover { background: #2f1a63; }
.event-header h1 { margin: 0.3rem 0; }
.breadcrumb { text-align: left; margin: 0; }
.event-meta { color: #777; margin: 0.2rem 0 0.8rem; }
.event-description { max-width: 700px; margin: 0 auto; color: #555; line-height: 1.5; }

.upload-box {
    background: #fff; margin: 1.2rem auto; padding: 1.2rem;
    max-width: 700px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
}
.upload-box h2 { margin-top: 0; font-size: 1.1rem; }
#upload-form { display: flex; flex-direction: column; gap: 0.6rem; align-items: center; }
#upload-form input[type="text"] {
    padding: 0.55rem; border: 1px solid #ccc; border-radius: 6px; width: 100%; max-width: 320px;
}
#upload-form button {
    padding: 0.55rem 1.4rem; border: none; border-radius: 6px;
    background: #222; color: #fff; cursor: pointer;
}
#upload-status { font-size: 0.85rem; color: #27ae60; }

.toolbar {
    display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap;
    padding: 1rem; position: sticky; top: 0; background: #f7f7f9; z-index: 10;
}
.toolbar button { padding: 0.6rem 1.2rem; border: none; border-radius: 8px; cursor: pointer; }
#download-btn { background: #222; color: #fff; }
#select-all, #select-none { background: #e5e5e5; }

.grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem; padding: 0 1.25rem 2rem;
}
.photo-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.photo-select { position: relative; display: block; cursor: pointer; }
.photo-select img, .video-poster {
    width: 100%; display: block; aspect-ratio: 4/3; object-fit: cover;
}
.video-poster {
    display: flex; align-items: center; justify-content: center;
    background: #1a1a1a; color: #fff; font-size: 3rem;
}
.video-thumb-wrap {
    position: relative; display: block;
    width: 100%; aspect-ratio: 4/3; background: #000;
    cursor: pointer; overflow: hidden;
}
.video-thumb-wrap img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.video-thumb-wrap .play-icon {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #fff; font-size: 2.6rem;
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
    pointer-events: none;
}
.photo-select .photo-checkbox { position: absolute; top: 10px; left: 10px; width: 22px; height: 22px; z-index: 2; }
.uploader { padding: 0.3rem 1rem 0; margin: 0; }
.download-single { padding: 0.2rem 1rem 0; margin: 0; text-align: right; }
.download-single a {
    font-size: 0.85rem; color: #222; text-decoration: none;
    padding: 0.25rem 0.6rem; border: 1px solid #ccc; border-radius: 6px;
    display: inline-block;
}
.download-single a:hover { background: #f0f0f0; }

.comments-section { padding: 0.8rem 1rem 1rem; }
.comments-list { max-height: 140px; overflow-y: auto; margin-bottom: 0.6rem; }
.comment { font-size: 0.88rem; padding: 0.3rem 0; border-bottom: 1px solid #f0f0f0; }
.comment-body { display: inline; }
.reply-btn {
    background: none; border: none; color: #3E227F;
    font-size: 0.75rem; cursor: pointer; padding: 0 0.3rem;
    text-decoration: underline;
}
.reply-btn:hover { color: #2f1a63; }
.comment-children {
    margin-left: 1rem;
    padding-left: 0.6rem;
    border-left: 2px solid #eee;
    margin-top: 0.2rem;
}
.reply-form-slot { margin: 0.3rem 0; }
.reply-form {
    display: flex; flex-direction: column; gap: 0.3rem;
    padding: 0.4rem; margin-left: 0.6rem;
    background: #f9f7ff; border-radius: 6px;
    border: 1px solid #e5e0f5;
}
.reply-form input, .reply-form textarea {
    padding: 0.4rem; border: 1px solid #ddd; border-radius: 5px;
    font-family: inherit; font-size: 0.85rem; resize: vertical;
}
.reply-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }
.reply-actions button {
    padding: 0.3rem 0.7rem; border: none; border-radius: 5px;
    font-size: 0.8rem; cursor: pointer;
}
/* --- Request access modal --- */
.request-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.request-modal.hidden { display: none; }
.request-modal-inner {
    background: #fff;
    max-width: 500px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    border-radius: 12px; padding: 2rem;
    position: relative;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
#request-modal-close {
    position: absolute; top: 12px; right: 18px;
    color: #666; font-size: 1.8rem; cursor: pointer;
    line-height: 1;
}
.request-modal-inner h2 { margin-top: 0; }
.request-modal-inner form {
    display: flex; flex-direction: column; gap: 0.7rem;
}
.request-modal-inner label {
    display: block; font-size: 0.9rem; font-weight: 600;
}
.request-modal-inner label input,
.request-modal-inner label textarea {
    width: 100%; padding: 0.55rem;
    margin-top: 0.25rem;
    border: 1px solid #ccc; border-radius: 6px;
    font-family: inherit; font-size: 0.9rem;
    font-weight: normal;
    resize: vertical;
}
.request-modal-inner button[type="submit"] {
    padding: 0.65rem; border: none; border-radius: 6px;
    background: #3E227F; color: #fff; cursor: pointer;
    font-size: 0.95rem; font-weight: 600;
}
.request-modal-inner .checkbox-label {
    font-weight: normal;
    display: flex; align-items: flex-start; gap: 0.5rem;
    font-size: 0.85rem;
}
.request-modal-inner .checkbox-label input { width: auto; margin: 0; }

/* --- Legal footers on gate + event album --- */
.gate-legal, .event-footer {
    padding: 0.6rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}
.gate-legal {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.9);
    border-top: 1px solid #eee;
    z-index: 400;
}
.event-footer {
    background: #3E227F; color: #fff;
    padding: 0.7rem 1.2rem; margin-top: 2rem;
    text-align: right;
}
.gate-legal a { color: #3E227F; text-decoration: none; margin: 0 0.4rem; }
.event-footer a { color: #fff; text-decoration: none; margin: 0 0.4rem; }
.gate-legal a:hover, .event-footer a:hover { text-decoration: underline; }

/* --- Access request cards (in moderate panel) --- */
.access-request {
    padding: 0.8rem; border-radius: 8px;
    background: #fafafa; margin-bottom: 0.8rem;
    border-left: 4px solid #ccc;
}
.access-request-notified { border-left-color: #f39c12; }
.access-request-pending  { border-left-color: #f39c12; }
.access-request-handled  { border-left-color: #27ae60; opacity: 0.75; }
.access-request p { margin: 0.2rem 0; }
.req-status {
    display: inline-block; padding: 0.1rem 0.5rem;
    border-radius: 4px; font-size: 0.75rem;
    background: #eee; color: #333; margin-left: 0.4rem;
    text-transform: uppercase;
}
.req-reason { color: #555; }
.req-actions { margin-top: 0.5rem; display: flex; gap: 0.5rem; }
.req-actions button {
    padding: 0.4rem 0.8rem; border: none; border-radius: 5px;
    color: #fff; cursor: pointer; font-size: 0.8rem;
}

/* --- Legal pages (privacy, terms) --- */
.legal-page { background: #fff; }
.legal-header {
    padding: 1.5rem; text-align: center;
    border-bottom: 1px solid #eee;
}
.legal-header a { text-decoration: none; color: #3E227F; }
.legal-content {
    max-width: 780px; margin: 0 auto;
    padding: 2rem 1.5rem;
    line-height: 1.65;
}
.legal-content h1 { margin-top: 0; }
.legal-content h2 {
    margin-top: 2rem; padding-top: 0.5rem;
    border-top: 1px solid #eee;
    color: #3E227F;
}
.legal-content a { color: #3E227F; }
.legal-content ul { padding-left: 1.4rem; }
.legal-content li { margin: 0.3rem 0; }
.legal-footer {
    background: #f7f7f9; padding: 1.5rem;
    text-align: center; margin-top: 3rem;
    border-top: 1px solid #eee;
}
.comment-form { display: flex; flex-direction: column; gap: 0.4rem; }
.comment-form input, .comment-form textarea {
    padding: 0.5rem; border: 1px solid #ddd; border-radius: 6px;
    font-size: 0.88rem; font-family: inherit; resize: vertical;
}
.comment-form button {
    align-self: flex-end; padding: 0.4rem 0.9rem; border: none;
    border-radius: 6px; background: #222; color: #fff; cursor: pointer; font-size: 0.85rem;
}

/* --- Lightbox --- */
.lightbox {
    position: fixed; inset: 0; background: rgba(0,0,0,0.92);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.lightbox.hidden { display: none; }
.lightbox img, .lightbox video { max-width: 92%; max-height: 92%; object-fit: contain; }
.lightbox img.hidden, .lightbox video.hidden { display: none; }
#lightbox-close { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 2.2rem; cursor: pointer; z-index: 1001; }

/* --- Admin & moderation --- */
.admin-page { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }
.admin-box {
    background: #fff; padding: 1.5rem; border-radius: 10px;
    margin-bottom: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.admin-box label { display: block; margin-bottom: 0.9rem; font-weight: 600; }
.admin-box input[type="text"], .admin-box input[type="date"], .admin-box textarea {
    width: 100%; padding: 0.6rem; margin-top: 0.3rem;
    border: 1px solid #ccc; border-radius: 6px; font-weight: normal; font-family: inherit;
}
.checkbox-label { font-weight: normal; }
.checkbox-label input { margin-right: 0.4rem; }
.inline-search { display: flex; gap: 0.5rem; margin-top: 0.3rem; }
.inline-search input { flex: 1; }
.inline-search button { white-space: nowrap; }
.admin-box button {
    padding: 0.6rem 1.3rem; border: none; border-radius: 6px;
    background: #222; color: #fff; cursor: pointer;
}
#pick-map { height: 320px; border-radius: 8px; margin: 0.5rem 0; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 0.6rem; border-bottom: 1px solid #eee; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.admin-photo img, .admin-photo video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: #000; }
.admin-photo button { width: 100%; margin-top: 0.4rem; padding: 0.35rem; border: none; border-radius: 6px; background: #c0392b; color: #fff; cursor: pointer; font-size: 0.8rem; }
.admin-video-wrap {
    position: relative; display: block;
    width: 100%; aspect-ratio: 1; overflow: hidden;
    border-radius: 6px; cursor: pointer; background: #000;
}
.admin-video-wrap img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.admin-video-play {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #fff; font-size: 2.2rem;
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
    pointer-events: none;
}
.video-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.92);
    display: flex; align-items: center; justify-content: center;
    z-index: 1200;
}
.video-modal.hidden { display: none; }
.video-modal video {
    max-width: 92%; max-height: 92%; object-fit: contain;
}
#video-modal-close {
    position: absolute; top: 20px; right: 30px;
    color: #fff; font-size: 2.2rem; cursor: pointer; z-index: 1201;
}
.mod-actions { display: flex; gap: 0.4rem; }
.mod-actions form { flex: 1; }
.btn-approve { background: #27ae60 !important; }
.btn-reject { background: #c0392b !important; }
.btn-mini-reject {
    background: #c0392b; color: #fff; border: none;
    border-radius: 4px; padding: 0.05rem 0.4rem;
    font-size: 0.75rem; cursor: pointer;
    margin-left: 0.4rem;
}
.mod-comments {
    margin-top: 0.5rem; padding: 0.4rem;
    background: #fafafa; border-radius: 6px;
    max-height: 160px; overflow-y: auto;
    text-align: left;
}
.mod-comment {
    font-size: 0.8rem;
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 0.25rem 0; border-bottom: 1px solid #eee;
}
.mod-comment > div { flex: 1; word-break: break-word; }
.mod-comment form { margin: 0; }
.pending-cell {
    background: #fff3cd; font-weight: bold; color: #856404;
}
.link-btn {
    background: none !important; border: none !important;
    color: #c0392b !important; padding: 0 !important;
    font-size: inherit !important; cursor: pointer;
    text-decoration: underline;
}
.actions-cell { white-space: nowrap; font-size: 0.85rem; }
#qrcode { display: flex; justify-content: center; margin: 0.8rem 0; }
