/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Geologica", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    overflow-y: auto; /* Explicitly allow vertical scrolling */
    background: #f8fbee;
    -webkit-overflow-scrolling: touch; /* Improve scrolling on iOS */
}

/* Scroll Container - Creates scrollable height */
.scroll-container {
    position: relative;
    height: 300vh; /* Makes page scrollable through sections */
    overflow-y: visible; /* Allow content to be scrollable */
}

/* For mobile devices */
@media (max-width: 768px) {
    .scroll-container {
        height: auto; /* Let content determine height on mobile */
        min-height: 100vh; /* Ensure at least full viewport height */
    }
}

/* Fixed Content - Stays in viewport */
.fixed-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: #4e3254;
    z-index: 1000;
    transition: width 0.2s ease;
    width: 0;
}

/* Background Transition */
.background-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    transition: background 1.2s ease;
}

.bg-1 {
    background: #f8fbee 0%;
}
.bg-2 {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbee 100%);
}
.bg-3 {
    background: linear-gradient(135deg, #f8fbee 20%, #ffffff 80%);
}

/* Content Sections */
.content-section {
    position: absolute;
    width: 100%;
    max-width: 580px;
    padding: 40px 20px;
    text-align: center;
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    transition: opacity 0.8s ease, transform 0.8s ease;
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.content-section.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.main-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: #4e3254;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.subtitle {
    font-size: 1.5rem;
    font-style: italic;
    color: #d16d60;
    font-weight: 400;
}

/* Quotes Section */
.quotes-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
    justify-content: center;
    max-height: 80vh;
    overflow-y: auto;
    max-width: 580px;
}

.quote-card {
    display: flex;
    align-items: center;
    gap: 25px;
    background: rgba(248, 251, 238, 0.5);
    padding: 25px;
    width: 100%;
    max-width: 560px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid #f7a941;
}

.quote-card:nth-child(even) {
    flex-direction: row-reverse;
    border-left: none;
    border-right: 4px solid #f7a941;
}

.quote-card.woman {
    border-color: #c4665a;
}

.testimonial-image {
    flex-shrink: 0;
}

.testimonial-image img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f7a941;
    transition: transform 0.3s ease;
}

.woman .testimonial-image img {
    border: 3px solid #c4665a;
}

.testimonial-content {
    flex: 1;
    text-align: left;
}

.testimonial-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #212121;
    margin-bottom: 8px;
}

.testimonial-quote {
    font-size: 0.95rem !important;
    font-style: italic;
    color: #212121;
    line-height: 1.6;
}

.testimonial-quote strong {
    color: #c4665a;
    font-weight: 700;
}

.main-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 25px;
    color: #333;
    text-align: left;
}

.main-content strong {
    color: #d16d60;
    font-weight: 700;
}

.participants {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    width: 580px;
    padding: 0;
    text-align: left;
}

.participant-name {
    font-weight: bold;
    text-align: center;
}

.participant {
    position: relative;
    margin-bottom: 30px; /* Increased to provide more space */
}

/* First row participants (1-5) - bubbles on top */
.participant:nth-child(-n + 5) .participant-details {
    font-size: 11px;
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white !important;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 150px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
}

/* Second row participants (6-10) - bubbles on bottom */
.participant:nth-child(n + 6) .participant-details {
    font-size: 11px;
    position: absolute;
    bottom: -80px; /* Position at bottom instead of top */
    top: auto; /* Override top positioning */
    left: 50%;
    transform: translateX(-50%);
    background-color: white !important;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 150px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
}

.participant-details.show,
.participant.active .participant-details {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto;
}

/* Pointer for first row bubbles (pointing down) */
.participant:nth-child(-n + 5) .participant-details::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

/* Pointer for second row bubbles (pointing up) */
.participant:nth-child(n + 6) .participant-details::after {
    content: "";
    position: absolute;
    top: -10px; /* Position at top instead of bottom */
    bottom: auto; /* Override bottom positioning */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid white; /* Point up instead of down */
    border-top: none; /* Remove top border */
}

