/* ===========================================================================
   Pyrix Fireworks Finder — global stylesheet
   Mobile-first, iOS-inspired. Mirrors the look of /Template/* prototypes.
   =========================================================================== */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f2f2f7;
    color: #000;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

a {
    color: inherit;
    text-decoration: none;
}

.muted { color: #8e8e93; font-size: 14px; }

#page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: #f2f2f7;
    transition: transform .35s ease;
}

.slide-out { transform: translateX(-100%); }
.slide-in  { animation: slideIn .35s ease; }

@keyframes slideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.pointer { cursor: pointer; }

/* ─────────────────────────────────────────────────────────────────────────
   Header
   ───────────────────────────────────────────────────────────────────────── */

.header {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid #ddd;
    z-index: 5;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header.header--row .header-title {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 18px;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 20px;
}

.logo { font-weight: 600; }

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2c5d8f;
    font-size: 18px;
}

.header-right { color: #2c5d8f; font-size: 20px; }
.header-sub   { font-size: 14px; color: #666; text-align: center; margin-top: 2px; }

/* ─────────────────────────────────────────────────────────────────────────
   Search button (home)
   ───────────────────────────────────────────────────────────────────────── */

.search-row { padding: 12px 16px; }

.search-button {
    width: 100%;
    height: 44px;
    border-radius: 14px;
    border: none;
    background: #e9e9ec;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #8a8a8f;
}

.search-button:active { background: #dcdce0; }

/* ─────────────────────────────────────────────────────────────────────────
   Category list / grid
   ───────────────────────────────────────────────────────────────────────── */

.event-row {
    display: flex;
    align-items: center;
    padding: 16px;
    background: white;
    border-bottom: 1px solid #eee;
    color: #000;
}

.event-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 14px;
    flex-shrink: 0;
}

.event-icon.music  { background: #ff4d4d; }
.event-icon.sports { background: #4caf50; }
.event-icon.food   { background: #ff9800; }

.grid-mode {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
    background: #f2f2f7;
}

.grid-mode .event-row {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 12px;
    border: none;
    padding: 20px;
}

.grid-mode .event-icon {
    margin-right: 0;
    margin-bottom: 10px;
    width: 60px;
    height: 60px;
    font-size: 22px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Modal overlays (settings, search, location, review)
   ───────────────────────────────────────────────────────────────────────── */

.modalOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: none;
    align-items: flex-end;
    z-index: 500;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.modal {
    width: 100%;
    background: #f2f2f7;
    border-radius: 16px 16px 0 0;
    height: calc(100% - 20px);
    overflow: auto;
    animation: slideUp .25s ease;
    margin: 10px;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.modalHeader {
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.doneBtn {
    position: absolute;
    right: 16px;
    color: #007aff;
    font-weight: 500;
}

.sectionTitle {
    font-size: 12px;
    color: #777;
    padding: 18px 16px 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.settingItem {
    background: white;
    padding: 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: inherit;
}

.check { color: #007aff; }

/* Search modal header */

.searchHeader {
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
}

.searchHeader span { color: #007aff; font-weight: 500; }

.searchInputContainer {
    background: white;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.searchInputContainer > div {
    position: relative;
    padding: 16px;
    width: 100%;
}

.searchInputContainer .searchInput {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: #e5e5ea;
    padding: 0 16px 0 40px;
    font-size: 16px;
    outline: none;
}

.searchInputContainer .searchIcon {
    position: absolute;
    left: 28px;
    top: 28px;
    color: #8e8e93;
}

/* ─────────────────────────────────────────────────────────────────────────
   Results list (category page)
   ───────────────────────────────────────────────────────────────────────── */

.ad-banner {
    background: #e8edf3;
    padding: 18px;
    text-align: center;
    color: #2c5d8f;
    font-size: 20px;
    border-bottom: 1px solid #ddd;
}

.list { background: white; }

.item-row {
    padding: 16px;
    border-bottom: 1px solid #eee;
    position: relative;
    background: white;
    display: block;
}

.item-name {
    color: #2c5d8f;
    font-weight: 600;
    font-size: 20px;
    margin-bottom: 4px;
    margin-right: 60px;
}

.item-address { font-size: 18px; margin-right: 60px; }
.item-city { color: #8e8e93; margin-top: 4px; font-size: 16px; }

.note {
    margin-top: 8px;
    font-size: 16px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: #444;
}

.note i { font-size: 14px; margin-top: 4px; color: #2c5d8f; }

.distance {
    position: absolute;
    right: 16px;
    top: 22px;
    text-align: right;
}

.nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #2c5d8f;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2c5d8f;
    margin-bottom: 4px;
}

.miles { font-size: 16px; color: #000; }

.empty-state {
    padding: 40px 16px;
    text-align: center;
    color: #8e8e93;
    font-size: 16px;
}

.empty-state.small { padding: 20px 16px; font-size: 14px; }

.spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #c7c7cc;
    border-top-color: #2c5d8f;
    margin: 0 auto 12px;
    animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.results-map { width: 100%; height: calc(100vh - 120px); }

/* ─────────────────────────────────────────────────────────────────────────
   Event detail
   ───────────────────────────────────────────────────────────────────────── */

.map { width: 100%; height: 220px; background: #c7d6e5; }

.action-bar {
    display: flex;
    justify-content: space-around;
    background: white;
    padding: 14px 0;
    border-bottom: 1px solid #ddd;
}

.action-bar i {
    font-size: 26px;
    color: #2c5d8f;
}

.section-title {
    background: #e9e9ec;
    color: #2c5d8f;
    font-size: 14px;
    padding: 6px 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.row {
    background: white;
    padding: 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    color: #000;
}

.row i { color: #2c5d8f; font-size: 20px; }

.row.review-add { color: #2c5d8f; }
.row.muted { color: #8e8e93; }

.fa-solid.fa-star.is-favorite,
.fa-solid.fa-star { color: #f5b301; }

.hours {
    background: white;
    padding: 16px;
    text-align: center;
    font-size: 18px;
    line-height: 1.7;
}

.review {
    background: white;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border-bottom: 1px solid #eee;
}

.review .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #c7d6e5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.review-text { font-size: 16px; }
.review-meta { color: #888; font-size: 13px; margin-top: 4px; }
.review-stars { color: #f5b301; }

.photos {
    display: flex;
    gap: 10px;
    padding: 16px;
    background: white;
    overflow-x: auto;
}

.photos img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 6px;
    flex-shrink: 0;
}

.footer {
    text-align: center;
    padding: 22px;
    color: #2c5d8f;
    font-size: 18px;
}

/* Report modal */

.reportOverlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    z-index: 500;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.reportModal {
    width: 100%;
    padding: 10px;
    background: rgba(0,0,0,0);
}

.reportOption,
.reportCancel {
    width: 100%;
    padding: 18px;
    margin-bottom: 8px;
    border: none;
    background: white;
    font-size: 18px;
    border-radius: 12px;
}

.reportCancel { color: #007aff; font-weight: 600; }

/* ─────────────────────────────────────────────────────────────────────────
   Add Event form
   ───────────────────────────────────────────────────────────────────────── */

.form { background: white; padding: 16px; }

.form-group { margin-bottom: 16px; }

.form-group label,
.label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}

.form input,
.form textarea,
.form select,
.input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 16px;
    background: white;
    box-sizing: border-box;
}

.form textarea,
textarea.input { resize: vertical; min-height: 80px; }

.submit {
    display: block;
    width: calc(100% - 32px);
    margin: 20px 16px;
    padding: 16px;
    background: #2c5d8f;
    color: white;
    text-align: center;
    border-radius: 10px;
    font-size: 18px;
    border: none;
    cursor: pointer;
}

.submit[disabled] { opacity: 0.6; cursor: not-allowed; }

.form-error {
    margin: 12px 16px;
    padding: 12px;
    background: #ffe5e5;
    color: #b00020;
    border-radius: 8px;
    font-size: 14px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Legal pages
   ───────────────────────────────────────────────────────────────────────── */

.legal-list {
    background: white;
    padding: 20px;
    line-height: 1.6;
    font-size: 16px;
    margin: 0;
}

.legal-list h3 { color: #2c5d8f; margin-top: 24px; }

/* ─────────────────────────────────────────────────────────────────────────
   Photo thumbnails (in the event detail strip)
   ───────────────────────────────────────────────────────────────────────── */

.photo-thumb {
    flex-shrink: 0;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    overflow: hidden;
    transition: transform .12s ease, box-shadow .12s ease;
}

.photo-thumb:hover,
.photo-thumb:focus-visible {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    outline: none;
}

.photo-thumb img {
    display: block;
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: none;
    border-radius: 0;
}

/* ─────────────────────────────────────────────────────────────────────────
   Photo lightbox (event detail viewer)
   ───────────────────────────────────────────────────────────────────────── */

body.lightbox-open {
    overflow: hidden;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1500;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 16px;
    animation: lightboxFade .18s ease;
}

.lightbox.is-open { display: flex; }

@keyframes lightboxFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lightbox__stage {
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox__stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox__caption {
    padding: 12px 0 4px;
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    letter-spacing: .04em;
}

.lightbox__btn {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.12);
    color: white;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s ease, transform .12s ease;
    z-index: 1;
}

.lightbox__btn:hover { background: rgba(255,255,255,0.22); }
.lightbox__btn:active { transform: scale(.94); }

.lightbox__btn--close { top: 16px;  right: 16px; }
.lightbox__btn--prev  { left: 16px;  top: 50%; transform: translateY(-50%); }
.lightbox__btn--next  { right: 16px; top: 50%; transform: translateY(-50%); }

.lightbox__btn--prev:active { transform: translateY(-50%) scale(.94); }
.lightbox__btn--next:active { transform: translateY(-50%) scale(.94); }

@media (max-width: 480px) {
    .lightbox__btn { width: 40px; height: 40px; font-size: 16px; }
    .lightbox__btn--close { top: 10px; right: 10px; }
    .lightbox__btn--prev  { left: 8px; }
    .lightbox__btn--next  { right: 8px; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Toast (used by share, favorites, etc.)
   ───────────────────────────────────────────────────────────────────────── */

.pyrix-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 24px;
    z-index: 1000;
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.pyrix-toast.show { opacity: 1; }

/* ─────────────────────────────────────────────────────────────────────────
   Tablet / desktop adjustments
   ───────────────────────────────────────────────────────────────────────── */

/*@media (min-width: 768px) {
    #page { max-width: 480px; margin: 0 auto; box-shadow: 0 0 24px rgba(0,0,0,.05); }
    body  { background: #e9e9ec; }
}
*/