/* =========================================================
   TOUR - Estilos personalizados (Shepherd.js + botón FAB)
   Solo visual. No altera IDs, selectores ni comportamiento
   usado por assets/js/tour.js.
   ========================================================= */

/* =========================================================
   1. Botón flotante para iniciar el tour (#start-tour)
   ========================================================= */
#start-tour.tour-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 1050;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border: none;
    border-radius: 999px;
    color: #ffffff;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.3px;
    line-height: 1;
    cursor: pointer;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 55%, #0ea5e9 130%);
    box-shadow:
        0 12px 28px rgba(34, 197, 94, 0.35),
        0 4px 10px rgba(15, 23, 42, 0.10);
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        filter 0.25s ease;
    animation: tourFabPulse 2.8s ease-in-out infinite;
}

#start-tour.tour-fab i {
    font-size: 20px;
    line-height: 1;
}

#start-tour.tour-fab .tour-fab-label {
    display: inline-block;
    white-space: nowrap;
}

#start-tour.tour-fab:hover {
    transform: translateY(-2px) scale(1.03);
    filter: brightness(1.05);
    box-shadow:
        0 18px 36px rgba(34, 197, 94, 0.45),
        0 6px 14px rgba(15, 23, 42, 0.12);
    animation-play-state: paused;
}

#start-tour.tour-fab:active {
    transform: translateY(0) scale(0.99);
}

#start-tour.tour-fab:focus-visible {
    outline: 3px solid rgba(34, 197, 94, 0.55);
    outline-offset: 3px;
}

@keyframes tourFabPulse {
    0%, 100% {
        box-shadow:
            0 12px 28px rgba(34, 197, 94, 0.35),
            0 4px 10px rgba(15, 23, 42, 0.10),
            0 0 0 0 rgba(34, 197, 94, 0.55);
    }
    50% {
        box-shadow:
            0 12px 28px rgba(34, 197, 94, 0.35),
            0 4px 10px rgba(15, 23, 42, 0.10),
            0 0 0 16px rgba(34, 197, 94, 0);
    }
}

/* Colapsar a solo icono en pantallas pequeñas */
@media (max-width: 576px) {
    #start-tour.tour-fab {
        padding: 14px;
        bottom: 18px;
        right: 18px;
    }
    #start-tour.tour-fab .tour-fab-label {
        display: none;
    }
}

/* =========================================================
   2. Overlay del tour (fondo oscuro con blur suave)
   ========================================================= */
.shepherd-modal-overlay-container {
    fill: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
}

/* =========================================================
   3. Tarjeta del paso (shepherd-element)
   ========================================================= */
.shepherd-element {
    max-width: 380px;
    border-radius: 16px !important;
    background: #ffffff;
    box-shadow:
        0 24px 50px rgba(15, 23, 42, 0.22),
        0 8px 20px rgba(15, 23, 42, 0.08) !important;
    overflow: hidden;
    animation: shepherdFadeUp 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.shepherd-element .shepherd-content {
    border-radius: 16px;
    padding: 0;
    background: #ffffff;
    overflow: hidden;
}

@keyframes shepherdFadeUp {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =========================================================
   4. Header con acento en gradiente
   ========================================================= */
.shepherd-header {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    padding: 18px 44px 16px 22px;
    position: relative;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.shepherd-title {
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.2px;
    margin: 0;
    line-height: 1.3;
}

/* Icono cancelar (X) */
.shepherd-cancel-icon {
    color: rgba(255, 255, 255, 0.95);
    font-size: 22px;
    font-weight: 400;
    opacity: 1;
    line-height: 1;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.shepherd-cancel-icon:hover {
    color: #ffffff;
    transform: rotate(90deg);
    opacity: 0.85;
}

/* =========================================================
   5. Cuerpo del texto
   ========================================================= */
.shepherd-text {
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
    padding: 20px 22px 4px;
}

.shepherd-text p {
    margin: 0 0 8px;
}

.shepherd-text p:last-child {
    margin-bottom: 0;
}

/* =========================================================
   6. Footer y botones
   ========================================================= */
.shepherd-footer {
    padding: 14px 22px 20px;
    gap: 8px;
    display: flex;
    justify-content: flex-end;
    background: #ffffff;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.shepherd-footer .shepherd-button {
    margin: 0;
    padding: 9px 18px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

/* Primary (Siguiente) */
.shepherd-footer .shepherd-button.btn-primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(34, 197, 94, 0.28);
}

.shepherd-footer .shepherd-button.btn-primary:not(:disabled):hover {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 10px 22px rgba(34, 197, 94, 0.38);
}

/* Success (Finalizar) */
.shepherd-footer .shepherd-button.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.30);
}

.shepherd-footer .shepherd-button.btn-success:not(:disabled):hover {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 10px 22px rgba(16, 185, 129, 0.40);
}

/* Secondary (Saltar / Atrás) */
.shepherd-footer .shepherd-button.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    box-shadow: none;
}

.shepherd-footer .shepherd-button.btn-secondary:not(:disabled):hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
}

/* =========================================================
   7. Flecha del popover
   ========================================================= */
.shepherd-arrow,
.shepherd-arrow:before {
    width: 16px;
    height: 16px;
}

.shepherd-arrow:before {
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04);
}

/* Cuando el popover está debajo del elemento, la flecha apunta
   hacia arriba y toca el header en gradiente. */
.shepherd-element[data-popper-placement^='bottom'] .shepherd-arrow:before {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

/* =========================================================
   8. Ajustes responsive
   ========================================================= */
@media (max-width: 480px) {
    .shepherd-element {
        max-width: 92vw;
    }
    .shepherd-header {
        padding: 16px 40px 14px 18px;
    }
    .shepherd-title {
        font-size: 16px;
    }
    .shepherd-text {
        padding: 16px 18px 4px;
        font-size: 13.5px;
    }
    .shepherd-footer {
        padding: 12px 18px 16px;
    }
}
