:root {
    --card-bg: rgba(255, 255, 255, 0.9);
    --primary-color: #ec725d;
    --text-color: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html,
body {
    background: #020617;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    overflow-x: hidden;
    cursor: pointer; /* Added for particle explosion hint */
}

/* --- COMMON CONTAINER STYLES --- */
.container {
    text-align: center;
    width: 90%;
    max-width: 400px;
    position: relative;
    z-index: 10;
}

.full-width-container {
    width: 95%;
    max-width: 1200px;
    padding: 40px 0;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 10;
}
.mood-page-header{
    color: rgb(167, 8, 182);
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    font-size: 2.5rem;
}
/* --- TEXT & HEADERS --- */
header h1 {
    color: rgb(199, 11, 11);
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    font-size: 2.5rem;
}
header p {
    color: rgba(255,255,255,0.95);
    margin-bottom: 30px;
    font-size: 1.1rem;
    font-weight: 500;
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #333;
}

/* --- PHASE 1: LOCATION CARD --- */
.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
}

input:focus {
    border-color: var(--primary-color);
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

.secondary-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    background: rgba(255,255,255,0.8);
}

button:hover {
    transform: translateY(-2px);
}

.divider {
    margin: 1rem 0;
    font-size: 0.8rem;
    color: #888;
    font-weight: bold;
}

.status {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #333;
}

/* --- PHASE 2: MOOD GRID --- */
.mood-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.mood-card {
    position: relative;
    aspect-ratio: 3 / 2;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 4px solid transparent;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    background: #000;
}

.mood-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.mood-card.selected {
    border-color: #fff;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.9);
    transform: scale(1.02);
}

.mood-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mood-strip {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    text-align: center;
    padding: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.disabled {
    opacity: 0.5;
    pointer-events: none;
    background-color: #ccc !important;
    box-shadow: none !important;
}

/* --- OLD WAVE BACKGROUND REMOVED --- */

#otp-container {
    background: url('/images/travelbackimg.jpg') no-repeat center center;
    background-size: cover;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    overflow: hidden;
    position: fixed;
    top: 0; bottom: 0; left: 0; right: 0;
    z-index: 100;
}

#otp-container::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.photo {
    border: 5px solid #fff;
    border-bottom-width: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 180px;
    height: auto;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    transition: all 1s ease-in-out;
}

.otp-callout {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999 !important;
    width: 100%;
    max-width: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
}

.loaded .photo {
    animation-duration: 2s;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
    animation-delay: 0.5s; /* wait 0.5s after .loaded before starting */
    z-index: 10;
}

.loaded .otp-callout {
    animation: presentcallout 1s ease-out 1.5s forwards;
    pointer-events: auto;
}

.loaded #image-1 { animation-name: movement1; }
.loaded #image-2 { animation-name: movement2; }
.loaded #image-3 { animation-name: movement3; }
.loaded #image-4 { animation-name: movement4; }
.loaded #image-5 { animation-name: movement5; }
.loaded #image-6 { animation-name: movement6; }
.loaded #image-7 { animation-name: movement7; }
.loaded #image-8 { animation-name: movement8; }
.loaded #image-9 { animation-name: movement9; }
.loaded #image-10 { animation-name: movement10; }
.loaded #image-11 { animation-name: movement11; }

