/* =============================================
   1. GENERAL BODY & LAYOUT
   ============================================= */
body {
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    background-color: #f0f9ff;
}

#main-content {
    display: flex;
    width: 100vw; /* This should be a multiple of the number of pages */
    transition: transform 0.8s cubic-bezier(0.86, 0, 0.07, 1);
}

.page-section {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.page-section.is-visible {
    opacity: 1;
}

/* =============================================
   2. ANIMATED BACKGROUND & LANDING PAGE
   ============================================= */
.background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    z-index: -1;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    animation: ripple-animation 8s infinite ease-out;
}

.ripple:nth-child(1) { width: 600px; height: 600px; left: -10%; bottom: -20%; animation-delay: 0s; }
.ripple:nth-child(2) { width: 800px; height: 800px; right: -15%; top: -25%; animation-delay: 3s; }
.ripple:nth-child(3) { width: 400px; height: 400px; left: 30%; bottom: 5%; animation-delay: 5s; }

@keyframes ripple-animation {
    0% { transform: scale(0.8); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes pulse-slow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-pulse-slow {
    animation: pulse-slow 4s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

/* Water Absorption Logo Animations */
#water-pool {
    transform-origin: center bottom;
    animation: jiggle-wave 6s infinite ease-in-out;
}
#big-bubble-green {
    transform-origin: 50% 50%;
    animation: bubble-float 4s infinite ease-in-out;
}
#small-bubble-1, #small-bubble-2 {
    transform-origin: 50% 50%;
    animation: bubble-absorb 5s infinite ease-out;
}
#small-bubble-1 { animation-delay: 0s; }
#small-bubble-2 { animation-delay: 2.5s; }

@keyframes jiggle-wave {
    0%, 100% { transform: skewX(0) scaleY(1); }
    10% { transform: skewX(-4deg) scaleY(1.02); }
    30% { transform: skewX(4deg) scaleY(1.02); }
    50% { transform: skewX(-2deg) scaleY(1); }
    70% { transform: skewX(2deg) scaleY(1); }
    90% { transform: skewX(-1deg) scaleY(1.01); }
}
@keyframes bubble-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}
@keyframes bubble-absorb {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(70px) scale(0.8); }
    75% { transform: translateY(85px) scale(0.2); opacity: 0.5; }
    100% { transform: translateY(93px) scale(0); opacity: 0; }
}

/* =============================================
   3. SURVEY PAGE LAYOUT & SCROLLING
   ============================================= */
.gif-container {
    width: 33.3333%;
    height: 100vh;
    background-size: cover;
    background-position: center;
}

.content-container {
    width: 66.6667%;
    padding: 4rem 6rem 4rem 4rem; /* Adjusted right padding for better balance */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.scrollable-content {
    width: 100%;
    max-height: calc(100vh - 16rem);
    overflow-y: auto;
    padding-right: 1.5rem;
}

/* Custom Scrollbar Styling */
.scrollable-content::-webkit-scrollbar { width: 8px; }
.scrollable-content::-webkit-scrollbar-track { background: transparent; }
.scrollable-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 169, 224, 0.5);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}
.scrollable-content::-webkit-scrollbar-thumb:hover { background-color: rgba(0, 169, 224, 0.8); }


/* =============================================
   4. NAVIGATION & PROGRESS
   ============================================= */

/* Vertical Progress Bar */
#vertical-progress-container {
    width: 200px;
    position: fixed;
    top: 50%;
    right: 2.5rem;
    transform: translateY(-50%);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#vertical-progress-container.visible {
    opacity: 1;
    visibility: visible;
}

