/* Apple-Style Loading Screen - Enhanced Version */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.apple-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 1;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Animated background gradient */
.apple-loading-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    animation: gradientMove 8s ease-in-out infinite;
    z-index: 1;
}

@keyframes gradientMove {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(30px, 30px);
    }
}

/* Subtle grid pattern */
.apple-loading-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 2;
    opacity: 0.5;
}

.apple-loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-container {
    text-align: center;
    padding: 60px 40px;
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 900px;
    min-width: 320px;
    animation: containerFloat 3s ease-in-out infinite;
}

@keyframes containerFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hello-text {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: clamp(2.2rem, 7vw, 5rem);
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #a8b2ff 50%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    margin-bottom: 25px;
    letter-spacing: -0.02em;
    line-height: 1.15;
    min-height: 1.2em;
    opacity: 0;
    text-shadow: 0 0 40px rgba(99, 102, 241, 0.3);
    position: relative;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.hello-text::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #6366f1, transparent);
    border-radius: 2px;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
    animation: lineGlow 2s ease-in-out infinite;
}

@keyframes lineGlow {
    0%, 100% {
        opacity: 0.5;
        width: 80px;
    }
    50% {
        opacity: 1;
        width: 120px;
    }
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.subtitle-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(0.95rem, 2.5vw, 1.4rem);
    font-weight: 500;
    color: #e0e0e0;
    margin-top: 30px;
    letter-spacing: 0.5px;
    line-height: 1.6;
    min-height: 1.8em;
    opacity: 0;
    text-transform: uppercase;
    position: relative;
    padding: 0 20px;
}

.subtitle-text::before {
    content: '—';
    margin-right: 15px;
    color: #6366f1;
    font-weight: 300;
}

.subtitle-text::after {
    content: '—';
    margin-left: 15px;
    color: #6366f1;
    font-weight: 300;
}

/* Enhanced typing cursor effect */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 0.85em;
    background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
    margin-left: 6px;
    animation: cursorBlink 1s step-end infinite, cursorGlow 2s ease-in-out infinite;
    vertical-align: text-bottom;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

@keyframes cursorBlink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

@keyframes cursorGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 1);
    }
}

/* Loading dots animation - Hidden for quick load */
.loading-dots {
    display: none;
}

@keyframes fadeInText {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .loading-container {
        padding: 40px 30px;
        border-radius: 20px;
        max-width: 90%;
    }
    
    .hello-text {
        margin-bottom: 20px;
    }
    
    .hello-text::after {
        width: 60px;
    }
    
    .subtitle-text {
        margin-top: 25px;
        font-size: clamp(0.85rem, 2.5vw, 1.1rem);
    }
}

@media (max-width: 480px) {
    .loading-container {
        padding: 30px 20px;
        border-radius: 15px;
        max-width: 95%;
    }
    
    .hello-text::after {
        width: 50px;
        height: 2px;
    }
    
    .subtitle-text {
        letter-spacing: 0.3px;
        padding: 0 10px;
    }
    
    .subtitle-text::before,
    .subtitle-text::after {
        margin-left: 10px;
        margin-right: 10px;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .loading-container {
        padding: 20px 40px;
    }
    
    .hello-text {
        font-size: clamp(1.8rem, 5vw, 3rem);
        margin-bottom: 15px;
    }
    
    .subtitle-text {
        margin-top: 15px;
        font-size: clamp(0.8rem, 2vw, 1rem);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .apple-loading-screen,
    .apple-loading-screen::before,
    .loading-container,
    .hello-text,
    .hello-text::after,
    .typing-cursor {
        animation: none;
    }
    
    .hello-text,
    .subtitle-text {
        opacity: 1;
    }
    
    .apple-loading-screen {
        transition: opacity 0.3s ease;
    }
    
    .typing-cursor {
        opacity: 1;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .apple-loading-screen {
        background: #000;
    }
    
    .loading-container {
        background: rgba(255, 255, 255, 0.05);
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
    
    .hello-text {
        background: #fff;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .subtitle-text {
        color: #fff;
    }
    
    .subtitle-text::before,
    .subtitle-text::after {
        color: #fff;
    }
}
