/* Vault Phoenix - Loading Page Stylesheet */
/* Phoenix Rising from Digital Ashes - Crypto Gaming Edition */
/* UPDATED: Removed loading/subtitle text, improved transitions, faster loading */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    user-select: none;
    background: #0f0f0f;
}

/* Loading Container - UPDATED: Fixed transition issues */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 25%, #2d1810 50%, #451a03 75%, #7c2d12 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    overflow: hidden;
    /* FIXED: Smooth transition out */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* ADDED: Smooth exit animation */
.loading-container.fade-out {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

/* Background Elements */
.loading-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.phoenix-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(215, 51, 39, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(251, 146, 60, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(240, 165, 0, 0.15) 0%, transparent 50%);
    animation: phoenixFloat 15s ease-in-out infinite; /* SPEED UP: 20s -> 15s */
}

.crypto-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(215, 51, 39, 0.1) 0%, transparent 70%);
    animation: cryptoPulse 3s ease-in-out infinite; /* SPEED UP: 4s -> 3s */
}

@keyframes phoenixFloat {
    0%, 100% { transform: translateY(0px) scale(1) rotate(0deg); }
    33% { transform: translateY(-15px) scale(1.02) rotate(1deg); }
    66% { transform: translateY(8px) scale(0.98) rotate(-1deg); }
}

@keyframes cryptoPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.6; }
}

/* Loading Content */
.loading-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
    max-width: 500px;
    padding: 0 40px;
}

/* Phoenix Logo - UPDATED for new image */
.loading-logo {
    position: relative;
    margin-bottom: 40px;
    display: inline-block;
}

.phoenix-image {
    width: clamp(180px, 25vw, 240px);
    height: clamp(180px, 25vw, 240px);
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(215, 51, 39, 0.6));
    animation: phoenixPulse 2.5s ease-in-out infinite; /* SPEED UP: 3s -> 2.5s */
    position: relative;
    z-index: 2;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(220px, 30vw, 300px);
    height: clamp(220px, 30vw, 300px);
    background: radial-gradient(circle, rgba(215, 51, 39, 0.3) 0%, rgba(240, 165, 0, 0.2) 40%, transparent 70%);
    animation: logoGlowPulse 1.5s ease-in-out infinite alternate; /* SPEED UP: 2s -> 1.5s */
    z-index: 1;
    border-radius: 50%;
}

@keyframes phoenixPulse {
    0%, 100% { 
        transform: scale(1) rotate(0deg); 
        filter: drop-shadow(0 0 30px rgba(215, 51, 39, 0.6)); 
    }
    50% { 
        transform: scale(1.05) rotate(2deg); 
        filter: drop-shadow(0 0 40px rgba(240, 165, 0, 0.8)); 
    }
}

@keyframes logoGlowPulse {
    0% { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 0.3; 
        background: radial-gradient(circle, rgba(215, 51, 39, 0.3) 0%, rgba(240, 165, 0, 0.2) 40%, transparent 70%);
    }
    100% { 
        transform: translate(-50%, -50%) scale(1.1); 
        opacity: 0.6; 
        background: radial-gradient(circle, rgba(240, 165, 0, 0.5) 0%, rgba(215, 51, 39, 0.3) 40%, transparent 70%);
    }
}

/* Loading Text - UPDATED: Single title, moved up */
.loading-text {
    margin-bottom: 40px;
}

.loading-title {
    font-size: clamp(1.4rem, 3.5vw, 2rem); /* REDUCED: 1.8rem->1.4rem, 4vw->3.5vw, 2.5rem->2rem */
    font-weight: 900;
    margin-bottom: 0; /* REMOVED: No margin since no subtitle */
    color: #ffffff;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #fb923c 50%, #f0a500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleShimmer 2.5s ease-in-out infinite; /* SPEED UP: 3s -> 2.5s */
    line-height: 1.2;
    white-space: nowrap; /* ADDED: Prevent text wrapping */
}

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

/* Loading Bar - ENHANCED */
.loading-bar-container {
    margin-bottom: 30px;
}

