/* ===================================================================
   PRELOADER MEJORADO - OpenRest
   Diseño profesional con logo, slogan y animación moderna
   =================================================================== */

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background: linear-gradient(135deg, #fff8f3 0%, #ffe8da 50%, #fff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Fondo decorativo con patrón sutil */
.preloader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 140, 66, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 107, 53, 0.03) 0%, transparent 50%);
    animation: backgroundPulse 15s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Contenedor principal del preloader */
.preloader-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    animation: fadeInUp 0.8s ease-out;
}

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

/* Contenedor del logo y texto */
.preloader-logo-container {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow:
        0 10px 40px rgba(255, 107, 53, 0.15),
        0 5px 15px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    animation: floatAnimation 3s ease-in-out infinite;
}

@keyframes floatAnimation {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Wrapper del icono con efecto de pulso */
.preloader-icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    border-radius: 20px;
    box-shadow:
        0 8px 20px rgba(255, 107, 53, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 8px 20px rgba(255, 107, 53, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow:
            0 12px 30px rgba(255, 107, 53, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

/* Icono del chef hat (SVG) */
.preloader-icon {
    width: 48px;
    height: 48px;
    color: #ffffff;
    stroke: currentColor;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Texto del preloader */
.preloader-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.preloader-title {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Mismo estilo que el navbar */
.preloader-title .text-open {
    color: #2c3e50 !important;
}

.preloader-title .text-rest {
    color: #ff6b35 !important;
}

.preloader-slogan {
    margin: 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-top: 8px !important;
}

/* Spinner con anillos animados */
.preloader-spinner {
    position: relative;
    width: 60px;
    height: 60px;
}

.spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: #FF6B35;
    border-right-color: #FF8C42;
    border-radius: 50%;
    animation: spinRotate 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: #FF8C42;
    border-right-color: #FFAB6B;
    animation-delay: -0.5s;
}

.spinner-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: #FFAB6B;
    border-right-color: #FFCBA4;
    animation-delay: -1s;
}

@keyframes spinRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Puntos de carga adicionales (opcional) */
.preloader-spinner::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
    animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.6;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .preloader-logo-container {
        flex-direction: column;
        text-align: center;
        padding: 25px 30px;
        gap: 15px;
    }

    .preloader-icon-wrapper {
        width: 70px;
        height: 70px;
    }

    .preloader-icon {
        width: 42px;
        height: 42px;
    }

    .preloader-title {
        font-size: 28px;
    }

    .preloader-slogan {
        font-size: 13px;
    }

    .preloader-content {
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .preloader-logo-container {
        padding: 20px 25px;
    }

    .preloader-icon-wrapper {
        width: 60px;
        height: 60px;
    }

    .preloader-icon {
        width: 36px;
        height: 36px;
    }

    .preloader-title {
        font-size: 24px;
    }

    .preloader-slogan {
        font-size: 12px;
    }
}

/* Animación de salida cuando el preloader se oculta */
.preloader.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}
