/* Loading Screen Styles */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a0a1f 0%, #2d1b3d 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 1.2s ease, visibility 1.2s ease, transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.loader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
    pointer-events: none;
}

.loader-content {
    text-align: center;
    position: relative;
    z-index: 2;
    animation: contentEnter 0.8s ease-out;
    width: 100%;
    max-width: 90vw;
    padding: 0 20px;
    box-sizing: border-box;
}

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

.loader-logo {
    font-family: "BBH Sans Bartle", sans-serif;
    font-size: 72px;
    font-weight: 100;
    color: #ff69b4;
    margin-bottom: 50px;
    letter-spacing: 16px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.3);
    white-space: nowrap;
}

.loader-logo::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ff69b4, transparent);
    opacity: 0.6;
}

.loader-question {
    font-family: "BBH Sans Bartle", sans-serif;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 30px;
    letter-spacing: 1px;
    text-align: center;
    font-weight: 400;
    line-height: 1.6;
}

.loader-content.fadeOut {
    animation: contentFadeOut 0.8s ease forwards;
}

@keyframes contentFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
}

.loader-bar-container.fadeIn {
    animation: barFadeIn 0.8s ease forwards;
}

@keyframes barFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.loader-input {
    width: 350px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 105, 180, 0.5);
    border-radius: 12px;
    color: #fff;
    font-size: 26px;
    text-align: center;
    font-family: "BBH Sans Bartle", sans-serif;
    font-weight: 100;
    letter-spacing: 12px;
    text-transform: uppercase;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    cursor: text;
}

.loader-input.shake {
    animation: strongShake 0.6s ease;
}

.loader-input.correct {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.2);
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.6);
    animation: successPulse 0.8s ease;
}

.loader-input.wrong {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
}

@keyframes strongShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-15px) rotate(-2deg); }
    20%, 40%, 60%, 80% { transform: translateX(15px) rotate(2deg); }
}

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

.loader-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-size: 22px;
    letter-spacing: 14px;
    font-weight: 100;
}

.loader-input:focus {
    border-color: #ff69b4;
    background: rgba(255, 105, 180, 0.1);
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.3);
}

.loader-hint {
    font-size: 18px;
    min-height: 30px;
    margin-bottom: 25px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    letter-spacing: 1px;
    animation: hintFadeIn 0.4s ease;
}

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

.loader-hint.correct {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.loader-hint.wrong {
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.loader-hint.success {
    color: #4ade80;
    animation: fadeInScale 0.5s ease;
    font-size: 18px;
}

.loader-hint.error {
    color: #ff6b6b;
    animation: bounceIn 0.5s ease;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.loader-bar-container {
    width: 300px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.loader-bar {
    height: 100%;
    background: #ff69b4;
    border-radius: 10px;
    animation: loadingBar 2s ease-in-out forwards;
}

@keyframes loadingBar {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.loader-text {
    margin-top: 20px;
    color: rgba(255, 105, 180, 0.8);
    font-size: 12px;
    letter-spacing: 2px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-transform: uppercase;
}

.loader-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #ff69b4;
    border-radius: 50%;
    opacity: 0.3;
    animation: particleFloat 4s ease-in-out infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* Additional Premium Effects */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

.reveal-wrapper {
    position: relative;
    overflow: hidden;
}

.reveal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #ff69b4, transparent);
    transform: translateX(-100%);
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 1;
}

#header {
    transition: transform 0.3s ease, height 0.3s ease, backdrop-filter 0.3s ease !important;
}

.loader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Mobile responsiveness for loader */
@media (max-width: 768px) {
    .loader-logo {
        font-size: clamp(24px, 7vw, 36px);
        font-weight: 100;
        letter-spacing: clamp(2px, 1.2vw, 5px);
        margin-bottom: 30px;
    }
    
    .loader-question {
        font-size: clamp(14px, 4vw, 17px);
        padding: 0 20px;
        margin-bottom: 25px;
        font-weight: 400;
        letter-spacing: 0.5px;
    }
    
    .loader-input {
        width: min(280px, 90vw);
        height: 50px;
        font-size: clamp(18px, 4.5vw, 22px);
        font-weight: 100;
        letter-spacing: clamp(5px, 1.8vw, 9px);
    }
    
    .loader-hint {
        font-size: 16px;
        padding: 0 20px;
    }
    
    .loader-bar-container {
        width: 80%;
        max-width: 280px;
    }
    
    .loader-text {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .loader-logo {
        font-size: clamp(20px, 6vw, 28px);
        font-weight: 100;
        letter-spacing: clamp(1px, 0.8vw, 3px);
        margin-bottom: 25px;
    }
    
    .loader-question {
        font-size: clamp(12px, 3.5vw, 15px);
        padding: 0 15px;
        margin-bottom: 20px;
        line-height: 1.5;
        font-weight: 400;
        letter-spacing: 0.5px;
    }
    
    .loader-input {
        width: min(240px, 85vw);
        height: 45px;
        font-size: clamp(16px, 4vw, 18px);
        font-weight: 100;
        letter-spacing: clamp(3px, 1.2vw, 6px);
        margin-bottom: 20px;
    }
    
    .loader-input::placeholder {
        font-size: 10px;
    }
    
    .loader-hint {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .loader-bar-container {
        width: 85%;
        max-width: 240px;
    }
    
    .loader-text {
        font-size: 10px;
        margin-top: 15px;
    }
}