.loading-bar {
    width: 100%;
    max-width: 400px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(215, 51, 39, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #d73327, #fb923c, #f0a500);
    border-radius: 10px;
    width: 0%;
    transition: width 0.2s ease; /* SPEED UP: 0.3s -> 0.2s */
    position: relative;
    box-shadow: 0 0 20px rgba(215, 51, 39, 0.5);
    animation: progressGlow 1.5s ease-in-out infinite; /* SPEED UP: 2s -> 1.5s */
}

.loading-spark {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: sparkMove 1.5s ease-in-out infinite; /* SPEED UP: 2s -> 1.5s */
    opacity: 0;
}

@keyframes progressGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(215, 51, 39, 0.5); }
    50% { box-shadow: 0 0 30px rgba(240, 165, 0, 0.8); }
}

@keyframes sparkMove {
    0% { transform: translateX(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

.loading-percentage {
    margin-top: 15px;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 700;
    color: #f0a500;
    text-shadow: 0 2px 10px rgba(240, 165, 0, 0.3);
}

/* Floating Crypto Coins - UPDATED with faster animations */
.floating-coins {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.coin {
    position: absolute;
    animation: coinFloat 6s ease-in-out infinite; /* SPEED UP: 8s -> 6s */
    z-index: 1;
}

.crypto-coin-icon {
    width: clamp(35px, 5vw, 55px);
    height: clamp(35px, 5vw, 55px);
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(240, 165, 0, 0.7));
    transition: all 0.3s ease;
    opacity: 0.6;
    visibility: visible;
    display: block;
    border-radius: 50%;
}

.coin-1 {
    top: 15%;
    left: 8%;
    animation-delay: 0s;
    animation-duration: 4.5s; /* SPEED UP: 6s -> 4.5s */
}

.coin-2 {
    top: 65%;
    left: 12%;
    animation-delay: 0.8s; /* SPEED UP: 1s -> 0.8s */
    animation-duration: 5.2s; /* SPEED UP: 7s -> 5.2s */
}

.coin-3 {
    top: 25%;
    right: 15%;
    animation-delay: 1.5s; /* SPEED UP: 2s -> 1.5s */
    animation-duration: 6s; /* SPEED UP: 8s -> 6s */
}

.coin-4 {
    top: 75%;
    right: 10%;
    animation-delay: 2.2s; /* SPEED UP: 3s -> 2.2s */
    animation-duration: 4.5s; /* SPEED UP: 6s -> 4.5s */
}

.coin-5 {
    top: 10%;
    left: 45%;
    animation-delay: 3s; /* SPEED UP: 4s -> 3s */
    animation-duration: 5.2s; /* SPEED UP: 7s -> 5.2s */
}

.coin-6 {
    bottom: 15%;
    right: 45%;
    animation-delay: 3.8s; /* SPEED UP: 5s -> 3.8s */
    animation-duration: 6.7s; /* SPEED UP: 9s -> 6.7s */
}

@keyframes coinFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg) scale(1); 
        opacity: 0.4; 
    }
    25% { 
        transform: translateY(-20px) rotate(90deg) scale(1.1); 
        opacity: 0.7; 
    }
    50% { 
        transform: translateY(-10px) rotate(180deg) scale(0.9); 
        opacity: 0.5; 
    }
    75% { 
        transform: translateY(-25px) rotate(270deg) scale(1.2); 
        opacity: 0.6; 
    }
}

/* Mobile Responsive Design - ENHANCED */
@media (max-width: 768px) {
    .loading-content {
        padding: 0 20px;
        max-width: 90%;
    }
    
    .phoenix-image {
        width: clamp(140px, 30vw, 180px);
        height: clamp(140px, 30vw, 180px);
    }
    
    .logo-glow {
        width: clamp(180px, 35vw, 220px);
        height: clamp(180px, 35vw, 220px);
    }
    
    .loading-title {
        font-size: clamp(1.4rem, 6vw, 2rem);
        margin-bottom: 30px; /* ADJUSTED: spacing for single title */
    }
    
    .loading-bar {
        height: 8px;
        max-width: 320px;
    }
    
    .loading-percentage {
        font-size: clamp(0.9rem, 3vw, 1rem);
        margin-top: 12px;
    }
    
    .crypto-coin-icon {
        width: clamp(25px, 6vw, 40px);
        height: clamp(25px, 6vw, 40px);
    }
    
    .crypto-glow {
        width: 400px;
        height: 400px;
    }
}

