/* ======================================== */
/* MODERN LOADER - BIJNORI CHAI WALA THEME  */
/* Premium Design with Smooth Animations    */
/* ======================================== */

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a0f08 0%, #2d1a0e 50%, #1a0f08 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hide loader after page loads */
.loader-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Loader Container */
.loader-container {
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
    padding: 20px;
}

/* Animated Cup Icon with Glow Effect */
.loader-cup {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
}

.loader-cup i {
    font-size: 85px;
    color: #c46b2b;
    animation: cupFloat 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(196, 107, 43, 0.6));
    transition: filter 0.3s ease;
}

.loader-cup:hover i {
    filter: drop-shadow(0 0 30px rgba(196, 107, 43, 0.9));
}

/* Pulse Ring Around Cup */
.loader-cup::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border: 2px solid rgba(196, 107, 43, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulseRing 2s ease-out infinite;
}

.loader-cup::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    border: 1px solid rgba(196, 107, 43, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulseRing 2s ease-out infinite 0.5s;
}

/* Steam Animation - Enhanced */
.loader-steam {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    pointer-events: none;
}

.steam {
    width: 5px;
    height: 30px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 3px;
    animation: steam 2s ease-in-out infinite;
    filter: blur(1px);
}

.steam:nth-child(1) {
    animation-delay: 0s;
    transform: translateX(-15px);
}

.steam:nth-child(2) {
    animation-delay: 0.3s;
}

.steam:nth-child(3) {
    animation-delay: 0.6s;
    transform: translateX(15px);
}

/* Loading Text with Gradient Animation */
.loader-text {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 4px;
    margin-bottom: 25px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #c46b2b, #e8904a, #f5a65b, #e8904a, #c46b2b);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: textShine 3s ease infinite;
    position: relative;
    display: inline-block;
}

/* Decorative Lines Around Text */
.loader-text::before,
.loader-text::after {
    content: '✦';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #c46b2b;
    opacity: 0.6;
    animation: starTwinkle 1.5s ease-in-out infinite;
}

.loader-text::before {
    left: -30px;
}

.loader-text::after {
    right: -30px;
}

/* Progress Bar with Glow */
.loader-progress {
    width: 280px;
    height: 4px;
    background: rgba(196, 107, 43, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 0 10px rgba(196, 107, 43, 0.2);
}

.loader-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #c46b2b, #e8904a, #f5a65b, #e8904a, #c46b2b);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: progressLoad 2.5s ease-out forwards, progressShine 1.5s linear infinite;
    position: relative;
    box-shadow: 0 0 8px rgba(196, 107, 43, 0.5);
}

/* Progress Percentage Text */
.loader-percentage {
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #c46b2b;
    letter-spacing: 1px;
    font-family: monospace;
}

/* Bouncing Dots - Enhanced */
.loader-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 25px;
}

.dot {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #c46b2b, #e8904a);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
    box-shadow: 0 0 5px rgba(196, 107, 43, 0.5);
}