#progress-line-svg-v {
    stroke-dasharray: 540;
    stroke-dashoffset: 540;
    transition: stroke-dashoffset 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.step-group {
    opacity: 0.4;
    transform-origin: center center;
    transform: scale(0.8);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.step-group.active {
    opacity: 1;
    transform: scale(1);
}
.step-group.completed {
    transform: translateX(-44px) scale(0.8);
}
.step-group.completed .completed-text { opacity: 1; }
.step-group.completed .step-label-text { opacity: 0 !important; visibility: hidden !important; }
.step-group.completed .step-circle { fill: #22c55e; }
.step-group.completed .step-text { fill: white; }
.step-group.active .step-circle {
    fill: #00a9e0;
    animation: subtle-pulse 2s infinite ease-in-out;
}
.step-group.active .step-text { fill: white; }
.step-group.active .step-label-text { opacity: 1; visibility: visible; fill: #0b2d48; }

.step-circle { fill: #e2e8f0; stroke: #f0f9ff; stroke-width: 5; transition: fill 0.4s ease, transform 0.5s cubic-bezier(0.65, 0, 0.35, 1); }
.step-text { fill: #94a3b8; font-weight: 700; font-size: 20px; text-anchor: middle; transition: fill 0.4s ease, transform 0.5s cubic-bezier(0.65, 0, 0.35, 1); }
.step-label-text { text-anchor: end; fill: #94a3b8; font-weight: 600; font-size: 16px; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease, fill 0.4s ease; }
.completed-text { text-anchor: end; fill: #22c55e; font-weight: 700; font-size: 14px; opacity: 0; transition: opacity 0.5s ease 0.2s; }

@keyframes subtle-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* Survey Navigation Buttons */
#survey-navigation {
    position: fixed;
    bottom: 2.5rem;
    left: 1.5rem;
    right: 1.5rem;
    z-index: 50;
    display: flex;
    justify-content: space-between;
}

#next-btn-global, #submit-btn-global {
    margin-left: auto;
}

/* Liquid Button Effect */
.liquid-next-btn {
    position: relative;
    overflow: hidden;
    border: 2px solid #00a9e0;
    background-color: transparent;
    transition: all 0.3s ease-in-out;
    color: #0b2d48;
    z-index: 1;
    opacity: 0.5;
    cursor: not-allowed;
}

.liquid-next-btn > span {
    position: relative;
    z-index: 2;
    transition: color 0.3s ease-in-out;
}

.liquid-next-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #00a9e0;
    transition: transform 0.5s ease-out;
    transform: translateY(100%);
    z-index: 0;
}

/* Enabled state */
.liquid-next-btn.is-ready {
    color: white;
    opacity: 1;
    cursor: pointer;
    border-color: #00a9e0;
    box-shadow: 0 4px 10px rgba(0, 169, 224, 0.25);
}

.liquid-next-btn.is-ready::after {
    transform: translateY(0);
}

.liquid-next-btn.is-ready:hover {
    transform: translateY(-2px);
}

/* =============================================
   5. INTERACTIVE ELEMENTS
   ============================================= */

/* --- Custom Slider --- */
.slider-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    margin-top: 2rem;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.75rem;
    color: #4b5563;
}

.secondary-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.75rem;
    color: #4b5563;
    margin-top: 1rem;
}

/* This new class is a dedicated child for the secondary labels */
.secondary-slider-label {
    text-align: center;
    width: 20%;
}

.slider-label {
    text-align: center;
    width: 20%;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #d1d5db;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
    border-radius: 5px;
    margin-top: 0.5rem;
}

.slider:hover {
    opacity: 1;
}

.slider-thumb-color {
    --thumb-color: #00a9e0;
    --thumb-shadow-color: rgba(0, 169, 224, 0.3);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--thumb-color);
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid #f0f9ff;
    transition: all 0.2s ease-in-out;
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--thumb-color);
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid #f0f9ff;
    transition: all 0.2s ease-in-out;
}

.slider:active::-webkit-slider-thumb {
    box-shadow: 0 0 0 8px var(--thumb-shadow-color);
}

.slider-value-display {
    position: absolute;
    top: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--thumb-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out, background-color 0.2s ease-in-out;
    pointer-events: none;
}

.slider-value-display.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* Badge Toast Notification */
#badge-toast { position: fixed; top: 2rem; left: 50%; transform: translateX(-50%) translateY(-100px); background-color: #1e293b; color: white; padding: 1rem 2rem; border-radius: 0.5rem; box-shadow: 0 4px 15px rgba(0,0,0,0.2); font-size: 1rem; font-weight: 600; text-align: center; z-index: 100; transition: transform 0.5s ease-out; display: flex; align-items: center; gap: 1rem; }
#badge-toast.show { transform: translateX(-50%) translateY(0); }

/* Final Section Badges */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.badge-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1rem; background-color: rgba(255,255,255,0.8); backdrop-filter: blur(5px); border-radius: 0.75rem; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.badge-card.earned { background-color: #e0f7fa; border: 2px solid #00a9e0; }
.badge-card svg { width: 48px; height: 48px; color: #94a3b8; transition: color 0.3s ease; }
.badge-card.earned svg { color: #00a9e0; }

/* =============================================
   6. RESPONSIVE DESIGN
   ============================================= */
/* Desktop layout adjustments */
@media (min-width: 768px) {
    #survey-navigation {
        left: 33.33%;
        right: 0;
        width: auto;
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

/* Mobile layout adjustments */
@media (max-width: 767px) {
    .page-section {
        height: 100vh;
        overflow: hidden;
        display: flex;
        padding-top: 6rem; /* Space for a potential header */
        padding-bottom: 8rem;   /* Space for the fixed buttons */
    }

    .gif-container,
    #vertical-progress-container {
        display: none;
    }

    .content-container {
        width: 100%;
        height: 100%;
        overflow-y: auto;
        justify-content: flex-start;
        padding: 0 1.5rem;
    }

    /* Custom scrollbar for mobile */
    .content-container::-webkit-scrollbar { width: 8px; }
    .content-container::-webkit-scrollbar-track { background: transparent; }
    .content-container::-webkit-scrollbar-thumb { background-color: rgba(0, 169, 224, 0.5); border-radius: 10px; }
}