/* Participants grid layout */
.participants {
    margin-top: 100px;
    margin-bottom: 100px; /* Add space at bottom for second row bubbles */
    position: relative;
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #4e3254;
    font-size: 14px;
    font-weight: 500;
    z-index: 100;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    animation: bmwpBounce 2s infinite;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

[data-section="6"] h2 {
    text-align: left;
    font-size: 42px;
    margin-bottom: 30px;
    color: #4e3254;
}

[data-section="7"] h2,
[data-section="8"] h2,
[data-section="9"] h2,
[data-section="10"] h2,
[data-section="13"] h2 {
    text-align: left;
    font-size: 48px;
    margin-bottom: 30px;
    color: #4e3254;
    line-height: 1.2;
    font-weight: 400;
}

[data-section="11"] h2 {
    text-align: left;
    font-size: 48px;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

[data-section="7"] h2 strong,
[data-section="8"] h2 strong,
[data-section="9"] h2 strong,
[data-section="10"] h2 strong,
[data-section="13"] h2 strong {
    font-weight: 700;
    color: inherit !important;
}

[data-section="7"] h2.orange,
[data-section="8"] h2.orange,
[data-section="9"] h2.orange,
[data-section="10"] h2.orange,
[data-section="13"] h2.orange {
    color: #c4665a;
}

.italic {
    font-style: italic;
}

.quote-card.huge-text.man {
    display: flex;
    flex-direction: column;
}

.testimonial-name-container {
    display: flex;
    align-content: baseline;
    justify-content: flex-start;
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
}

.quote-card.huge-text .testimonial-image {
    text-align: left;
    display: block;
    width: 100%;
}

.quote-card.huge-text:nth-child(even) .testimonial-image {
    text-align: right;
}

@keyframes bmwpBounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-8px);
    }
    60% {
        transform: translateX(-50%) translateY(-4px);
    }
}

/* Animation keyframes */
@keyframes bmwpFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bmwpPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body,
    html {
        height: auto;
        overflow-y: auto !important; /* Force scrolling to be enabled */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS */
    }

    .content-section {
        padding: 30px 15px;
        max-width: 95%;
        position: relative !important; /* Force relative positioning */
        display: block !important; /* Ensure sections are visible */
        opacity: 1 !important; /* Ensure sections are visible */
        transform: none !important; /* Reset any transforms */
    }

    .quote-card {
        flex-direction: column !important;
        text-align: center;
        gap: 15px;
        padding: 20px;
    }

    .quote-card:nth-child(even) {
        border-right: none;
        border-left: 4px solid #c4665a;
    }

    .testimonial-content {
        text-align: center;
    }

    .testimonial-image img {
        width: 70px;
        height: 70px;
    }

    .main-title {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .testimonial-name {
        font-size: 1rem;
    }

    .testimonial-quote {
        font-size: 0.9rem;
    }

    .main-content p {
        font-size: 1rem;
        text-align: center;
    }

    .quotes-section {
        gap: 20px;
        padding: 20px 10px;
    }

    .scroll-indicator {
        font-size: 12px;
        padding: 8px 16px;
    }

    /* Mobile participants grid */
    .participants {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
        gap: 20px;
        width: 100%;
        margin-bottom: 120px; /* More space at bottom for bubbles */
    }

    .participant {
        margin-bottom: 40px; /* More space between participants */
    }

    /* All bubbles on top for mobile */
    .participant .participant-details {
        top: -80px;
        bottom: auto;
        width: 120px; /* Smaller width on mobile */
    }

    /* All pointers pointing down for mobile */
    .participant .participant-details::after {
        bottom: -10px;
        top: auto;
        border-top: 10px solid white;
        border-bottom: none;
    }
}

/* Enhanced smooth scrolling */
html {
    scroll-behavior: smooth;
    height: 100%;
}

/* Loading states */
.content-section * {
    transition: all 0.3s ease;
}

/* Mobile touch improvements */
@media (max-width: 768px) {
    .fixed-content {
        position: relative !important;
        height: auto !important;
        flex-direction: column;
    }

    .content-section {
        height: 100vh !important;
        min-height: 100vh;
        margin-bottom: 20px;
    }

    /* Ensure content is scrollable */
    .quotes-section {
        max-height: none;
        overflow-y: visible;
    }
}
