/* Fix for photo/timeline layering issues in unlock experience */

.immersive-content-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 75vh; /* Limit height to prevent overlap with timeline */
    z-index: 15;
    pointer-events: none; /* Allow scrolling through photos */
    overflow: visible;
}

.floating-polaroids {
    position: relative;
    height: 100%;
    pointer-events: none;
}

.floating-polaroid {
    position: absolute !important;
    width: 280px;
    height: 320px;
    pointer-events: auto;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Distribute polaroids to avoid clustering */
.floating-polaroid:nth-child(1) {
    top: 20%;
    left: 5%;
    z-index: 12;
}

.floating-polaroid:nth-child(2) {
    top: 15%;
    right: 10%;
    z-index: 13;
}

.floating-polaroid:nth-child(3) {
    top: 45%;
    left: 15%;
    z-index: 14;
}

/* Timeline section - ensure it's clearly visible */
#experienceTimeline {
    position: relative !important;
    z-index: 25 !important;
    background: var(--surface, #ffffff) !important;
    margin-top: 30px !important;
    padding: 30px !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15) !important;
    border: 1px solid var(--surface-light, #f0f0f0) !important;
    clear: both;
}

.timeline-container {
    position: relative;
    z-index: 26;
}

.timeline-container h3 {
    margin-bottom: 20px;
    text-align: center;
    color: var(--primary-color, #ff6b6b);
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
}

.timeline-tracks {
    position: relative;
    z-index: 27;
}

/* Ensure polaroids don't interfere with scrolling to timeline */
.experience-section {
    position: relative;
    min-height: 100vh;
    padding-bottom: 100px;
}

/* Voice section positioning */
#voiceSection {
    position: relative;
    z-index: 20;
    margin: 20px 0;
    padding: 20px;
    background: var(--surface, #ffffff);
    border-radius: 12px;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    .floating-polaroid {
        width: 200px;
        height: 240px;
    }
    
    .floating-polaroid:nth-child(1) {
        top: 10%;
        left: 2%;
    }
    
    .floating-polaroid:nth-child(2) {
        top: 25%;
        right: 2%;
    }
    
    .floating-polaroid:nth-child(3) {
        top: 40%;
        left: 10%;
    }
    
    #experienceTimeline {
        margin-top: 60vh !important;
        padding: 20px !important;
    }
}

/* Ensure timeline is always accessible */
.timeline-track {
    position: relative;
    z-index: 28;
    background: var(--surface, #ffffff);
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color, #ff6b6b);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.timeline-track:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Photo loading states */
.floating-polaroid img {
    transition: opacity 0.3s ease;
}

.floating-polaroid img[src=""] {
    opacity: 0;
}

.floating-polaroid img:not([src=""]) {
    opacity: 1;
}