/**
 * TEAYM Page Loader Styles
 * Theme-aware loader with orbiting dots animation
 *
 * @package teaym
 */

/* ========================================
   LOADER CONTAINER
======================================== */
.teaym-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999; /* Above all content including Elementor editor and sticky header */
    transition: opacity 0.5s ease, visibility 0.5s ease;
    opacity: 1;
    visibility: visible;
	backdrop-filter:blur(10px);
}
html[data-theme="dark"] .teaym-page-loader{
    background-color: rgba(0,0,0,0.5);
	
}

/* Hidden state */
.teaym-page-loader.teaym-loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ========================================
   LOADER CONTENT
======================================== */
.teaym-loader-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
}

/* ========================================
   LOGO STYLING
======================================== */
.teaym-loader-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: teaym-pulse 2s ease-in-out infinite;
}

.teaym-loader-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px var(--shadow));
}

/* ========================================
   ORBITING DOTS CONTAINER
======================================== */
.teaym-loader-orbit {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    animation: teaym-orbit-rotate 3s linear infinite;
}

/* ========================================
   INDIVIDUAL DOTS
======================================== */
.teaym-loader-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 12px var(--primary-color), 0 0 20px rgba(0, 87, 255, 0.5);
    animation: teaym-dot-pulse 1.5s ease-in-out infinite;
}

/* Position 8 dots at 45-degree intervals around the circle */
.teaym-dot-1 {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0s;
}

.teaym-dot-2 {
    top: 17px;
    right: 17px;
    animation-delay: 0.1875s;
}

.teaym-dot-3 {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    animation-delay: 0.375s;
}

.teaym-dot-4 {
    bottom: 17px;
    right: 17px;
    animation-delay: 0.5625s;
}

.teaym-dot-5 {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0.75s;
}

.teaym-dot-6 {
    bottom: 17px;
    left: 17px;
    animation-delay: 0.9375s;
}

.teaym-dot-7 {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    animation-delay: 1.125s;
}

.teaym-dot-8 {
    top: 17px;
    left: 17px;
    animation-delay: 1.3125s;
}

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

/* Logo pulse animation */
@keyframes teaym-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.9;
    }
}

/* Orbit rotation */
@keyframes teaym-orbit-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Dot pulse animation */
@keyframes teaym-dot-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* ========================================
   DARK THEME ADJUSTMENTS
======================================== */
html[data-theme="dark"] .teaym-loader-logo img {
    filter: brightness(1.2) drop-shadow(0 4px 16px rgba(255, 255, 255, 0.3));
}

html[data-theme="dark"] .teaym-loader-dot {
    background: var(--primary-color);
    box-shadow: 0 0 16px var(--primary_color), 0 0 24px rgba(0, 87, 255, 0.8), 0 0 32px rgba(0, 87, 255, 0.4);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
======================================== */
@media (max-width: 768px) {
    .teaym-loader-content {
        width: 150px;
        height: 150px;
    }

    .teaym-loader-logo {
        width: 60px;
        height: 60px;
    }

    .teaym-loader-orbit {
        width: 120px;
        height: 120px;
    }

    .teaym-loader-dot {
        width: 12px;
        height: 12px;
    }

    /* Adjust diagonal dot positions for smaller orbit */
    .teaym-dot-2,
    .teaym-dot-4,
    .teaym-dot-6,
    .teaym-dot-8 {
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
    }

    .teaym-dot-2 {
        top: 13px;
        right: 13px;
    }

    .teaym-dot-4 {
        bottom: 13px;
        right: 13px;
    }

    .teaym-dot-6 {
        bottom: 13px;
        left: 13px;
    }

    .teaym-dot-8 {
        top: 13px;
        left: 13px;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .teaym-page-loader,
    .teaym-loader-logo,
    .teaym-loader-orbit,
    .teaym-loader-dot {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