.dot:nth-child(1) {
    animation-delay: 0s;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Subtitle with Typing Effect */
.loader-subtitle {
    font-size: 13px;
    color: #b89573;
    margin-top: 25px;
    letter-spacing: 2px;
    font-weight: 400;
    position: relative;
    display: inline-block;
    border-right: 2px solid #c46b2b;
    white-space: nowrap;
    overflow: hidden;
    animation: typing 3s steps(30, end), blinkCursor 0.75s step-end infinite;
}

/* ======================================== */
/* ANIMATIONS                               */
/* ======================================== */

@keyframes cupFloat {

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

    25% {
        transform: translateY(-8px) rotate(-2deg);
    }

    75% {
        transform: translateY(-12px) rotate(2deg);
    }
}

@keyframes steam {
    0% {
        transform: translateY(0) scaleY(1) scaleX(1);
        opacity: 0.8;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(-50px) scaleY(2) scaleX(0.5);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes textShine {
    0% {
        background-position: -100% 50%;
    }

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

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

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

    10% {
        width: 5%;
    }

    25% {
        width: 25%;
    }

    40% {
        width: 45%;
    }

    60% {
        width: 70%;
    }

    80% {
        width: 88%;
    }

    100% {
        width: 100%;
    }
}

@keyframes progressShine {
    0% {
        background-position: 0% 0%;
    }

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

@keyframes bounce {

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

    30% {
        transform: translateY(-12px) scale(1.2);
    }
}

@keyframes pulseRing {
    0% {
        width: 80px;
        height: 80px;
        opacity: 0.6;
    }

    100% {
        width: 150px;
        height: 150px;
        opacity: 0;
    }
}

@keyframes starTwinkle {

    0%,
    100% {
        opacity: 0.3;
        transform: translateY(-50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translateY(-50%) scale(1.2);
    }
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blinkCursor {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: #c46b2b;
    }
}

/* ======================================== */
/* RESPONSIVE LOADER - ALL SCREENS          */
/* ======================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .loader-cup {
        width: 100px;
        height: 100px;
    }

    .loader-cup i {
        font-size: 70px;
    }

    .loader-text {
        font-size: 22px;
        letter-spacing: 3px;
    }

    .loader-text::before,
    .loader-text::after {
        font-size: 14px;
    }

    .loader-text::before {
        left: -25px;
    }

    .loader-text::after {
        right: -25px;
    }

    .loader-progress {
        width: 250px;
    }

    .loader-subtitle {
        font-size: 12px;
    }
}

/* Mobile Large (481px - 767px) */
@media (max-width: 767px) and (min-width: 481px) {
    .loader-cup {
        width: 85px;
        height: 85px;
        margin-bottom: 25px;
    }

    .loader-cup i {
        font-size: 60px;
    }

    .loader-cup::before {
        width: 70px;
        height: 70px;
    }

    .loader-cup::after {
        width: 90px;
        height: 90px;
    }

    .loader-text {
        font-size: 20px;
        letter-spacing: 3px;
        margin-bottom: 20px;
    }

    .loader-text::before,
    .loader-text::after {
        font-size: 12px;
    }

    .loader-text::before {
        left: -22px;
    }

    .loader-text::after {
        right: -22px;
    }

    .loader-progress {
        width: 220px;
        height: 3px;
    }

    .loader-percentage {
        font-size: 12px;
    }

    .dot {
        width: 8px;
        height: 8px;
    }

    .loader-subtitle {
        font-size: 11px;
        letter-spacing: 1.5px;
    }

    .steam {
        width: 4px;
        height: 25px;
    }
}

/* Mobile Small (320px - 480px) */
@media (max-width: 480px) {
    .loader-cup {
        width: 70px;
        height: 70px;
        margin-bottom: 20px;
    }

    .loader-cup i {
        font-size: 50px;
    }

    .loader-cup::before {
        width: 60px;
        height: 60px;
        animation: pulseRing 1.5s ease-out infinite;
    }

    .loader-cup::after {
        width: 75px;
        height: 75px;
    }

    .loader-text {
        font-size: 16px;
        letter-spacing: 2px;
        margin-bottom: 18px;
    }

    .loader-text::before,
    .loader-text::after {
        display: none;
    }

    .loader-progress {
        width: 180px;
        height: 3px;
    }

    .loader-percentage {
        font-size: 11px;
        margin-top: 10px;
    }

    .loader-dots {
        gap: 8px;
        margin-top: 20px;
    }

    .dot {
        width: 7px;
        height: 7px;
    }

    .loader-subtitle {
        font-size: 10px;
        letter-spacing: 1px;
        margin-top: 20px;
        white-space: normal;
        animation: none;
        border-right: none;
    }

    .steam {
        width: 3px;
        height: 20px;
        gap: 12px;
    }

    .loader-steam {
        gap: 12px;
        top: -20px;
    }
}

/* Extra Small (up to 320px) */
@media (max-width: 320px) {
    .loader-cup {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }

    .loader-cup i {
        font-size: 42px;
    }

    .loader-text {
        font-size: 14px;
        letter-spacing: 1.5px;
    }

    .loader-progress {
        width: 150px;
    }

    .loader-percentage {
        font-size: 10px;
    }

    .loader-subtitle {
        font-size: 9px;
    }
}

/* Landscape Mode */
@media (max-width: 768px) and (orientation: landscape) {
    .loader-overlay {
        padding: 20px;
    }

    .loader-cup {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }

    .loader-cup i {
        font-size: 45px;
    }

    .loader-text {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .loader-progress {
        width: 200px;
    }

    .loader-dots {
        margin-top: 15px;
    }

    .loader-subtitle {
        margin-top: 15px;
    }
}

/* High DPI Screens (Retina) */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .loader-cup i {
        filter: drop-shadow(0 0 15px rgba(196, 107, 43, 0.8));
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {

    .loader-overlay,
    .loader-cup i,
    .loader-text,
    .loader-progress-bar,
    .dot,
    .steam,
    .loader-cup::before,
    .loader-cup::after {
        animation: none !important;
        transition: none !important;
    }

    .loader-subtitle {
        animation: none !important;
        border-right: none;
    }

    .loader-progress-bar {
        width: 100% !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .loader-overlay {
        background: linear-gradient(135deg, #0a0604 0%, #1a0f08 50%, #0a0604 100%);
    }
}

/* Print Styles */
@media print {
    .loader-overlay {
        display: none;
    }
}