* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, #eaf7f4 0%, #eef3fb 100%);
    background-attachment: fixed;
    min-height: 100%;
    width: 100%;
}

@font-face {
    font-family: Font;
    src: url("IBMPlexSansThai-Medium.ttf");
}

* {
    font-family: Font, sans-serif;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
}

.header {
    margin: 0;
    padding: 0;
    text-align: center;
    width: 100%;
}

.header img {
    width: 100%;
    display: block;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding-left: 10px;
    padding-right: 10px;
    text-align: center;
}

.home-container {
    max-width: 1200px;
}

.coming-soon {
    text-align: center;
    padding: 5em 1em;
    margin: 2em auto;
    background: linear-gradient(135deg, #2f7fc4 0%, #164b7f 55%, #081d33 100%);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(13, 77, 140, 0.12);
}

.coming-soon h1 {
    color: white;
    font-size: 3em;
    margin: 0 0 0.3em;
    animation: comingSoonPulse 2.5s ease-in-out infinite;
}

.coming-soon p {
    color: white;
    font-size: 1.7em;
    margin: 0;
    animation: comingSoonPulse 2.5s ease-in-out infinite;
    animation-delay: 0.2s;
}

@keyframes comingSoonPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.coming-soon-footer {
    text-align: center;
    color: #0D4D8C;
    font-size: 1.1em;
    padding: 1.5em 1em 2.5em;
}

.success-viewer {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a2540;
    padding: 2em 1em;
    position: relative;
    overflow: auto;
}

.success-viewer img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 10px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    cursor: zoom-in;
    transition: max-width 0.2s ease, max-height 0.2s ease;
}

/* Tap/click the map to see it at full resolution — the poster is dense with
   small print, so mobile visitors need a way past the shrink-to-fit view.
   Switched off flexbox here on purpose: `justify-content: center` on an
   overflowing flex child crops both edges and makes them unreachable by
   scroll in most browsers. Block + text-align: center does not have that
   bug, so panning to the true left/right edges of the full-size image works. */
.success-viewer.zoomed {
    display: block;
    text-align: center;
    padding: 1em;
}

.success-viewer.zoomed img {
    display: inline-block;
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    cursor: zoom-out;
}

.success-close {
    position: fixed;
    top: 1em;
    right: 1.2em;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 26px;
    line-height: 1;
    text-decoration: none;
    transition: background 0.2s ease;
    z-index: 10;
}

.success-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.inform {
    margin: 2em auto;
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(13, 77, 140, 0.12);
}

