/* assets/css/preloader.css — Premium MediTouch Preloader */

/* ── Preloader Overlay ─────────────────────────────────────────────────── */
#mt-preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: radial-gradient(ellipse at 30% 20%, rgba(14, 165, 233, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
                linear-gradient(135deg, #0b0f19 0%, #0f172a 40%, #1e293b 100%);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

#mt-preloader::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.12) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: preloaderPulse 3s ease-in-out infinite;
}

#mt-preloader::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: preloaderPulse 3s ease-in-out 1.5s infinite;
}

/* ── Hide State ────────────────────────────────────────────────────────── */
#mt-preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ── Center Content ────────────────────────────────────────────────────── */
.preloader-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

/* ── Animated Logo Mark ────────────────────────────────────────────────── */
.preloader-logo {
    position: relative;
    width: 80px;
    height: 80px;
}

.preloader-logo-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #0ea5e9;
    border-right-color: rgba(14, 165, 233, 0.3);
    animation: preloaderSpin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.preloader-logo-ring:nth-child(2) {
    inset: 8px;
    border-top-color: #8b5cf6;
    border-right-color: rgba(139, 92, 246, 0.3);
    animation-direction: reverse;
    animation-duration: 1.8s;
}

.preloader-logo-ring:nth-child(3) {
    inset: 16px;
    border-top-color: #10b981;
    border-right-color: rgba(16, 185, 129, 0.3);
    animation-duration: 2.4s;
}

.preloader-logo-core {
    position: absolute;
    inset: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.4),
                0 0 60px rgba(14, 165, 233, 0.1);
    animation: preloaderCorePulse 2s ease-in-out infinite;
}

.preloader-logo-core svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* ── Brand Text ────────────────────────────────────────────────────────── */
.preloader-brand {
    text-align: center;
}

.preloader-brand h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
    margin: 0;
    line-height: 1;
}

.preloader-brand h1 span {
    background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.preloader-brand p {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(148, 163, 184, 0.8);
    margin: 6px 0 0;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* ── Progress Bar ──────────────────────────────────────────────────────── */
.preloader-progress {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.preloader-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0ea5e9, #8b5cf6, #10b981);
    border-radius: 3px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

.preloader-progress-bar.indeterminate {
    width: 40% !important;
    animation: preloaderIndeterminate 1.5s ease-in-out infinite;
}

/* ── Loading Dots ──────────────────────────────────────────────────────── */
.preloader-dots {
    display: flex;
    gap: 6px;
}

.preloader-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(14, 165, 233, 0.3);
    animation: preloaderDot 1.4s ease-in-out infinite;
}

.preloader-dot:nth-child(2) {
    animation-delay: 0.2s;
    background: rgba(139, 92, 246, 0.3);
}

.preloader-dot:nth-child(3) {
    animation-delay: 0.4s;
    background: rgba(16, 185, 129, 0.3);
}

/* ── Particle Effect ───────────────────────────────────────────────────── */
.preloader-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.preloader-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(14, 165, 233, 0.4);
    animation: preloaderFloat linear infinite;
}

/* ── Keyframes ─────────────────────────────────────────────────────────── */
@keyframes preloaderSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes preloaderPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

@keyframes preloaderCorePulse {
    0%, 100% { box-shadow: 0 0 30px rgba(14, 165, 233, 0.4), 0 0 60px rgba(14, 165, 233, 0.1); }
    50% { box-shadow: 0 0 40px rgba(14, 165, 233, 0.6), 0 0 80px rgba(14, 165, 233, 0.2); }
}

@keyframes preloaderIndeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

@keyframes preloaderDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes preloaderFloat {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .preloader-brand h1 { font-size: 1.4rem; }
    .preloader-brand p { font-size: 0.7rem; letter-spacing: 2px; }
    .preloader-logo { width: 64px; height: 64px; }
    .preloader-progress { width: 160px; }
}
