@import "tailwindcss";

@source "../../app/views/**/*.php";
@source "../../public/**/*.php";

/* 1. Konfigurasi Theme & Warna Kustom (Tailwind v4) */
@theme {
  --font-sans: 'Work Sans', sans-serif;
  --font-friz: 'Friz Quadrata Std', serif;

  --color-its-blue: #233F7C;
  --color-its-blue-light: #127BBE;
  --color-its-blue-sky: #75BDE0;
  --color-its-yellow: #FDBB16;
}

/* Header Responsive Visibility Helpers */
@media (max-width: 767px) {
    .desktop-only-header {
        display: none !important;
    }
    .mobile-only-header {
        display: flex !important;
    }
}
@media (min-width: 768px) {
    .desktop-only-header {
        display: flex !important;
    }
    .mobile-only-header {
        display: none !important;
    }
}

/* 2. Deklarasi Font Lokal */
@font-face {
    font-family: 'Friz Quadrata Std';
    src: url('../fonts/friz-quadrata.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Work Sans';
    src: url('../fonts/work-sans.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

[x-cloak] {
    display: none !important;
}

body {
    position: relative;
    background-color: #f8fafc;
    touch-action: manipulation;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('../images/BATIK_1.svg'); 
    background-repeat: repeat;
    background-position: center top;
    background-size: 280px auto;
    opacity: 0.10;
    pointer-events: none;
    z-index: 1;
}

/* FIX STACKING CONTEXT: Header Dipaksa Di Atas Main */
header {
    position: sticky;
    top: 0;
    z-index: 100 !important;
}

main, footer {
    position: relative;
    z-index: 1 !important;
}

.selected-seat-ring {
    box-shadow: 0 0 0 3px #127BBE, 0 4px 14px rgba(18, 123, 190, 0.4);
    transform: scale(1.08);
    position: relative;
    z-index: 10 !important;
}

@keyframes seatPulse {
    0% {
        box-shadow: 0 0 0 3px #127BBE, 0 0 8px rgba(18, 123, 190, 0.5);
        transform: scale(1.05);
    }
    50% {
        box-shadow: 0 0 0 4px #127BBE, 0 0 14px rgba(18, 123, 190, 0.7);
        transform: scale(1.08);
    }
    100% {
        box-shadow: 0 0 0 3px #127BBE, 0 0 8px rgba(18, 123, 190, 0.5);
        transform: scale(1.05);
    }
}

.search-highlight-seat {
    animation: seatPulse 1.4s infinite ease-in-out;
    position: relative;
    z-index: 10 !important;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 8px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 8px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #127BBE;
}

/* SENO MASCOT STYLES */
#seno-mascot {
    position: fixed;
    bottom: 8px;
    right: clamp(12px, 3vw, 40px);
    width: clamp(90px, 14vw, 150px);
    z-index: 90;
    pointer-events: none;
    will-change: transform, opacity;
    transform: translate3d(0,0,0);
    backface-visibility: hidden;
}
#seno-mascot.seno-hidden { opacity: 0; pointer-events: none; }
#seno-mascot.seno-visible { opacity: 1; pointer-events: auto; }

/* OPTIMIZED HARDWARE-ACCELERATED KEYFRAMES (Spring & Fluid) */
@keyframes senoSlideInRight {
    from { transform: translate3d(140px, 0, 0); opacity: 0; }
    to   { transform: translate3d(0, 0, 0); opacity: 1; }
}
@keyframes senoRiseUp {
    from { transform: translate3d(0, 140px, 0); opacity: 0; }
    to   { transform: translate3d(0, 0, 0); opacity: 1; }
}
@keyframes senoPopIn {
    0%   { transform: scale3d(0.8, 0.8, 1) translate3d(0, 20px, 0); opacity: 0; }
    70%  { transform: scale3d(1.03, 1.03, 1) translate3d(0, -3px, 0); opacity: 1; }
    100% { transform: scale3d(1, 1, 1) translate3d(0, 0, 0); opacity: 1; }
}
@keyframes senoExitRight {
    from { transform: translate3d(0, 0, 0); opacity: 1; }
    to   { transform: translate3d(140px, 0, 0); opacity: 0; }
}
@keyframes senoFloat {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(0, -5px, 0); }
}
@keyframes senoBubblePop {
    0%   { transform: scale3d(0.92, 0.92, 1) translate3d(0, 6px, 0); opacity: 0; }
    100% { transform: scale3d(1, 1, 1) translate3d(0, 0, 0); opacity: 1; }
}
@keyframes senoProgress {
    from { width: 0%; }
    to   { width: 100%; }
}

#seno-mascot.anim-right  { animation: senoSlideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
#seno-mascot.anim-rise   { animation: senoRiseUp       0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
#seno-mascot.anim-drop   { animation: senoPopIn        0.45s cubic-bezier(0.34, 1.4, 0.64, 1) forwards; }
#seno-mascot.anim-peek   { animation: senoSlideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
#seno-mascot.anim-exit   { animation: senoExitRight    0.4s cubic-bezier(0.4, 0, 1, 1) forwards; }
#seno-mascot.anim-float  { animation: senoFloat        3.2s ease-in-out infinite; }

#seno-img {
    width: 100%;
    cursor: pointer;
    display: block;
    user-select: none;
    filter: drop-shadow(0 4px 12px rgba(18,123,190,.25));
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 4px;
    will-change: transform;
    transform: translate3d(0,0,0);
}
#seno-img:hover { transform: scale3d(1.04, 1.04, 1); }

