/* ================================================================
   PREMIUM ANIMATED LOADER - Dream Event
   ================================================================ */

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFFDF7 0%, #FDF8F0 30%, #F5EDD8 70%, #EDE0C4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* ===== EXIT ANIMATIONS ===== */
.loader.exit-active .loader-main {
    animation: loaderContentOut 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.loader.exit-active .loader-particles,
.loader.exit-active .loader-shapes {
    animation: loaderContentOut 0.5s ease forwards;
}

.loader.exit-active {
    animation: loaderFadeOut 0.8s ease 0.3s forwards;
}

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

@keyframes loaderFadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Hidden state */
.loader.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ===== BACKGROUND PARTICLES ===== */
.loader-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.l-particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: lParticleFloat 6s infinite ease-in-out;
}

.l-particle:nth-child(1)  { width: 6px; height: 6px; background: #C9A84C; top: 15%; left: 10%;  animation-delay: 0s;    animation-duration: 5s; }
.l-particle:nth-child(2)  { width: 4px; height: 4px; background: #E8D48B; top: 25%; left: 85%;  animation-delay: 0.5s;  animation-duration: 7s; }
.l-particle:nth-child(3)  { width: 8px; height: 8px; background: #B76E79; top: 70%; left: 15%;  animation-delay: 1s;    animation-duration: 6s; }
.l-particle:nth-child(4)  { width: 5px; height: 5px; background: #C9A84C; top: 80%; left: 75%;  animation-delay: 1.5s;  animation-duration: 8s; }
.l-particle:nth-child(5)  { width: 3px; height: 3px; background: #E8D48B; top: 40%; left: 5%;   animation-delay: 2s;    animation-duration: 5.5s; }
.l-particle:nth-child(6)  { width: 7px; height: 7px; background: #D4A0A8; top: 10%; left: 50%;  animation-delay: 0.3s;  animation-duration: 6.5s; }
.l-particle:nth-child(7)  { width: 4px; height: 4px; background: #C9A84C; top: 55%; left: 90%;  animation-delay: 0.8s;  animation-duration: 7.5s; }
.l-particle:nth-child(8)  { width: 6px; height: 6px; background: #E8D48B; top: 90%; left: 40%;  animation-delay: 1.2s;  animation-duration: 5s; }
.l-particle:nth-child(9)  { width: 5px; height: 5px; background: #B76E79; top: 35%; left: 70%;  animation-delay: 1.8s;  animation-duration: 6s; }
.l-particle:nth-child(10) { width: 3px; height: 3px; background: #C9A84C; top: 60%; left: 30%;  animation-delay: 2.2s;  animation-duration: 7s; }
.l-particle:nth-child(11) { width: 7px; height: 7px; background: #E8D48B; top: 5%;  left: 30%;  animation-delay: 0.2s;  animation-duration: 5.8s; }
.l-particle:nth-child(12) { width: 4px; height: 4px; background: #D4A0A8; top: 45%; left: 55%;  animation-delay: 0.7s;  animation-duration: 6.3s; }
.l-particle:nth-child(13) { width: 5px; height: 5px; background: #C9A84C; top: 75%; left: 60%;  animation-delay: 1.3s;  animation-duration: 7.2s; }
.l-particle:nth-child(14) { width: 6px; height: 6px; background: #E8D48B; top: 20%; left: 40%;  animation-delay: 1.6s;  animation-duration: 5.5s; }
.l-particle:nth-child(15) { width: 3px; height: 3px; background: #B76E79; top: 85%; left: 20%;  animation-delay: 2.1s;  animation-duration: 6.8s; }
.l-particle:nth-child(16) { width: 8px; height: 8px; background: #C9A84C; top: 50%; left: 45%;  animation-delay: 0.4s;  animation-duration: 8.5s; }
.l-particle:nth-child(17) { width: 4px; height: 4px; background: #E8D48B; top: 30%; left: 95%;  animation-delay: 0.9s;  animation-duration: 5.2s; }
.l-particle:nth-child(18) { width: 6px; height: 6px; background: #D4A0A8; top: 65%; left: 8%;   animation-delay: 1.4s;  animation-duration: 6.6s; }
.l-particle:nth-child(19) { width: 5px; height: 5px; background: #C9A84C; top: 95%; left: 85%;  animation-delay: 1.9s;  animation-duration: 7.4s; }
.l-particle:nth-child(20) { width: 3px; height: 3px; background: #E8D48B; top: 8%;  left: 72%;  animation-delay: 2.3s;  animation-duration: 5.7s; }

@keyframes lParticleFloat {
    0%   { opacity: 0;   transform: translateY(0) scale(0); }
    15%  { opacity: 0.6; transform: scale(1); }
    50%  { opacity: 0.8; transform: translateY(-40px) translateX(20px) scale(1.2); }
    85%  { opacity: 0.4; transform: translateY(-80px) translateX(-15px) scale(0.8); }
    100% { opacity: 0;   transform: translateY(-120px) translateX(10px) scale(0); }
}

/* ===== BACKGROUND SHAPES ===== */
.loader-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.l-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: lShapeMove 12s infinite ease-in-out;
}

.l-shape-1 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.15), transparent 70%);
    top: -10%;
    right: -5%;
    animation-delay: 0s;
}

.l-shape-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(183, 110, 121, 0.12), transparent 70%);
    bottom: -10%;
    left: -5%;
    animation-delay: 2s;
}

.l-shape-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(232, 212, 139, 0.14), transparent 70%);
    top: 40%;
    left: 60%;
    animation-delay: 4s;
}

@keyframes lShapeMove {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(30px, -20px) scale(1.1); }
    50%      { transform: translate(-20px, 30px) scale(0.9); }
    75%      { transform: translate(15px, 15px) scale(1.05); }
}

/* ===== MAIN LOADER CONTENT ===== */
.loader-main {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* ===== RING LOGO MARK ===== */
.loader-logo-mark {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-ring-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.l-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 2px solid transparent;
}

.l-ring-1 {
    width: 130px;
    height: 130px;
    margin: -65px 0 0 -65px;
    border-top-color: #C9A84C;
    border-right-color: rgba(201, 168, 76, 0.3);
    animation: ringRotate1 2.5s linear infinite;
}

.l-ring-2 {
    width: 105px;
    height: 105px;
    margin: -52.5px 0 0 -52.5px;
    border-bottom-color: #B76E79;
    border-left-color: rgba(183, 110, 121, 0.3);
    animation: ringRotate2 3s linear infinite;
}

.l-ring-3 {
    width: 80px;
    height: 80px;
    margin: -40px 0 0 -40px;
    border-top-color: #E8D48B;
    border-left-color: rgba(232, 212, 139, 0.3);
    border-style: dashed;
    animation: ringRotate1 4s linear infinite;
}

@keyframes ringRotate1 {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes ringRotate2 {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}

/* Center Icon */
.loader-center-icon {
    position: relative;
    z-index: 5;
    animation: centerPulse 2.5s infinite ease-in-out;
}

.sparkle-icon {
    font-size: 2.8rem;
    filter: drop-shadow(0 4px 15px rgba(201, 168, 76, 0.5));
    display: block;
    line-height: 1;
}

@keyframes centerPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 15px rgba(201, 168, 76, 0.3));
    }
    50% {
        transform: scale(1.2) rotate(20deg);
        filter: drop-shadow(0 0 35px rgba(201, 168, 76, 0.7));
    }
}

/* Orbiting Dots */
.orbit-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: orbitSpin 3.5s linear infinite;
    pointer-events: none;
}

.orbit-dot {
    position: absolute;
    border-radius: 50%;
}

.orbit-dot-1 {
    width: 8px;
    height: 8px;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: #C9A84C;
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.8), 0 0 25px rgba(201, 168, 76, 0.4);
    animation: dotGlow 1.5s infinite ease-in-out;
}

.orbit-dot-2 {
    width: 6px;
    height: 6px;
    bottom: 12%;
    right: 2px;
    background: #B76E79;
    box-shadow: 0 0 10px rgba(183, 110, 121, 0.7);
    animation: dotGlow 1.5s 0.5s infinite ease-in-out;
}

.orbit-dot-3 {
    width: 5px;
    height: 5px;
    bottom: 12%;
    left: 2px;
    background: #E8D48B;
    box-shadow: 0 0 10px rgba(232, 212, 139, 0.7);
    animation: dotGlow 1.5s 1s infinite ease-in-out;
}

@keyframes orbitSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes dotGlow {
    0%, 100% { transform: scale(1);   opacity: 0.7; }
    50%      { transform: scale(1.6); opacity: 1; }
}

/* ===== BRAND NAME LETTERS ===== */
.loader-brand {
    text-align: center;
    overflow: hidden;
}

.loader-brand-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.loader-letter {
    display: inline-block;
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 800;
    color: #2d2010;
    opacity: 0;
    transform: translateY(60px) rotateX(90deg);
    animation: letterReveal 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: calc(0.3s + var(--i) * 0.08s);
    position: relative;
}

.loader-gold-letter {
    color: #A07830;
}

.loader-gold-letter::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #C9A84C, #E8D48B);
    transform: scaleX(0);
    transform-origin: left;
    animation: letterLine 0.4s ease forwards;
    animation-delay: calc(1.2s + var(--i) * 0.08s);
}

.loader-space {
    width: 14px;
}

.loader-space::after {
    display: none !important;
}

@keyframes letterReveal {
    0% {
        opacity: 0;
        transform: translateY(60px) rotateX(90deg) scale(0.5);
        filter: blur(10px);
    }
    60% {
        filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg) scale(1);
        filter: blur(0px);
    }
}

@keyframes letterLine {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* ===== TAGLINE ===== */
.loader-tagline {
    opacity: 0;
    animation: taglineFade 0.8s ease forwards;
    animation-delay: 1.6s;
}

.loader-tagline span {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(0.7rem, 2vw, 0.92rem);
    font-weight: 400;
    color: #8a7a6a;
    letter-spacing: 4px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    padding: 0 25px;
}

.loader-tagline span::before,
.loader-tagline span::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 25px;
    height: 1px;
}

.loader-tagline span::before {
    right: 100%;
    background: linear-gradient(to left, #C9A84C, transparent);
}

.loader-tagline span::after {
    left: 100%;
    background: linear-gradient(to right, #C9A84C, transparent);
}

@keyframes taglineFade {
    from {
        opacity: 0;
        transform: translateY(15px);
        letter-spacing: 10px;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: 4px;
    }
}

/* ===== PROGRESS BAR ===== */
.loader-progress-wrap {
    width: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    opacity: 0;
    animation: progressFadeIn 0.5s ease forwards;
    animation-delay: 1.9s;
}

.loader-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(201, 168, 76, 0.15);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.loader-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #A07830, #C9A84C, #E8D48B, #C9A84C);
    background-size: 300% 100%;
    border-radius: 10px;
    transition: width 0.15s ease;
    animation: progressShimmer 1.5s infinite linear;
    position: relative;
}

.loader-progress-bar::after {
    content: '';
    position: absolute;
    top: -4px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.8), rgba(201, 168, 76, 0) 70%);
    border-radius: 50%;
    filter: blur(2px);
}

@keyframes progressShimmer {
    from { background-position: -300% 0; }
    to   { background-position: 300% 0; }
}

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

.loader-progress-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #A07830;
    letter-spacing: 2px;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.loader-progress-text small {
    font-size: 0.7rem;
    font-weight: 500;
    color: #C9A84C;
}

/* ===== BOTTOM DECORATION ===== */
.loader-bottom-decor {
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    animation: taglineFade 0.6s ease forwards;
    animation-delay: 2.1s;
}

.decor-line {
    width: 45px;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(201, 168, 76, 0.5), transparent);
}

.decor-diamond {
    font-size: 0.55rem;
    color: #C9A84C;
    animation: diamondSpin 4s linear infinite;
    line-height: 1;
}

@keyframes diamondSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .loader-logo-mark {
        width: 115px;
        height: 115px;
    }

    .l-ring-1 {
        width: 108px;
        height: 108px;
        margin: -54px 0 0 -54px;
    }

    .l-ring-2 {
        width: 86px;
        height: 86px;
        margin: -43px 0 0 -43px;
    }

    .l-ring-3 {
        width: 64px;
        height: 64px;
        margin: -32px 0 0 -32px;
    }

    .sparkle-icon {
        font-size: 2.2rem;
    }

    .loader-letter {
        font-size: 1.8rem;
    }

    .loader-progress-wrap {
        width: 180px;
    }
}

@media (max-width: 400px) {
    .loader-logo-mark {
        width: 95px;
        height: 95px;
    }

    .l-ring-1 {
        width: 90px;
        height: 90px;
        margin: -45px 0 0 -45px;
    }

    .l-ring-2 {
        width: 72px;
        height: 72px;
        margin: -36px 0 0 -36px;
    }

    .l-ring-3 {
        width: 54px;
        height: 54px;
        margin: -27px 0 0 -27px;
    }

    .sparkle-icon {
        font-size: 1.8rem;
    }

    .loader-letter {
        font-size: 1.5rem;
    }

    .loader-progress-wrap {
        width: 150px;
    }

    .loader-main {
        gap: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .loader *,
    .loader *::before,
    .loader *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}