/* public/style.css */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.container {
    max-width: 700px;
    width: 100%;
    background-color: #fff;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

h1, h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

input[type="text"] {
    width: calc(100% - 22px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

button {
    background-color: #3498db;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

.url-box {
    background-color: #ecf0f1;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    word-wrap: break-word;
}

.url-box p {
    margin: 0 0 10px 0;
    font-weight: bold;
}

.url-box a {
    color: #2980b9;
    text-decoration: none;
}
.url-box a:hover {
    text-decoration: underline;
}

#booth-list, #view-list {
    margin-top: 20px;
    padding: 0;
    list-style: none;
}

#booth-list li, #view-list li {
    background-color: #f9f9f9;
    padding: 15px;
    border: 1px solid #eee;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.congestion-status {
    padding: 5px 15px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
    margin-left: auto;
}
.status-1 { background-color: #2ecc71; } /* 空き */
.status-2 { background-color: #f39c12; } /* やや混雑 */
.status-3 { background-color: #e74c3c; } /* 混雑 */

.congestion-buttons button {
    margin: 0 5px;
    padding: 10px 15px;
    font-size: 14px;
}

/* 画像ギャラリーとライトボックス */
.image-gallery { display: flex; gap: 8px; flex-wrap: wrap; }
.image-gallery .thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 1px solid #eee; }

#lightbox { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 1000; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.lightbox-image { position: relative; max-width: 90%; max-height: 90%; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }

.event-image {
    width: 96px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
    flex-shrink: 0;
    background-color: #fff;
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-info small {
    color: #666;
}

@media (max-width: 600px) {
    #booth-list li, #view-list li {
        flex-wrap: wrap;
    }
    .congestion-status {
        margin-left: 0;
    }
    .event-image {
        width: 80px;
        height: 60px;
    }
}

/* ========================= */
/* View page specific styles */
/* ========================= */
body.view-page {
    background: linear-gradient(180deg, #ddeef9 0%, #f5f7f9 100%);
    padding: 0;
    display: block;
}

body.view-page .view-wrapper {
    max-width: 430px;
    min-height: 100vh;
    margin: 0 auto;
    background-color: #fdfefe;
    border: 1px solid rgba(0, 122, 204, 0.18);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    position: relative;
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 16px;
    background: linear-gradient(180deg, #e8f3fb 0%, #ffffff 90%);
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: #0a2d4d;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.brand-mark .brand-accent {
    display: block;
    width: 52px;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, #0aa6d9 0%, #39c5ef 100%);
}

.menu-button {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(180deg, #42c2f1 0%, #1f8ccd 100%);
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 0;
    box-shadow: 0 6px 16px rgba(31, 140, 205, 0.3);
}

.menu-button span {
    display: block;
    width: 22px;
    height: 3px;
    background-color: #ffffff;
    border-radius: 3px;
}

.hero-banner {
    height: 120px;
    background: linear-gradient(180deg, rgba(10, 166, 217, 0.45) 0%, rgba(255, 255, 255, 0) 100%);
}

.view-main {
    flex: 1;
    padding: 0 24px 24px;
}

.menu-panel {
    position: absolute;
    top: 88px;
    right: 24px;
    left: 24px;
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(10, 166, 217, 0.2);
    box-shadow: 0 20px 40px rgba(15, 132, 176, 0.22);
    padding: 18px 20px;
    z-index: 30;
}

.menu-panel.open {
    animation: menuFadeIn 0.18s ease-out;
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-item {
    display: flex;
}

.menu-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    background: linear-gradient(180deg, rgba(10, 166, 217, 0.08) 0%, rgba(10, 166, 217, 0.02) 100%);
    color: #0a2d4d;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.menu-link::after {
    content: '\2192';
    font-size: 16px;
    color: #0f84b0;
}

.menu-link:hover,
.menu-link:focus {
    border-color: rgba(31, 140, 205, 0.4);
    outline: none;
    transform: translateX(2px);
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 20, 34, 0.28);
    z-index: 20;
    backdrop-filter: blur(2px);
}

.menu-overlay.visible {
    animation: menuOverlayFade 0.18s ease-out;
}

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

body.view-page.menu-open {
    overflow: hidden;
}

.section {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
    padding: 20px 20px 24px;
    border: 1px solid rgba(10, 166, 217, 0.18);
}

.section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 2px solid #0aa6d9;
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.section-label h2 {
    margin: 0;
    font-size: 20px;
    color: #121e2d;
    letter-spacing: 0.02em;
}

.section-caret {
    width: 18px;
    height: 18px;
    background:
        linear-gradient(135deg, transparent 45%, #121e2d 45%, #121e2d 55%, transparent 55%),
        linear-gradient(225deg, transparent 45%, #121e2d 45%, #121e2d 55%, transparent 55%);
}

.event-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.event-name-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #121e2d;
}

.event-meta-row {
    display: flex;
    gap: 30px;
    font-size: 14px;
    color: #314055;
    flex-wrap: wrap;
}

.event-field-label {
    font-weight: 700;
    margin-right: 6px;
    color: #0a2d4d;
}

.event-detail-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-detail-title {
    font-size: 16px;
    font-weight: 700;
    color: #0a2d4d;
    margin: 0;
}

.event-detail-placeholder {
    background: #d9dde2;
    border-radius: 12px;
    padding: 36px 16px;
    color: #5b636d;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 14px;
}

.auto-update-note {
    margin: 0 0 16px;
    font-size: 13px;
    color: #4e5b6b;
    letter-spacing: 0.02em;
}

.group-collection {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.crowd-group {
    border: 1px solid rgba(15, 132, 176, 0.14);
    border-radius: 14px;
    padding: 18px 18px 20px;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.group-order {
    font-size: 18px;
    font-weight: 700;
    color: #0f84b0;
    padding-right: 14px;
    border-right: 3px solid #0aa6d9;
}

.group-title-wrapper {
    display: flex;
    flex-direction: column;
}

.group-title {
    margin: 0;
    font-size: 17px;
    color: #0a2d4d;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.group-description-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.group-map-placeholder {
    min-height: 110px;
    border-radius: 12px;
    background: linear-gradient(180deg, #d4d9de 0%, #e6eaee 100%);
    color: #49515b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.group-map-image {
    width: 100%;
    min-height: 110px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(10, 166, 217, 0.22);
    background-color: #d4d9de;
    margin-bottom: 4px;
}

.group-tips {
    margin: 0;
    padding-left: 20px;
    color: #4e5b6b;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.group-status-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-status-item {
    background: #f5f7f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid rgba(15, 132, 176, 0.12);
    flex-wrap: wrap;
}

.group-status-index {
    min-width: 28px;
    color: #0f84b0;
    font-size: 15px;
    font-weight: 700;
}

.group-status-name {
    font-size: 15px;
    color: #112437;
    font-weight: 600;
    flex: 1;
}

.group-status-badge {
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    min-width: 72px;
}

.group-status-updated {
    font-size: 11px;
    color: #77889a;
    flex-basis: 100%;
    margin-left: 42px;
    margin-top: 2px;
}

body.view-page .group-status-badge.status-1 {
    background: linear-gradient(180deg, #17c964 0%, #13a454 100%);
}

body.view-page .group-status-badge.status-2 {
    background: linear-gradient(180deg, #fbd249 0%, #f39c12 100%);
}

body.view-page .group-status-badge.status-3 {
    background: linear-gradient(180deg, #f35b5b 0%, #d43131 100%);
}

body.view-page .group-status-badge.status-unknown {
    background: linear-gradient(180deg, #8d99a6 0%, #6b7685 100%);
}

.view-footer {
    margin-top: auto;
    padding: 24px 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, #ffffff 0%, #e9f3fb 100%);
}

.scroll-top-button {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(180deg, #1fb4e1 0%, #0f84b0 100%);
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 132, 176, 0.28);
}

.scroll-top-button:hover {
    filter: brightness(1.05);
}

.footer-logo-image {
    height: 42px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 520px) {
    body.view-page .view-wrapper {
        max-width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .menu-panel {
        right: 18px;
        left: 18px;
        top: 82px;
    }

    .view-main {
        padding: 0 18px 24px;
    }

    .section {
        padding: 18px 16px 22px;
    }

    .group-status-item {
        padding: 10px 12px;
        gap: 10px;
    }

    .group-status-updated {
        margin-left: 0;
    }
}
