/* ═══════════════════════════════════════════════════════════════════
   app.css — Estilos base + splash + botón PWA
   Codeado por 🦾 Hefesto 15.1 Pro Max | Sr. Ignacio
   ═══════════════════════════════════════════════════════════════════ */

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: #F8FAFC;
    color: #1A2236;
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════════
   LOADING INICIAL DE BLAZOR
   ═══════════════════════════════════════════════════════════════════ */

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #E2E8F0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1565C0;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 700;
    inset: calc(20vh + 3.25rem) 0 auto 0;
    color: #1565C0;
    font-family: 'Poppins', 'Inter', sans-serif;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Cargando...");
    }

/* ═══════════════════════════════════════════════════════════════════
   ERROR UI DE BLAZOR
   ═══════════════════════════════════════════════════════════════════ */

#blazor-error-ui {
    background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
    color: #B91C1C;
    bottom: 0;
    box-shadow: 0 -4px 20px rgba(220, 38, 38, 0.25);
    display: none;
    left: 0;
    padding: 20px 24px;
    position: fixed;
    width: 100%;
    z-index: 999999;
    font-family: 'Inter', sans-serif;
}

    #blazor-error-ui .error-container {
        max-width: 860px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        gap: 16px;
        flex-wrap: wrap;
    }

        #blazor-error-ui .error-container i {
            font-size: 1.6rem;
            color: #DC2626;
        }

        #blazor-error-ui .error-container h4 {
            margin: 0;
            font-size: 1.1rem;
            font-weight: 800;
        }

        #blazor-error-ui .error-container p {
            margin: 0;
            flex: 1;
            min-width: 200px;
            color: #991B1B;
        }

    #blazor-error-ui .btn-error-reload {
        padding: 10px 20px;
        background: linear-gradient(135deg, #DC2626, #EF4444);
        color: #FFFFFF;
        border: none;
        border-radius: 10px;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.25s ease;
        font-family: inherit;
    }

        #blazor-error-ui .btn-error-reload:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(220, 38, 38, 0.4);
        }

/* ═══════════════════════════════════════════════════════════════════
   ⭐ SPLASH SCREEN INICIAL
   ═══════════════════════════════════════════════════════════════════ */

.app-splash {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: linear-gradient(135deg, #0A3880 0%, #1565C0 50%, #E53935 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.app-splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    padding: 24px;
    animation: app-splash-fade-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-splash-icon {
    font-size: 5rem;
    color: #FFFFFF;
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.35));
    animation: app-splash-truck 2.5s ease-in-out infinite;
}

.app-splash-title {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: #FFFFFF;
    letter-spacing: -1.5px;
    margin: 0;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.app-splash-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.5px;
    margin: 0;
}

.app-splash-spinner {
    width: 52px;
    height: 52px;
    border: 5px solid rgba(255, 255, 255, 0.25);
    border-top: 5px solid #FFFFFF;
    border-radius: 50%;
    animation: app-splash-spin 0.9s linear infinite;
    margin-top: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

@keyframes app-splash-fade-in {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes app-splash-truck {
    0%, 100% {
        transform: translateX(-8px) rotate(-2deg);
    }

    50% {
        transform: translateX(8px) rotate(2deg);
    }
}

@keyframes app-splash-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════════════════════════
   ⭐ BOTÓN FLOTANTE INSTALAR PWA
   ═══════════════════════════════════════════════════════════════════ */

.pwa-install-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99998;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: linear-gradient(135deg, #1565C0, #E53935);
    background-size: 200% 200%;
    color: #FFFFFF;
    border: none;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(21, 101, 192, 0.5), 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: pwa-btn-gradient 4s ease infinite;
}

    .pwa-install-btn.visible {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    .pwa-install-btn:hover {
        transform: translateY(-4px) scale(1.05);
        box-shadow: 0 18px 40px rgba(21, 101, 192, 0.6), 0 6px 16px rgba(0, 0, 0, 0.2);
    }

    .pwa-install-btn:active {
        transform: translateY(-2px) scale(1.02);
    }

.pwa-install-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.pwa-install-text {
    white-space: nowrap;
}

@keyframes pwa-btn-gradient {
    0%, 100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@media (max-width: 480px) {
    .pwa-install-btn {
        bottom: 16px;
        left: 16px;
        padding: 12px 18px;
        font-size: 0.85rem;
    }

    .pwa-install-text {
        display: none;
    }

    .pwa-install-icon {
        font-size: 1.4rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-splash-icon,
    .app-splash-spinner,
    .app-splash-content,
    .pwa-install-btn {
        animation: none !important;
    }
}

/* Fin de app.css */