.header-inform {
    font-size: 2em;
    background: linear-gradient(to right, #164b7f, #0D4D8C);
    padding: 1rem;
    color: white;
    line-height: 1.4;
}

.header-ticket {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.header-ticket img {
    width: 280px;
    max-width: 80%;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Combo images (26/27) are landscape, not portrait like the single-package
   tickets — they need a lot more width for the text on them to stay readable. */
.header-ticket--combo img {
    width: 520px;
    max-width: 95%;
}

.detail-inform {
    padding: 1.5rem;
}

.form-input {
    text-align: left;
    margin: 0 0 1.5em 0;
}

.required-mark {
    color: #e53935;
    margin-right: 0.2em;
}

.label-header {
    display: flex;
    font-size: 1.3em;
    color: #444;
    margin-bottom: 0.4em;
}

.inform-input,
.select-selected {
    box-sizing: border-box;
    width: 100%;
    font-size: 1.2em;
    line-height: 1.4;
    color: white;
    background: linear-gradient(to right, #164b7f, #0D4D8C);
    border: none;
    margin: 0;
    border-radius: 8px;
    padding: 0.9rem 1rem;
    vertical-align: middle;
}

.inform-input::placeholder {
    color: #eafaf6;
}

select.select-selected {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: linear-gradient(to right, #164b7f, #0D4D8C);
    padding-right: 2.5rem;
}

/* The <select> itself is styled white-on-gradient above, but the dropdown list
   is rendered by the OS/browser with its own white background — without this,
   the options inherit color:white and become invisible until hovered. */
select.select-selected option {
    color: #0D4D8C;
    background: white;
}

/* Custom white chevron — points down normally, flips to point up while the
   select is open. Browsers have no reliable CSS-only hook for "dropdown is
   open" (:focus-within stays true after closing too), so a small script
   toggles the .open class on mousedown/blur/change — see the page's <script>. */
.select-wrap {
    position: relative;
}

.select-wrap::after {
    content: "";
    position: absolute;
    right: 1.2rem;
    top: 50%;
    width: 0.6em;
    height: 0.6em;
    border-right: 3px solid white;
    border-bottom: 3px solid white;
    transform: translateY(-65%) rotate(45deg);
    transition: transform 0.2s ease;
    pointer-events: none;
}

.select-wrap.open::after {
    transform: translateY(-35%) rotate(-135deg);
}

/* ---- Event summary blurb ---- */
.event-meta {
    background: #fff;
    border-radius: 10px;
    padding: 1.2rem;
    margin: 1.5em auto;
    box-shadow: 0 4px 20px rgba(13, 77, 140, 0.12);
    font-size: 1.15em;
    color: #333;
    line-height: 1.8;
}

.event-meta b {
    color: #0D4D8C;
}

/* ---- Poster gallery on the landing page ---- */
.poster-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5em 0;
}

.poster-gallery img {
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* ---- The 3 registration-type buttons ---- */
.select-header {
    color: #0D4D8C;
    font-size: 1.6em;
    text-align: center;
    margin: 1.5em 0 0.5em;
}

.type-hint {
    text-align: center;
    color: #0D4D8C;
    font-size: 1em;
    margin: 0 0 1em;
}

.type-selector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 22em));
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 0 auto 1.5em;
}

/* Combo shortcut row (Package 1+2 / Package 1+3): only 2 cards, sized so the
   pair spans roughly the same total width as the 3-card row above (so it
   reads as centered between them, not just centered on its own). */
.type-selector--combo {
    grid-template-columns: repeat(2, minmax(0, 34em));
}

.special-price-banner {
    max-width: 70em;
    margin: 0 auto 1.5em;
}

.special-price-banner img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

.type-option {
    display: block;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}

.type-option:hover {
    transform: translateY(-4px);
}

.type-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Each ticket image keeps its own native aspect ratio — no cropping — so card
   heights don't all match, which is fine. */
.type-option img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 26px;
    outline: 6px solid transparent;
    outline-offset: 0;
    transition: outline-color 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

/* Selected: checked and available — the ring sits flush against the card edge */
.type-option.selected img {
    outline-color: #e74c3c;
}

.check-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3em;
    height: 3em;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    border: 3px solid white;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2em;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    box-sizing: border-box;
}

.type-option.selected .check-badge {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Locked: not chosen, but unavailable because of a mutually-exclusive choice */
.type-option.locked {
    cursor: not-allowed;
    transform: none;
}

.type-option.locked img {
    filter: grayscale(0.7);
    opacity: 0.5;
}

/* Sold out: the ticket image itself already carries a SOLD OUT stamp, just dim it a touch */
.type-option.soldout {
    cursor: not-allowed;
    transform: none;
}

.type-option.soldout img {
    opacity: 0.85;
}

#nextBtn {
    transition: opacity 0.2s ease;
}

#nextBtn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.seat-note {
    text-align: center;
    color: #666;
    font-size: 0.95em;
    margin-top: 1em;
}

.seat-remain-full {
    color: #c0392b;
    font-weight: bold;
}

/* ---- Buttons (image submit buttons) ---- */
.button-part {
    margin: 1.5em 0 0.5em;
}

.button {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 100%;
    max-width: 420px;
}

.button img {
    display: block;
    width: 100%;
}

/* ---- Payment page ---- */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
}

.grid .images {
    display: flex;
    justify-content: center;
    align-items: center;
}

.pay-tabs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.pay-tab {
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    border: 2px solid #0D4D8C;
    color: #0D4D8C;
    background: white;
    cursor: pointer;
    font-size: 1em;
}

.pay-tab.active {
    background: linear-gradient(to right, #164b7f, #0D4D8C);
    color: white;
    border-color: transparent;
}

.qr-box, .bank-box {
    text-align: center;
}

.bank-box .bank-line {
    font-size: 1.2em;
    margin: 0.3em 0;
}

.notice {
    text-align: center;
    font-size: 1.2em;
    color: white;
    margin: auto;
    border-radius: 8px;
    padding: 1em;
    background-color: #0558a5;
}

/* ---- File upload preview ---- */
.file_upload {
    text-align: center;
    margin-top: 1.5em;
}

.image-preview {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1 / 1;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
    margin: 10px auto;
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
}

.image-preview__image {
    max-width: 90%;
    max-height: 90%;
    display: none;
    object-fit: contain;
}

.image-preview__default-text {
    color: #888;
    font-size: 1.1em;
    position: absolute;
    padding: 0 1em;
    text-align: center;
}

.selectButton {
    font-size: 1rem;
    padding: 0.6em 1.2em;
    border-radius: 999px;
    border: 2px solid #0D4D8C;
    background: white;
    color: #0D4D8C;
    cursor: pointer;
}

/* ---- Admin ---- */
.admin-bar {
    background: linear-gradient(to right, #164b7f, #0D4D8C);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.admin-bar-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-bar a {
    display: inline-block;
    color: white;
    text-decoration: none;
    background: rgba(255,255,255,0.2);
    padding: 0.4em 1em;
    border-radius: 999px;
    white-space: nowrap;
}

.seat-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.seat-summary-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.75em 1.2em;
    display: flex;
    align-items: baseline;
    gap: 0.5em;
}

.seat-summary-label {
    color: #164b7f;
    font-weight: bold;
}

.seat-summary-value {
    font-size: 1.2em;
    font-weight: bold;
}

.seat-summary-remain {
    color: #1e8a4c;
    font-weight: bold;
    font-size: 0.9em;
}

.seat-summary-remain--full {
    color: #c0392b;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.search-box input {
    flex: 1;
    max-width: 400px;
    box-sizing: border-box;
    font-size: 1em;
    padding: 0.6em 1em;
    border: 2px solid #164b7f;
    border-radius: 999px;
    color: #164b7f;
}

.search-box input::placeholder {
    color: #99a9bb;
}

.search-box #searchCount {
    color: #666;
    font-size: 0.9em;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .admin-bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }

    .admin-bar-links {
        width: 100%;
    }

    .admin-bar a {
        flex: 1 1 auto;
        text-align: center;
    }

    .search-box {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box input {
        max-width: none;
    }

    .admin-wrap {
        padding: 1rem 0.75rem;
    }
}

