/* Feel My Sri Lanka Premium Loader */
:root {
    --loader-primary: #14b8a6;
    /* Teal */
    --loader-secondary: #f97316;
    /* Orange */
    --loader-bg: #ffffff;
    --loader-text: #1e293b;
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
}

.loader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Central Animation Container */
.loader-visual {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 40px;
}

/* Pulsing Core */
.loader-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--loader-primary), var(--loader-secondary));
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(20, 184, 166, 0.4);
    animation: corePulse 2s ease-in-out infinite;
    z-index: 2;
}

.loader-core::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: white;
    border-radius: 50%;
    z-index: 1;
}

.loader-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    font-size: 24px;
    color: transparent;
    background: linear-gradient(135deg, var(--loader-primary), var(--loader-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    animation: iconFloat 3s ease-in-out infinite;
}

/* Rotating Rings */
.loader-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--loader-primary);
    border-right-color: rgba(20, 184, 166, 0.3);
    animation: spin 3s linear infinite;
}

.loader-ring:nth-child(2) {
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-bottom-color: var(--loader-secondary);
    border-left-color: rgba(249, 115, 22, 0.3);
    animation: spinReverse 2.5s linear infinite;
}

.loader-ring:nth-child(3) {
    width: 140%;
    height: 140%;
    top: -20%;
    left: -20%;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: pulseRing 2s ease-out infinite;
}

/* Typography */
.loader-title {
    font-family: 'Outfit', sans-serif;
    /* Assuming Outfit or similar is available, otherwise falls back */
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--loader-text);
    margin-bottom: 10px;
    overflow: hidden;
    display: flex;
    gap: 2px;
}

.loader-title span {
    display: inline-block;
    animation: letterReveal 0.8s cubic-bezier(0.215, 0.610, 0.355, 1.000) backwards;
}

/* Staggered animation delays for letters */
.loader-title span:nth-child(1) {
    animation-delay: 0.1s;
}

.loader-title span:nth-child(2) {
    animation-delay: 0.15s;
}

.loader-title span:nth-child(3) {
    animation-delay: 0.2s;
}

.loader-title span:nth-child(4) {
    animation-delay: 0.25s;
}

.loader-title span:nth-child(5) {
    animation-delay: 0.3s;
}

/* Spacer */
.loader-title span:nth-child(6) {
    animation-delay: 0.35s;
}

.loader-title span:nth-child(7) {
    animation-delay: 0.4s;
}

.loader-title span:nth-child(8) {
    animation-delay: 0.45s;
}

/* Spacer */
.loader-title span:nth-child(9) {
    animation-delay: 0.5s;
}

.loader-title span:nth-child(10) {
    animation-delay: 0.55s;
}

.loader-title span:nth-child(11) {
    animation-delay: 0.6s;
}

.loader-title span:nth-child(12) {
    animation-delay: 0.65s;
}

/* Spacer */
.loader-title span:nth-child(13) {
    animation-delay: 0.7s;
}

.loader-title span:nth-child(14) {
    animation-delay: 0.75s;
}

.loader-title span:nth-child(15) {
    animation-delay: 0.8s;
}

.loader-title span:nth-child(16) {
    animation-delay: 0.85s;
}

.loader-title span:nth-child(17) {
    animation-delay: 0.9s;
}

.loader-subtitle {
    font-size: 12px;
    color: #94a3b8;
    letter-spacing: 4px;
    text-transform: uppercase;
    animation: fadeIn 1s ease-out 1s backwards;
}

/* Animations */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes spinReverse {
    0% {
        transform: rotate(360deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

@keyframes corePulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 30px rgba(20, 184, 166, 0.4);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 50px rgba(249, 115, 22, 0.4);
    }
}

@keyframes iconFloat {

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

    50% {
        transform: translate(-50%, -50%) translateY(-3px);
    }
}

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

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

@keyframes letterReveal {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

/* Mobile Adjustments */
@media (max-width: 768px) {
    .loader-visual {
        width: 100px;
        height: 100px;
    }

    .loader-title {
        font-size: 18px;
    }
}