/* ===============================
   OWO CYBER CAFE - PREMIUM LOADERS
   =============================== */

/* Base Loader Container */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loader-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loader-overlay.fade-out {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

/* Loader Wrapper */
.loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.loader-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 1rem;
}

/* ===============================
   CUSTOMER SIDE - Infinite Pulse
   Focus: Smoothness, welcoming
   =============================== */
.customer-loader {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Calendar icon base */
.calendar-icon {
    width: 48px;
    height: 48px;
    position: relative;
    z-index: 2;
}

.calendar-icon svg {
    width: 100%;
    height: 100%;
    stroke: #6366f1;
    stroke-width: 1.5;
    fill: none;
}

/* Glowing ring */
.pulse-ring {
    position: absolute;
    width: 64px;
    height: 64px;
    border: 2px solid rgba(99, 102, 241, 0.4);
    border-radius: 50%;
    animation: infinite-pulse 2s ease-in-out infinite;
}

@keyframes infinite-pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.6;
        border-color: rgba(99, 102, 241, 0.4);
    }
    50% {
        transform: scale(1.2);
        opacity: 0;
        border-color: rgba(99, 102, 241, 0);
    }
}

/* Secondary pulse for depth */
.pulse-ring::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    animation: infinite-pulse 2s ease-in-out 0.5s infinite;
}

/* ===============================
   EMPLOYEE SIDE - Linear Progress Streak
   Focus: Action, efficiency, speed
   =============================== */
.employee-loader {
    width: 200px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-streak {
    position: absolute;
    top: 0;
    left: -60px;
    width: 60px;
    height: 100%;
    background: rgba(99, 102, 241, 0.35);
    border-radius: 2px;
    animation: linear-streak 1.5s ease-in-out infinite;
}

@keyframes linear-streak {
    0% {
        left: -60px;
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        left: 200px;
        opacity: 0;
    }
}

/* Employee loader with badge */
.employee-loader-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.employee-loader-badge .loader-label {
    margin-top: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ===============================
   ADMIN SIDE - Orbiting Dot
   Focus: Precision, control, mathematical accuracy
   =============================== */
.admin-loader {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Central hub */
.hub-center {
    width: 8px;
    height: 8px;
    background: #6366f1;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}

/* Orbiting ring */
.orbit-ring {
    position: absolute;
    width: 56px;
    height: 56px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 50%;
}

/* Orbiting dot */
.orbit-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #6366f1;
    border-radius: 50%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: orbit-rotate 2s linear infinite;
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.8);
}

.orbit-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: rgba(99, 102, 241, 0.12);
    border-radius: 50%;
    animation: orbit-pulse 2s ease-in-out infinite;
}

@keyframes orbit-rotate {
    from {
        transform: translateX(-50%) rotate(0deg) translateX(28px) rotate(0deg);
    }
    to {
        transform: translateX(-50%) rotate(360deg) translateX(28px) rotate(-360deg);
    }
}

@keyframes orbit-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.2;
    }
}

/* Second orbiting dot (counter-rotate) */
.orbit-dot-secondary {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #8b5cf6;
    border-radius: 50%;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    animation: orbit-rotate-secondary 2.5s linear infinite;
    box-shadow: 0 0 4px rgba(139, 92, 246, 0.6);
}

@keyframes orbit-rotate-secondary {
    from {
        transform: translateY(-50%) rotate(0deg) translateX(28px) rotate(0deg);
    }
    to {
        transform: translateY(-50%) rotate(-360deg) translateX(28px) rotate(360deg);
    }
}

/* ===============================
   SPINNER (Fallback/Generic)
   =============================== */
.spinner-sm {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-md {
    width: 32px;
    height: 32px;
    border: 2.5px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===============================
   PAGE LOADER (Full screen)
   =============================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Text shimmer */
.loader-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6366f1;
    letter-spacing: 0.05em;
    animation: text-shimmer 1.5s ease-in-out infinite;
}

@keyframes text-shimmer {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* ===============================
   BUTTON LOADER
   =============================== */

/* Applied by OWO.setButtonLoading on every button that starts a process.
   Driven by currentColor rather than a fixed white so the spinner is legible
   on a primary button and on a light outline button alike - one rule, every
   variant, no per-button colour to keep in sync. */
.owo-btn-busy {
    position: relative;
    pointer-events: none;
    cursor: wait;
}

.owo-btn-busy .owo-btn-label {
    visibility: hidden;
}

.owo-btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1em;
    height: 1em;
    margin: -0.5em 0 0 -0.5em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    opacity: 0.75;
    animation: spin 0.7s linear infinite;
}

/* Keeps an icon-only button from collapsing when its label is hidden. */
.owo-btn-busy.owo-btn-icon-only {
    min-width: 2.5rem;
}

/* Buttons whose content is a single glyph or a short word sit tight; the
   generic rule above would add visual space around the spinner. */
.owo-btn-busy.btn-link,
.owo-btn-busy.btn-sm {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===============================
   SKELETON LOADING (Content)
   =============================== */
/* Solid bar; the shimmer is done with opacity so no gradient is needed. */
.skeleton {
    background: #e2e8f0;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1rem;
}

/* Replaces skeleton-shimmer: the placeholder pulses between two solid greys
   instead of sliding a gradient highlight across itself. */
@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.45;
    }
}