/* --- KEYFRAMES for 11 images arranged in a circular pattern --- */
@keyframes movement1 {
    0% { opacity:0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity:1; transform: translate(-50%, -50%) rotate(10deg); }
    100% { opacity:1; transform: translate(-42vw, -32vh) rotate(-15deg) scale(0.75); }
}
@keyframes movement2 {
    0% { opacity:0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity:1; transform: translate(-50%, -50%) rotate(-10deg); }
    100% { opacity:1; transform: translate(42vw, -32vh) rotate(15deg) scale(0.75); }
}
@keyframes movement3 {
    0% { opacity:0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity:1; transform: translate(-50%, -50%) rotate(5deg); }
    100% { opacity:1; transform: translate(42vw, 28vh) rotate(10deg) scale(0.75); }
}
@keyframes movement4 {
    0% { opacity:0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity:1; transform: translate(-50%, -50%) rotate(-5deg); }
    100% { opacity:1; transform: translate(-42vw, 28vh) rotate(-10deg) scale(0.75); }
}
@keyframes movement5 {
    0% { opacity:0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity:1; transform: translate(-50%, -50%) rotate(8deg); }
    100% { opacity:1; transform: translate(0vw, -40vh) rotate(3deg) scale(0.75); }
}
@keyframes movement6 {
    0% { opacity:0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity:1; transform: translate(-50%, -50%) rotate(-8deg); }
    100% { opacity:1; transform: translate(46vw, -10vh) rotate(-8deg) scale(0.75); }
}
@keyframes movement7 {
    0% { opacity:0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity:1; transform: translate(-50%, -50%) rotate(12deg); }
    100% { opacity:1; transform: translate(0vw, 40vh) rotate(6deg) scale(0.75); }
}
@keyframes movement8 {
    0% { opacity:0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity:1; transform: translate(-50%, -50%) rotate(-12deg); }
    100% { opacity:1; transform: translate(-46vw, -10vh) rotate(-12deg) scale(0.75); }
}
@keyframes movement9 {
    0% { opacity:0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity:1; transform: translate(-50%, -50%) rotate(7deg); }
    100% { opacity:1; transform: translate(-22vw, -38vh) rotate(-8deg) scale(0.75); }
}
@keyframes movement10 {
    0% { opacity:0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity:1; transform: translate(-50%, -50%) rotate(-7deg); }
    100% { opacity:1; transform: translate(22vw, -38vh) rotate(8deg) scale(0.75); }
}
@keyframes movement11 {
    0% { opacity:0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity:1; transform: translate(-50%, -50%) rotate(15deg); }
    100% { opacity:1; transform: translate(44vw, 10vh) rotate(5deg) scale(0.75); }
}
@keyframes presentcallout {
    0% { opacity: 0; transform: translate(-50%, -45%); }
    100% { opacity: 1; transform: translate(-50%, -50%); }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .photo {
        width: 120px;
    }
    @keyframes movement1 {
        100% { transform: translate(-35vw, -28vh) rotate(-15deg) scale(0.65); }
    }
    @keyframes movement2 {
        100% { transform: translate(35vw, -28vh) rotate(15deg) scale(0.65); }
    }
    @keyframes movement3 {
        100% { transform: translate(35vw, 24vh) rotate(10deg) scale(0.65); }
    }
    @keyframes movement4 {
        100% { transform: translate(-35vw, 24vh) rotate(-10deg) scale(0.65); }
    }
    @keyframes movement5 {
        100% { transform: translate(0vw, -34vh) rotate(3deg) scale(0.65); }
    }
    @keyframes movement6 {
        100% { transform: translate(38vw, -12vh) rotate(-8deg) scale(0.65); }
    }
    @keyframes movement7 {
        100% { transform: translate(0vw, 34vh) rotate(6deg) scale(0.65); }
    }
    @keyframes movement8 {
        100% { transform: translate(-38vw, -12vh) rotate(-12deg) scale(0.65); }
    }
    @keyframes movement9 {
        100% { transform: translate(-20vw, -32vh) rotate(-8deg) scale(0.65); }
    }
    @keyframes movement10 {
        100% { transform: translate(20vw, -32vh) rotate(8deg) scale(0.65); }
    }
    @keyframes movement11 {
        100% { transform: translate(36vw, 12vh) rotate(5deg) scale(0.65); }
    }
}

@media (max-width: 480px) {
    .photo {
        width: 100px;
    }
    @keyframes movement1 {
        100% { transform: translate(-32vw, -25vh) rotate(-15deg) scale(0.55); }
    }
    @keyframes movement2 {
        100% { transform: translate(32vw, -25vh) rotate(15deg) scale(0.55); }
    }
    @keyframes movement3 {
        100% { transform: translate(32vw, 22vh) rotate(10deg) scale(0.55); }
    }
    @keyframes movement4 {
        100% { transform: translate(-32vw, 22vh) rotate(-10deg) scale(0.55); }
    }
    @keyframes movement5 {
        100% { transform: translate(0vw, -30vh) rotate(3deg) scale(0.55); }
    }
    @keyframes movement6 {
        100% { transform: translate(35vw, -15vh) rotate(-8deg) scale(0.55); }
    }
    @keyframes movement7 {
        100% { transform: translate(0vw, 30vh) rotate(6deg) scale(0.55); }
    }
    @keyframes movement8 {
        100% { transform: translate(-35vw, -15vh) rotate(-12deg) scale(0.55); }
    }
    @keyframes movement9 {
        100% { transform: translate(-18vw, -28vh) rotate(-8deg) scale(0.55); }
    }
    @keyframes movement10 {
        100% { transform: translate(18vw, -28vh) rotate(8deg) scale(0.55); }
    }
    @keyframes movement11 {
        100% { transform: translate(33vw, 14vh) rotate(5deg) scale(0.55); }
    }
    .otp-callout {
        max-width: 90%;
    }
}

