* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.page.active {
    display: flex;
    opacity: 1;
}

/* Landing Page Styles */
#landing-page {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.container {
    text-align: center;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
}

.lock-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: pulse 2s infinite;
}

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

.title {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    color: #f0f0f0;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.password-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.password-input {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.95);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.password-input:focus {
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.submit-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
    background: #ffffff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #f0f0f0;
}

.submit-btn:active {
    transform: translateY(-1px);
}

.hint {
    color: #ffd700;
    font-size: 0.95rem;
    margin-top: 1rem;
    min-height: 1.5rem;
    animation: fadeIn 0.5s ease;
    font-weight: 500;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loader Page Styles */
#loader-page {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.loader-container {
    width: 90%;
    max-width: 600px;
    padding: 2rem;
}

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

.loader-message {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    min-height: 3rem;
    animation: messageGlow 2s ease-in-out infinite;
}

@keyframes messageGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 15px;
    transition: width 0.1s linear;
    box-shadow: 0 0 20px rgba(79, 172, 254, 0.5);
}

.progress-text {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 1rem;
}

/* Final Page Styles */
#final-page {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 1rem;
    position: relative;
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* Audio Indicator */
.audio-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.75);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 100;
    animation: subtleSlideIn 1s ease-out;
    backdrop-filter: blur(5px);
}

.audio-icon {
    font-size: 1.1rem;
    opacity: 0.8;
}

.audio-text {
    color: #667eea;
    font-weight: 500;
    font-size: 0.8rem;
    opacity: 0.85;
}

@keyframes audioIndicatorPulse {
    0%, 100% { opacity: 0.75; }
    50% { opacity: 0.85; }
}

@keyframes speakerPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@keyframes subtleSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

.final-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.letter-frame {
    width: 100%;
    max-width: 600px;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 1s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.letter-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    max-height: 85vh;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.8s ease-in;
}

.letter-image.loaded {
    opacity: 1;
}

/* Loading placeholder for letter image */
.letter-image:not([src]) {
    min-height: 400px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    position: relative;
}

.letter-image:not([src])::before {
    content: "🔒";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .lock-icon {
        font-size: 3rem;
    }
    
    .password-input,
    .submit-btn {
        font-size: 1rem;
        padding: 0.9rem 1.2rem;
    }
    
    .loader-message {
        font-size: 1.2rem;
    }
    
    .progress-text {
        font-size: 1.5rem;
    }
    
    .letter-frame {
        padding: 1rem;
    }
    
    .audio-indicator {
        bottom: 10px;
        left: 10px;
        padding: 6px 12px;
    }
    
    .audio-text {
        font-size: 0.7rem;
    }
    
    .audio-icon {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
    }
    
    .title {
        font-size: 1.3rem;
        letter-spacing: 1px;
    }
    
    .lock-icon {
        font-size: 2.5rem;
    }
    
    .loader-message {
        font-size: 1rem;
    }
    
    .letter-frame {
        padding: 0.75rem;
    }
}

/* Landscape orientation for mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .lock-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .title {
        font-size: 1.3rem;
        margin-bottom: 0.3rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .letter-frame {
        padding: 0.5rem;
    }
    
    .letter-image {
        max-height: 75vh;
    }
}

