/* ============================================
   PREMIUM DENTAL LOADER ANIMATION
   Animated tooth SVG with glow + sparkle effects
============================================ */

/* Full-screen overlay */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a1628 0%, #0d2847 40%, #122d4f 70%, #0a1628 100%);
    background-size: 400% 400%;
    animation: loaderBgShift 4s ease infinite;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes loaderBgShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Glow ring behind the tooth */
.loader-glow {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 170, 0.25) 0%, rgba(0, 167, 225, 0.12) 40%, transparent 70%);
    animation: glowPulse 2s ease-in-out infinite;
    filter: blur(20px);
}

@keyframes glowPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Tooth SVG Container */
.loader-tooth {
    position: relative;
    width: 120px;
    height: 140px;
    animation: toothFloat 2.5s ease-in-out infinite;
}

@keyframes toothFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

/* The SVG tooth path – stroke draw animation */
.loader-tooth svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 25px rgba(0, 212, 170, 0.5));
}

.loader-tooth .tooth-outline {
    fill: none;
    stroke: url(#toothGradient);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: drawTooth 1.5s ease-in-out forwards;
}

.loader-tooth .tooth-fill {
    fill: url(#toothFillGradient);
    opacity: 0;
    animation: fillTooth 0.6s ease forwards 1.2s;
}

@keyframes drawTooth {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes fillTooth {
    to {
        opacity: 1;
    }
}

/* Sparkle / shine effect on tooth */
.loader-sparkle {
    position: absolute;
    width: 12px;
    height: 12px;
    opacity: 0;
}

.loader-sparkle svg {
    width: 100%;
    height: 100%;
}

.loader-sparkle.s1 {
    top: 8px;
    right: 10px;
    animation: sparkleIn 0.5s ease forwards 1.5s, sparklePulse 1.2s ease-in-out infinite 1.5s;
}

.loader-sparkle.s2 {
    top: 25px;
    left: 8px;
    animation: sparkleIn 0.5s ease forwards 1.7s, sparklePulse 1.2s ease-in-out infinite 1.7s;
    width: 8px;
    height: 8px;
}

.loader-sparkle.s3 {
    bottom: 40px;
    right: 5px;
    animation: sparkleIn 0.5s ease forwards 1.9s, sparklePulse 1.2s ease-in-out infinite 1.9s;
    width: 10px;
    height: 10px;
}

@keyframes sparkleIn {
    to {
        opacity: 1;
    }
}

@keyframes sparklePulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.6;
    }
}

/* Orbiting dots around the tooth */
.loader-orbit {
    position: absolute;
    width: 200px;
    height: 200px;
    animation: orbitSpin 3s linear infinite;
}

.loader-orbit .orbit-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00d4aa;
    box-shadow: 0 0 10px rgba(0, 212, 170, 0.6);
}

.loader-orbit .orbit-dot:nth-child(1) {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.loader-orbit .orbit-dot:nth-child(2) {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #00a7e1;
    box-shadow: 0 0 10px rgba(0, 167, 225, 0.6);
    width: 5px;
    height: 5px;
}

.loader-orbit .orbit-dot:nth-child(3) {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
    width: 4px;
    height: 4px;
}

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

/* Brand text below */
.loader-brand {
    margin-top: 36px;
    text-align: center;
    opacity: 0;
    transform: translateY(15px);
    animation: brandReveal 0.6s ease forwards 1.4s;
}

.loader-brand .brand-name {
    font-family: 'Poppins', sans-serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 6px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #00d4aa, #00a7e1, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loader-brand .brand-tagline {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    margin-top: 6px;
}

@keyframes brandReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress bar at the bottom */
.loader-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #00d4aa, #00a7e1, #00d4aa);
    background-size: 200% 100%;
    animation: progressFill 2s ease-in-out forwards, shimmerBar 1s linear infinite;
    border-radius: 0 3px 3px 0;
}

@keyframes progressFill {
    0% {
        width: 0%;
    }

    60% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

@keyframes shimmerBar {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Floating dental icons in loader background */
.loader-bg-icons {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.loader-bg-icon {
    position: absolute;
    color: rgba(255, 255, 255, 0.04);
    font-size: 40px;
    animation: bgIconFloat 8s ease-in-out infinite;
}

.loader-bg-icon:nth-child(1) {
    top: 15%;
    left: 10%;
    animation-delay: 0s;
    font-size: 35px;
}

.loader-bg-icon:nth-child(2) {
    top: 70%;
    left: 85%;
    animation-delay: 2s;
    font-size: 50px;
}

.loader-bg-icon:nth-child(3) {
    top: 30%;
    right: 15%;
    animation-delay: 4s;
    font-size: 30px;
}

.loader-bg-icon:nth-child(4) {
    bottom: 20%;
    left: 20%;
    animation-delay: 1s;
    font-size: 45px;
}

.loader-bg-icon:nth-child(5) {
    top: 50%;
    left: 60%;
    animation-delay: 3s;
    font-size: 28px;
}

@keyframes bgIconFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.04;
    }

    50% {
        transform: translateY(-20px) rotate(10deg);
        opacity: 0.08;
    }
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 576px) {
    .loader-tooth {
        width: 90px;
        height: 105px;
    }

    .loader-glow {
        width: 160px;
        height: 160px;
    }

    .loader-orbit {
        width: 150px;
        height: 150px;
    }

    .loader-brand .brand-name {
        font-size: 20px;
        letter-spacing: 4px;
    }

    .loader-brand .brand-tagline {
        font-size: 9px;
        letter-spacing: 2px;
    }
}