.admin-wrap {
    width: 100%;
    margin: 0;
    padding: 1.5rem;
}

.table-scroll {
    overflow-x: auto;
    background: white;
}

table.report {
    border-collapse: collapse;
    width: 100%;
}

table.report th, table.report td {
    border: 1px solid #ddd;
    padding: 8px;
    font-size: 0.95em;
    text-align: left;
}

table.report th {
    background-color: #164b7f;
    color: white;
    padding-top: 12px;
    padding-bottom: 12px;
    position: sticky;
    top: 0;
}

table.report tr:nth-child(even) {
    background-color: #f2f2f2;
}

table.report tr:hover {
    background-color: #ddd;
}

.row-cancelled td {
    background-color: #fdecea !important;
    color: #8a3b3b;
    text-decoration: line-through;
}

.row-cancelled td:last-child,
.row-cancelled td:nth-last-child(2) {
    text-decoration: none;
}

.status-badge {
    display: inline-block;
    padding: 0.2em 0.8em;
    border-radius: 999px;
    font-size: 0.9em;
    font-weight: bold;
    white-space: nowrap;
}

.status-paid {
    background: #e3f6ec;
    color: #1e8a4c;
}

.status-cancelled {
    background: #fbe3e3;
    color: #c0392b;
}

.inline-form {
    display: inline;
}

.slip-modal {
    border: none;
    border-radius: 10px;
    padding: 1.5em;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.slip-modal::backdrop {
    background: rgba(10, 37, 64, 0.6);
}

.slip-modal h3 {
    color: #164b7f;
    margin: 0 0 1em;
    font-size: 1.1em;
}

.slip-modal input[type="file"] {
    width: 100%;
    margin-bottom: 1em;
}

.slip-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5em;
}

.slip-modal-actions button[type="button"] {
    border: 1px solid #ddd;
    background: white;
    border-radius: 999px;
    padding: 0.4em 1em;
    font-size: 0.9em;
    cursor: pointer;
}

.btn-cancel, .btn-restore {
    border: none;
    border-radius: 999px;
    padding: 0.4em 1em;
    font-size: 0.9em;
    cursor: pointer;
    white-space: nowrap;
}

.btn-cancel {
    background: #e74c3c;
    color: white;
}

.btn-restore {
    background: #164b7f;
    color: white;
}

.login-box {
    max-width: 380px;
    margin: 4em auto;
    background: white;
    border-radius: 10px;
    padding: 2em;
    box-shadow: 0 4px 20px rgba(13, 77, 140, 0.12);
}

.login-box h1 {
    text-align: center;
    color: #0D4D8C;
    font-size: 1.5em;
}

.login-box button {
    width: 100%;
    padding: 0.8em;
    border: 2px solid #164b7f;
    border-radius: 8px;
    background: white;
    color: #164b7f;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
}

/* ---- Responsive breakpoints ---- */
@media (max-width: 900px) {
    .poster-gallery {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 685px) {
    .header-inform {
        font-size: 1.5em;
    }

    .select-header {
        font-size: 1.3em;
    }

    .label-header {
        font-size: 1.1em;
    }

    .inform-input, .select-selected {
        font-size: 1.05em;
    }

    .type-selector {
        grid-template-columns: 1fr;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .event-meta {
        font-size: 1em;
    }

    .header-ticket {
        flex-direction: column;
        align-items: center;
    }

    .header-ticket img {
        width: 220px;
        max-width: 80%;
    }

    .header-ticket--combo img {
        width: 100%;
        max-width: 95%;
    }
}

@media (max-width: 468px) {
    .header-inform {
        font-size: 1.2em;
        padding: 0.8rem;
    }

    .detail-inform {
        padding: 1rem;
    }

    .container {
        padding-left: 6px;
        padding-right: 6px;
    }
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-top: 3em;
}
