/* Luxury loader with light semi-transparent background */
.luxury-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(248, 245, 242, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 1s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    box-sizing: border-box;
}

.luxury-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Main container - responsive sizing */
.rings-container {
    position: relative;
    width: min(220px, 80vw, 80vh);
    height: min(220px, 80vw, 80vh);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

/* Base invisible ring for structure */
.base-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* RING 1 - Largest (Rotates clockwise) */
.ring-1 {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: max(0.1vw, 1px) solid transparent;
    border-top: max(0.1vw, 1px) solid #013220;
    border-right: max(0.1vw, 1px) solid #013220;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 50%, 50% 50%, 50% 0);
    animation: rotate-clockwise-1 6s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
    filter: drop-shadow(0 0 3px rgba(1, 50, 32, 0.15));
}

/* RING 2 - Medium (Rotates counterclockwise) */
.ring-2 {
    position: absolute;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    border: max(0.1vw, 0.9px) solid transparent;
    border-bottom: max(0.1vw, 0.9px) solid rgba(1, 50, 32, 0.7);
    border-left: max(0.1vw, 0.9px) solid rgba(1, 50, 32, 0.7);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 50%, 50% 50%, 50% 0);
    animation: rotate-counterclockwise-2 5s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
    transform: rotate(180deg);
}

/* RING 3 - Smaller (Rotates clockwise) */
.ring-3 {
    position: absolute;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    border: max(0.08vw, 0.8px) solid transparent;
    border-top: max(0.08vw, 0.8px) solid rgba(1, 50, 32, 0.9);
    border-right: max(0.08vw, 0.8px) solid rgba(1, 50, 32, 0.9);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 50%, 50% 50%, 50% 0);
    animation: rotate-clockwise-3 4s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
}

/* RING 4 - Smallest (Rotates counterclockwise) */
.ring-4 {
    position: absolute;
    width: 40%;
    height: 40%;
    border-radius: 50%;
    border: max(0.06vw, 0.6px) solid transparent;
    border-bottom: max(0.06vw, 0.6px) solid rgba(1, 50, 32, 0.6);
    border-left: max(0.06vw, 0.6px) solid rgba(1, 50, 32, 0.6);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 50%, 50% 50%, 50% 0);
    animation: rotate-counterclockwise-4 3s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
    transform: rotate(180deg);
}

/* Crimson accent rings - one for each main ring */
.crimson-accent {
    position: absolute;
    border-radius: 50%;
    border: max(0.08vw, 0.8px) solid transparent;
    animation: crimson-pulse 4s ease-in-out infinite;
}

.accent-1 {
    width: 100%;
    height: 100%;
    border-top: max(0.1vw, 1px) solid #DC143C;
    transform: rotate(324deg);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 50%, 50% 50%, 50% 0);
    animation-delay: 0s;
}

.accent-2 {
    width: 80%;
    height: 80%;
    border-bottom: max(0.1vw, 0.9px) solid rgba(220, 20, 60, 0.8);
    transform: rotate(144deg);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 50%, 50% 50%, 50% 0);
    animation-delay: 1s;
}

.accent-3 {
    width: 60%;
    height: 60%;
    border-top: max(0.08vw, 0.8px) solid rgba(220, 20, 60, 0.7);
    transform: rotate(324deg);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 50%, 50% 50%, 50% 0);
    animation-delay: 2s;
}

.accent-4 {
    width: 40%;
    height: 40%;
    border-bottom: max(0.08vw, 0.8px) solid rgba(220, 20, 60, 0.6);
    transform: rotate(144deg);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 50%, 50% 50%, 50% 0);
    animation-delay: 3s;
}

/* Enlarged logo container */
.logo-center {
    position: absolute;
    width: min(120px, 54vw, 54vh);
    height: min(120px, 54vw, 54vh);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow:
        0 0 0 max(0.3vw, 1.5px) rgba(1, 50, 32, 0.05),
        0 min(1.5vw, 15px) min(4vw, 40px) rgba(0, 0, 0, 0.08),
        inset 0 0 min(3vw, 30px) rgba(255, 255, 255, 0.95);
    z-index: 10;
    animation: logo-float 3s ease-in-out infinite;
}

.logo-img {
    width: min(85px, 38vw, 38vh);
    height: min(85px, 38vw, 38vh);
    object-fit: contain;
    filter: brightness(1.05) contrast(1.05) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Animations */
@keyframes rotate-clockwise-1 {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes rotate-counterclockwise-2 {
    0% {
        transform: rotate(180deg);
    }

    100% {
        transform: rotate(540deg);
    }
}

@keyframes rotate-clockwise-3 {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes rotate-counterclockwise-4 {
    0% {
        transform: rotate(180deg);
    }

    100% {
        transform: rotate(540deg);
    }
}

@keyframes crimson-pulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

@keyframes logo-float {

    0%,
    100% {
        transform: scale(1) translateY(0);
        box-shadow:
            0 0 0 max(0.3vw, 1.5px) rgba(1, 50, 32, 0.05),
            0 min(1.5vw, 15px) min(4vw, 40px) rgba(0, 0, 0, 0.08),
            inset 0 0 min(3vw, 30px) rgba(255, 255, 255, 0.95);
    }

    50% {
        transform: scale(1.02) translateY(-5px);
        box-shadow:
            0 0 0 max(0.3vw, 1.5px) rgba(1, 50, 32, 0.08),
            0 min(2vw, 20px) min(5vw, 50px) rgba(0, 0, 0, 0.12),
            inset 0 0 min(4vw, 40px) rgba(255, 255, 255, 1);
    }
}

/* Media Queries for specific adjustments */
@media (max-width: 768px) {
    .luxury-loader {
        backdrop-filter: blur(4px);
        padding: 15px;
    }

    .rings-container {
        width: min(200px, 85vw, 85vh);
        height: min(200px, 85vw, 85vh);
    }

    .logo-center {
        width: min(100px, 45vw, 45vh);
        height: min(100px, 45vw, 45vh);
    }

    .logo-img {
        width: min(70px, 32vw, 32vh);
        height: min(70px, 32vw, 32vh);
    }
}

@media (max-width: 480px) {
    .luxury-loader {
        backdrop-filter: blur(3px);
        padding: 10px;
    }

    .rings-container {
        width: min(180px, 90vw, 90vh);
        height: min(180px, 90vw, 90vh);
    }

    .logo-center {
        width: min(90px, 40vw, 40vh);
        height: min(90px, 40vw, 40vh);
    }

    .logo-img {
        width: min(60px, 28vw, 28vh);
        height: min(60px, 28vw, 28vh);
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    .luxury-loader {
        padding: 5px;
    }

    .rings-container {
        width: min(150px, 70vh, 70vw);
        height: min(150px, 70vh, 70vw);
    }

    .logo-center {
        width: min(80px, 37vh, 37vw);
        height: min(80px, 37vh, 37vw);
    }

    .logo-img {
        width: min(55px, 25vh, 25vw);
        height: min(55px, 25vh, 25vw);
    }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    .luxury-loader {
        height: -webkit-fill-available;
    }
}

/* Ensure proper centering on all devices */
/* REMOVED the body, html overflow: hidden rules */

/* Prevent any transform issues */
.luxury-loader * {
    transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}