/* ===================================
   ATSUP Media Solution - Loading Screen
   Created for: AK Personal Mark
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
}

/* ===================================
   Loading Overlay
   =================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0b0b0f;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInBackground 0.8s ease-out forwards;
}

.loading-overlay.exit {
    animation: exitAnimation 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

/* ===================================
   Background Animations
   =================================== */
@keyframes fadeInBackground {
    0% {
        background: #000000;
    }
    100% {
        background: #0b0b0f;
    }
}

.glow-orb {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(29, 78, 216, 0.4) 0%, transparent 70%);
    filter: blur(80px);
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* ===================================
   Loading Container
   =================================== */
.loading-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    padding: 0 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ===================================
   Text Merge Animation Container
   =================================== */
.text-merge-container {
    position: relative;
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 60px;
    overflow: hidden;
}

/* ===================================
   Left Text (AK) Animation
   =================================== */
.text-left {
    position: absolute;
    font-family: 'Orbitron', sans-serif;
    font-size: 180px;
    font-weight: 900;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 
        0 0 20px rgba(29, 78, 216, 0.8),
        0 0 40px rgba(29, 78, 216, 0.6),
        0 0 60px rgba(29, 78, 216, 0.4),
        0 0 80px rgba(29, 78, 216, 0.2);
    animation: slideInLeft 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    z-index: 2;
}

@keyframes slideInLeft {
    0% {
        transform: translateX(-100vw) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(220px) rotate(0deg);
        opacity: 1;
    }
}
/* ===================================
   Right Text (ATS) Animation
   =================================== */
.text-right {
    position: absolute;
    font-family: 'Orbitron', sans-serif;
    font-size: 180px;
    font-weight: 900;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 
        0 0 20px rgba(29, 78, 216, 0.8),
        0 0 40px rgba(29, 78, 216, 0.6),
        0 0 60px rgba(29, 78, 216, 0.4),
        0 0 80px rgba(29, 78, 216, 0.2);
    animation: slideInRight 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    z-index: 2;
}

@keyframes slideInRight {
    0% {
        transform: translateX(100vw) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(-140px) rotate(0deg);
        opacity: 1;
    }
}

/* ===================================
   Merged Text Animation
   =================================== */
.text-merged {
    position: absolute;
    font-family: 'Poppins', sans-serif;
    font-size: 42px;
    font-weight: 300;
    color: #ffffff;
    letter-spacing: 0.08em;
    text-align: center;
    opacity: 0;
    transform: scale(0.8);
    text-shadow: 
        0 0 15px rgba(29, 78, 216, 0.6),
        0 0 30px rgba(29, 78, 216, 0.4);
    animation: 
        textMergeReveal 1s ease-out 1.5s forwards,
        textFadeOut 0.6s ease-out 3.8s forwards;
    z-index: 3;
}

@keyframes textMergeReveal {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes textFadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Hide left/right text during merge */
.text-left,
.text-right {
    animation: 
        slideInLeft 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards,
        textSidesFadeOut 0.8s ease-out 1.3s forwards;
}

.text-right {
    animation: 
        slideInRight 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards,
        textSidesFadeOut 0.8s ease-out 1.3s forwards;
}

@keyframes textSidesFadeOut {
    0% {
        opacity: 1;
        filter: blur(0);
    }
    100% {
        opacity: 0;
        filter: blur(10px);
    }
}

/* ===================================
   Loading Bar Section
   =================================== */
.loading-section {
    width: 100%;
    max-width: 600px;
    opacity: 0;
    animation: loadingSectionAppear 0.8s ease-out 2.2s forwards;
}

@keyframes loadingSectionAppear {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-family: 'Poppins', sans-serif;
}

.loading-label {
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.loading-percentage {
    font-size: 20px;
    font-weight: 600;
    color: rgb(29, 78, 216);
    text-shadow: 0 0 10px rgba(29, 78, 216, 0.5);
    font-family: 'Orbitron', sans-serif;
}

/* ===================================
   Loading Bar Container
   =================================== */
.loading-bar-container {
    position: relative;
    width: 100%;
    height: 60px;
    background: rgba(255, 11, 100, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(29, 78, 216, 0.2);
}

.loading-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, 
        rgb(29, 78, 216) 0%, 
        rgb(59, 130, 246) 50%, 
        rgb(29, 78, 216) 100%);
    border-radius: 10px;
    transition: width 0.1s linear;
    box-shadow: 
        0 0 15px rgba(29, 78, 216, 0.8),
        0 0 30px rgba(29, 78, 216, 0.5);
}

.loading-bar-glow {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    height: 150%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        transparent 100%);
    filter: blur(8px);
    opacity: 0;
    animation: barGlowSweep 2s ease-in-out infinite;
}

@keyframes barGlowSweep {
    0%, 100% {
        opacity: 0;
        transform: translateX(-100%) translateY(-50%);
    }
    50% {
        opacity: 0.8;
        transform: translateX(0) translateY(-50%);
    }
}

/* ===================================
   Exit Animation
   =================================== */
@keyframes exitAnimation {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100%) scale(1.1);
    }
}

/* ===================================
   Main Content Reveal
   =================================== */
body.loaded {
    overflow: auto;
}

body.loaded #main-content {
    animation: fadeInContent 1s ease-out forwards;
}

@keyframes fadeInContent {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* ===================================
   Responsive Design
   =================================== */

/* Tablets */
@media (max-width: 1024px) {
    .text-left,
    .text-right {
        font-size: 140px;
    }
    
    .text-merged {
        font-size: 32px;
    }
    
    .loading-container {
        padding: 0 30px;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    .text-merge-container {
        height: 150px;
        margin-bottom: 40px;
    }
    
    .text-left,
    .text-right {
        font-size: 100px;
    }
    
    @keyframes slideInLeft {
        100% {
            transform: translateX(-50px) rotate(0deg);
        }
    }
    
    @keyframes slideInRight {
        100% {
            transform: translateX(50px) rotate(0deg);
        }
    }
    
    .text-merged {
        font-size: 24px;
        padding: 0 20px;
    }
    
    .loading-section {
        max-width: 90%;
    }
    
    .loading-label {
        font-size: 14px;
    }
    
    .loading-percentage {
        font-size: 18px;
    }
    
    .glow-orb {
        width: 400px;
        height: 400px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .text-left,
    .text-right {
        font-size: 70px;
    }
    
    @keyframes slideInLeft {
        100% {
            transform: translateX(-30px) rotate(0deg);
        }
    }
    
    @keyframes slideInRight {
        100% {
            transform: translateX(30px) rotate(0deg);
        }
    }
    
    .text-merged {
        font-size: 18px;
    }
    
    .text-merge-container {
        height: 120px;
    }
    
    .loading-bar-container {
        height: 5px;
    }
}