/* Index page form responsiveness */
@media (max-width: 900px) {
    #otp-container .container {
        width: min(92vw, 460px);
        max-width: none;
    }

    #otp-container .card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    #otp-container .vibify-logo {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    #otp-container .otp-callout {
        max-width: 94%;
        padding: 0 10px;
    }

    #otp-container .input-group {
        flex-direction: column;
    }

    #otp-container .input-group input,
    #otp-container .input-group .primary-btn,
    #otp-container .secondary-btn {
        width: 100%;
    }

    #otp-container .card h2 {
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    #otp-container .container {
        width: 94vw;
    }

    #otp-container .card {
        padding: 1.15rem;
        border-radius: 14px;
    }

    #otp-container .vibify-logo {
        font-size: 2.2rem;
        letter-spacing: 1px;
    }

    #otp-container header p {
        font-size: 0.95rem;
        margin-bottom: 18px;
    }

    #otp-container input {
        font-size: 16px;
    }

    #otp-container .primary-btn,
    #otp-container .secondary-btn {
        padding: 11px 14px;
        font-size: 0.95rem;
    }
}

/* --- PHASE 3: RESULTS PAGE --- */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px;
}

.place-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.place-card:hover {
    transform: translateY(-10px);
}

.place-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.place-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.place-info h3 {
    margin-bottom: 5px;
    color: #333;
    font-size: 1.4rem;
}

.badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    align-self: flex-start;
    margin-bottom: 15px;
}

.details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    color: #666;
    font-weight: 500;
}

.map-btn {
    margin-top: auto;
    display: block;
    text-align: center;
    background: #333;
    color: white;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.map-btn:hover {
    background: black;
}

.v-mark-wrap {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 4px;
    flex-shrink: 0;
}

.v-mark-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(2.6);
    transform-origin: center;
    mix-blend-mode: normal;
    filter: none;
}

/* --- PARALLAX BACKGROUND (Results Page) --- */
.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: hsla(200,40%,30%,1);
    background-image:       
        url('https://78.media.tumblr.com/cae86e76225a25b17332dfc9cf8b1121/tumblr_p7n8kqHMuD1uy4lhuo1_540.png'), 
        url('https://78.media.tumblr.com/66445d34fe560351d474af69ef3f2fb0/tumblr_p7n908E1Jb1uy4lhuo1_1280.png'),
        url('https://78.media.tumblr.com/8cd0a12b7d9d5ba2c7d26f42c25de99f/tumblr_p7n8kqHMuD1uy4lhuo2_1280.png'),
        url('https://78.media.tumblr.com/5ecb41b654f4e8878f59445b948ede50/tumblr_p7n8on19cV1uy4lhuo1_1280.png'),
        url('https://78.media.tumblr.com/28bd9a2522fbf8981d680317ccbf4282/tumblr_p7n8kqHMuD1uy4lhuo3_1280.png');
    background-repeat: repeat-x;
    background-position: 
        0 20%,
        0 100%,
        0 50%,
        0 100%,
        0 0;
    background-size: 
        2500px,
        800px,
        500px 200px,
        1000px,
        400px 260px;
    animation: 50s para infinite linear;
}

@keyframes para {
    100% {
        background-position: 
            -5000px 20%,
            -800px 95%,
            500px 50%,
            1000px 100%,
            400px 0;
    }
}

/* --- VIBIFY LOGO STYLE --- */
.vibify-logo {
    font-size: 3.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #a5f3fc, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px rgba(192, 132, 252, 0.4);
    animation: floatLogo 3s ease-in-out infinite;
}

@keyframes floatLogo {
    0% { transform: translateY(0px); text-shadow: 0 0 30px rgba(192, 132, 252, 0.4); }
    50% { transform: translateY(-5px); text-shadow: 0 0 50px rgba(192, 132, 252, 0.6); }
    100% { transform: translateY(0px); text-shadow: 0 0 30px rgba(192, 132, 252, 0.4); }
}

/* ===== Particle Canvas Background (mood page) ===== */
canvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;            /* above page background, behind content */
    pointer-events: none;  /* allow clicks to pass through */
}