#seno-bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: clamp(190px, 40vw, 260px);
    background: #fff;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 8px 24px rgba(35,63,124,.14), 0 0 0 1px rgba(18,123,190,.12);
    padding: 12px 14px 10px;
    font-family: 'Work Sans', sans-serif;
    animation: senoBubblePop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    display: none;
    z-index: 1;
    will-change: transform, opacity;
    transform-origin: bottom right;
}
#seno-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 22px;
    border: 10px solid transparent;
    border-top-color: #fff;
    border-right: 0;
    filter: drop-shadow(0 2px 3px rgba(35,63,124,.1));
    z-index: 1;
    pointer-events: none;
}

.seno-text {
    font-size: clamp(11px, 1.5vw, 13px);
    line-height: 1.5;
    color: #1e293b;
    min-height: 32px;
    position: relative;
    z-index: 2;
}

#seno-progress-wrap {
    height: 3px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
    display: none;
    position: relative;
    z-index: 2;
}
#seno-progress-bar {
    height: 100%;
    background: linear-gradient(90deg,#127BBE,#FDBB16);
    border-radius: 4px;
    width: 0%;
}
#seno-progress-bar.running {
    animation: senoProgress var(--seno-dur, 4s) linear forwards;
}

.seno-btn-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
    position: relative;
    z-index: 2;
}
.seno-btn {
    flex: 1;
    background: linear-gradient(135deg,#127BBE,#233F7C);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 5px 9px;
    font-size: clamp(10px,1.4vw,12px);
    font-weight: 600;
    cursor: pointer;
    font-family: 'Work Sans', sans-serif;
    transition: opacity .18s, transform .14s;
    white-space: nowrap;
}
.seno-btn:hover { opacity: .86; transform: scale(1.03); }
.seno-btn:active { transform: scale(.97); }
.seno-btn.seno-skip {
    background: #f1f5f9;
    color: #64748b;
}
.seno-btn.seno-skip:hover { background: #e2e8f0; }

#seno-replay-btn {
    position: fixed;
    bottom: clamp(12px, 2vw, 20px);
    right: clamp(12px, 2vw, 20px);
    z-index: 89;
    background: linear-gradient(135deg,#233F7C,#127BBE);
    border: none;
    border-radius: 50%;
    width: clamp(40px, 5.5vw, 48px);
    height: clamp(40px, 5.5vw, 48px);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(35,63,124,.32);
    display: none;
    align-items: center;
    justify-content: center;
    transition: transform .2s, box-shadow .2s;
    padding: 4px;
}
#seno-replay-btn:hover { transform: scale(1.1); box-shadow: 0 6px 22px rgba(35,63,124,.42); }
#seno-replay-btn img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
#seno-replay-btn.seno-rb-visible { display: flex; }

@media (max-width: 768px) {
    #seno-mascot {
        width: clamp(75px, 20vw, 105px);
        right: 10px;
        bottom: 10px;
    }
    #seno-bubble {
        max-width: 220px;
        width: calc(100vw - 32px);
        right: 0;
        padding: 10px 12px 8px;
    }
    .seno-text {
        font-size: 11px;
        line-height: 1.45;
        min-height: 28px;
    }
    .seno-btn {
        font-size: 10px;
        padding: 4px 7px;
    }
}

/* ===== PERBAIKAN CSS TENTANG CENTERING & BOUNDS ===== */
#denahContainer {
    width: 100%;
    flex: 1 1 auto !important;
    min-height: 350px;
    max-height: calc(100vh - 180px);
    overflow: auto !important;
    position: relative;
    padding: 20px;
    box-sizing: border-box;
    /* PENTING: Mengunci denah agar SELALU di tengah layar saat mengecil */
    display: flex !important;
    justify-content: safe center !important;
    align-items: flex-start !important;
    user-select: none;
}

#zoomWrapper {
    display: inline-block;
    margin: auto;
    position: relative;
}

#zoomContent {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important; 
    align-items: flex-start;
    white-space: nowrap !important;
    will-change: transform, zoom;
}

#lorongTengah {
    flex-shrink: 0 !important;
}