@media (max-width: 480px) {
    .loading-content {
        padding: 0 15px;
        max-width: 95%;
    }
    
    .phoenix-image {
        width: clamp(120px, 35vw, 160px);
        height: clamp(120px, 35vw, 160px);
        border-radius: 12px;
    }
    
    .logo-glow {
        width: clamp(150px, 40vw, 200px);
        height: clamp(150px, 40vw, 200px);
    }
    
    .loading-title {
        font-size: clamp(1.2rem, 7vw, 1.6rem);
        margin-bottom: 25px; /* ADJUSTED: spacing for single title */
        line-height: 1.1;
    }
    
    .loading-bar {
        height: 6px;
        max-width: 280px;
    }
    
    .loading-percentage {
        font-size: clamp(0.8rem, 3.5vw, 0.9rem);
        margin-top: 10px;
    }
    
    .crypto-glow {
        width: 300px;
        height: 300px;
    }
    
    .crypto-coin-icon {
        width: clamp(20px, 7vw, 35px);
        height: clamp(20px, 7vw, 35px);
    }
    
    /* Adjust coin positions for smaller screens */
    .coin-1 { top: 12%; left: 5%; }
    .coin-2 { top: 70%; left: 8%; }
    .coin-3 { top: 20%; right: 8%; }
    .coin-4 { top: 80%; right: 5%; }
    .coin-5 { top: 8%; left: 50%; }
    .coin-6 { bottom: 10%; right: 50%; }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .loading-container {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 40px;
    }
    
    .loading-content {
        max-width: 60%;
        padding: 0 20px;
    }
    
    .phoenix-image {
        width: clamp(100px, 20vw, 140px);
        height: clamp(100px, 20vw, 140px);
    }
    
    .loading-title {
        font-size: clamp(1rem, 3.5vw, 1.3rem); /* REDUCED: landscape spacing */
        margin-bottom: 20px; /* ADJUSTED: landscape spacing */
        white-space: nowrap; /* ADDED: Prevent wrapping in landscape */
    }
    
    .loading-bar-container {
        margin-bottom: 20px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .phoenix-image,
    .crypto-coin-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    .loading-container {
        background: linear-gradient(135deg, #000000 0%, #0f0f0f 25%, #1a1a1a 50%, #2d1810 75%, #451a03 100%);
    }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .phoenix-image {
        animation: none;
        transform: none;
    }
    
    .crypto-coin-icon {
        animation: none;
        transform: none;
    }
    
    .loading-spark {
        animation: none;
        opacity: 0;
    }
}

/* Focus accessibility */
.loading-container:focus-within {
    outline: 3px solid #f0a500;
    outline-offset: 2px;
}

/* Loading completion state */
.loading-complete .phoenix-image {
    transform: scale(1.1);
    filter: drop-shadow(0 0 50px rgba(240, 165, 0, 1));
}

.loading-complete .crypto-coin-icon {
    animation: coinCelebration 0.8s ease-out; /* SPEED UP: 1s -> 0.8s */
}

@keyframes coinCelebration {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.3) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

/* Enhanced hover effects for desktop */
@media (hover: hover) and (pointer: fine) {
    .phoenix-image:hover {
        transform: scale(1.05) rotate(2deg);
        filter: drop-shadow(0 0 40px rgba(240, 165, 0, 0.9));
        cursor: pointer;
    }
    
    .crypto-coin-icon:hover {
        transform: scale(1.2) rotate(15deg);
        filter: drop-shadow(0 0 15px rgba(240, 165, 0, 1)) brightness(1.2);
    }
}

/* Performance optimizations */
.phoenix-image,
.crypto-coin-icon,
.loading-progress {
    will-change: transform, filter;
}

.floating-coins {
    will-change: transform;
}

/* Selection styling */
::selection {
    background: rgba(240, 165, 0, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background: rgba(240, 165, 0, 0.3);
    color: #ffffff;
}