/* Neural network canvas background (results page) */
#neural-network-canvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;          /* behind content but above default */
    pointer-events: auto; /* allow clicks to be captured for pulses */
}

/* Ensure all content is above the canvas */
.full-width-container,
#chat-widget,
.results-grid,
header {
    position: relative;
    z-index: 10;
}

.masonry {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;                /* behind the photos (z-index 10) */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
    padding: 8px;
    background: #000;          /* black background */
    overflow-y: auto;          /* allow scrolling if many images */
    pointer-events: none;      /* clicks pass through to the callout */
    grid-auto-flow: dense;     /* fill empty spaces automatically */
}

.masonry-panel {
    overflow: hidden;
    animation: masonryScaleIn 0.25s cubic-bezier(0.64, 0.57, 0.67, 1) forwards;
    transform: scale(0);
    transform-origin: center;
}

.masonry-panel__content {
    width: 100%;
    height: 100%;
    min-height: 150px;
    border-radius: 10px;
    background-size: cover;    /* ← changed from cover to contain */
    background-position: center;
    background-repeat: no-repeat; /* ensures image doesn't tile */
    background-color: #222;       /* fallback dark color */
}

/* Scale‑in animation for masonry panels */
@keyframes masonryScaleIn {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* Stagger delays for masonry panels */
.masonry-panel:nth-child(1) { animation-delay: 0.05s; }
.masonry-panel:nth-child(2) { animation-delay: 0.10s; }
.masonry-panel:nth-child(3) { animation-delay: 0.15s; }
.masonry-panel:nth-child(4) { animation-delay: 0.20s; }
.masonry-panel:nth-child(5) { animation-delay: 0.25s; }
.masonry-panel:nth-child(6) { animation-delay: 0.30s; }
.masonry-panel:nth-child(7) { animation-delay: 0.35s; }
.masonry-panel:nth-child(8) { animation-delay: 0.40s; }
.masonry-panel:nth-child(9) { animation-delay: 0.45s; }
.masonry-panel:nth-child(10){ animation-delay: 0.50s; }
.masonry-panel:nth-child(11){ animation-delay: 0.55s; }
.masonry-panel:nth-child(12){ animation-delay: 0.60s; }
.masonry-panel:nth-child(13){ animation-delay: 0.65s; }
.masonry-panel:nth-child(14){ animation-delay: 0.70s; }
.masonry-panel:nth-child(15){ animation-delay: 0.75s; }
.masonry-panel:nth-child(16){ animation-delay: 0.80s; }
.masonry-panel:nth-child(17){ animation-delay: 0.85s; }
.masonry-panel:nth-child(18){ animation-delay: 0.90s; }

/* Adjust photo z-index to appear above masonry */
.photo {
    z-index: 10;  /* above masonry (z-index 1) but below callout (9999) */
}

/* ===== PAGE TRANSITION LOADER ===== */
/* Curtain pseudo-elements */
body::before,
body::after {
    content: '';
    position: fixed;
    left: 0;
    width: 100%;
    height: 50vh;
    background: #1c2020;
    z-index: 9997;
    pointer-events: none;
    transition: none; /* GSAP will handle animation */
}

body::before {
    top: -50%; /* hidden above */
}

body::after {
    bottom: -50%; /* hidden below */
}

/* Loader (bar animation) */
.loader {
    margin: 0 auto;
    width: 60px;
    height: 50px;
    text-align: center;
    font-size: 10px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translateY(-50%) translateX(-50%);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.loader > div {
    height: 100%;
    width: 8px;
    display: inline-block;
    margin-left: 2px;
    animation: loaderDelay 0.8s infinite ease-in-out;
}

.loader .bar1 { background-color: #754fa0; }
.loader .bar2 { background-color: #09b7bf; animation-delay: -0.7s; }
.loader .bar3 { background-color: #90d36b; animation-delay: -0.6s; }
.loader .bar4 { background-color: #f2d40d; animation-delay: -0.5s; }
.loader .bar5 { background-color: #fcb12b; animation-delay: -0.4s; }
.loader .bar6 { background-color: #ed1b72; animation-delay: -0.3s; }

@keyframes loaderDelay {
    0%, 40%, 100% { transform: scaleY(0.05); }
    20% { transform: scaleY(1); }
}

/* Ensure content is above curtains */
.full-width-container,
#chat-widget,
.results-grid,
header,
.card,
.mood-grid,
.otp-callout {
    position: relative;
    z-index: 10;
}
