/* ============================================
   OBSCURE - Professional Loading Screen
   Ultra Modern & Creative Design
   ============================================ */

/* Loading Overlay */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1D1C1C 0%, #2d2d2d 50%, #1D1C1C 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    overflow: hidden;
}

.page-loading.loaded {
    opacity: 0;
    visibility: hidden;
}

/* Animated Background Particles */
.page-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(224, 220, 209, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(224, 220, 209, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(224, 220, 209, 0.02) 0%, transparent 50%);
    animation: particleFloat 15s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(20px, -20px); }
    50% { transform: translate(-20px, 20px); }
    75% { transform: translate(20px, 20px); }
}

/* Logo Container with Advanced Animation */
.loading-logo-container {
    position: relative;
    margin-bottom: 40px;
    animation: logoEntrance 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes logoEntrance {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-10deg);
    }
    60% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Logo Image */
.loading-logo {
    width: 220px;
    height: auto;
    filter: drop-shadow(0 10px 40px rgba(224, 220, 209, 0.3));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* Glowing Ring Behind Logo */
.loading-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(224, 220, 209, 0.15) 0%, transparent 70%);
    animation: glowPulse 2.5s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.4;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.8;
    }
}

/* Spinning Circle */
.loading-logo-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 260px;
    height: 260px;
    border: 3px solid transparent;
    border-top: 3px solid #E0DCD1;
    border-right: 3px solid rgba(224, 220, 209, 0.3);
    border-radius: 50%;
    animation: spinCircle 2s linear infinite;
}

@keyframes spinCircle {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Company Name */
.loading-text {
    font-family: 'Romantice', serif;
    font-size: 3.5rem;
    color: #E0DCD1;
    letter-spacing: 12px;
    margin-bottom: 20px;
    opacity: 0;
    animation: textFadeIn 1s ease 0.5s forwards;
    text-shadow: 0 0 30px rgba(224, 220, 209, 0.5);
}

@keyframes textFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tagline */
.loading-tagline {
    font-size: 1.4rem;
    color: #AAA498;
    letter-spacing: 3px;
    margin-bottom: 50px;
    opacity: 0;
    animation: textFadeIn 1s ease 0.7s forwards;
    font-weight: 300;
}

/* Progress Bar Container */
.loading-progress {
    width: 450px;
    height: 6px;
    background: rgba(224, 220, 209, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 20px rgba(224, 220, 209, 0.1);
    opacity: 0;
    animation: textFadeIn 1s ease 0.9s forwards;
}

/* Progress Bar Fill */
.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, 
        #E0DCD1 0%, 
        #AAA498 50%, 
        #E0DCD1 100%
    );
    border-radius: 10px;
    width: 0%;
    animation: progressBar 3s ease-in-out forwards;
    box-shadow: 0 0 20px rgba(224, 220, 209, 0.6);
    position: relative;
}

@keyframes progressBar {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Progress Bar Shine Effect */
.loading-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent
    );
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    100% { left: 150%; }
}

/* Percentage Text */
.loading-percentage {
    font-size: 1.8rem;
    color: #E0DCD1;
    font-weight: 700;
    margin-top: 25px;
    letter-spacing: 3px;
    opacity: 0;
    animation: textFadeIn 1s ease 1.1s forwards;
    text-shadow: 0 0 20px rgba(224, 220, 209, 0.4);
}

/* Loading Message */
.loading-message {
    font-size: 1.1rem;
    color: #AAA498;
    margin-top: 20px;
    letter-spacing: 2px;
    opacity: 0;
    animation: textFadeIn 1s ease 1.3s forwards, messagePulse 2s ease-in-out 1.5s infinite;
    font-weight: 300;
}

@keyframes messagePulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Loading Dots */
.loading-dots {
    display: flex;
    gap: 12px;
    margin-top: 35px;
    opacity: 0;
    animation: textFadeIn 1s ease 1.5s forwards;
}

.loading-dot {
    width: 14px;
    height: 14px;
    background: #E0DCD1;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(224, 220, 209, 0.5);
    animation: dotBounce 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(1) {
    animation-delay: 0s;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Decorative Corners */
.loading-corner {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 2px solid rgba(224, 220, 209, 0.2);
}

.loading-corner:nth-child(1) {
    top: 30px;
    left: 30px;
    border-right: none;
    border-bottom: none;
    animation: cornerPulse 3s ease-in-out infinite;
}

.loading-corner:nth-child(2) {
    top: 30px;
    right: 30px;
    border-left: none;
    border-bottom: none;
    animation: cornerPulse 3s ease-in-out 0.5s infinite;
}

.loading-corner:nth-child(3) {
    bottom: 30px;
    left: 30px;
    border-right: none;
    border-top: none;
    animation: cornerPulse 3s ease-in-out 1s infinite;
}

.loading-corner:nth-child(4) {
    bottom: 30px;
    right: 30px;
    border-left: none;
    border-top: none;
    animation: cornerPulse 3s ease-in-out 1.5s infinite;
}

@keyframes cornerPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Hide scrollbar during loading */
body.loading-active {
    overflow: hidden;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .loading-logo {
        width: 180px;
    }

    .loading-text {
        font-size: 2.8rem;
        letter-spacing: 8px;
    }

    .loading-tagline {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }

    .loading-progress {
        width: 350px;
    }

    .loading-percentage {
        font-size: 1.5rem;
    }

    .loading-glow {
        width: 220px;
        height: 220px;
    }

    .loading-logo-container::after {
        width: 210px;
        height: 210px;
    }
}

@media (max-width: 480px) {
    .loading-logo {
        width: 140px;
    }

    .loading-text {
        font-size: 2.2rem;
        letter-spacing: 6px;
    }

    .loading-tagline {
        font-size: 0.95rem;
        letter-spacing: 1px;
    }

    .loading-progress {
        width: 280px;
        height: 5px;
    }

    .loading-percentage {
        font-size: 1.3rem;
    }

    .loading-message {
        font-size: 0.95rem;
    }

    .loading-dot {
        width: 12px;
        height: 12px;
    }

    .loading-glow {
        width: 180px;
        height: 180px;
    }

    .loading-logo-container::after {
        width: 170px;
        height: 170px;
    }

    .loading-corner {
        width: 40px;
        height: 40px;
    }

    .loading-corner:nth-child(1),
    .loading-corner:nth-child(2) {
        top: 20px;
    }

    .loading-corner:nth-child(3),
    .loading-corner:nth-child(4) {
        bottom: 20px;
    }

    .loading-corner:nth-child(1),
    .loading-corner:nth-child(3) {
        left: 20px;
    }

    .loading-corner:nth-child(2),
    .loading-corner:nth-child(4) {
        right: 20px;
    }
}

/* Extra Small Devices */
@media (max-width: 360px) {
    .loading-logo {
        width: 120px;
    }

    .loading-text {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }

    .loading-progress {
        width: 240px;
    }

    .loading-percentage {
        font-size: 1.1rem;
    }
}
