/**
 * Estilos del Botón Flotante de Asistencia (Tutorial y Descarga de Manual)
 * @package Relatoria_Minimal
 */

/* ==========================================================================
   1. CONTENEDOR FLOTANTE Y BOTÓN TRIGGER (FAB)
   ========================================================================== */
.rel-fab-container {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 999999 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.rel-fab-trigger {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0F3A85 0%, #1E40AF 100%);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 24px rgba(15, 58, 133, 0.35), 0 2px 6px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
}

.rel-fab-trigger:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 30px rgba(15, 58, 133, 0.45);
    border-color: #ffffff;
}

.rel-fab-trigger:active {
    transform: scale(0.96);
}

.rel-fab-icon-wrap {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.rel-fab-icon-wrap .rel-icon-default,
.rel-fab-icon-wrap .rel-icon-close {
    position: absolute;
    transition: all 0.3s ease;
}

.rel-fab-icon-wrap .rel-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.rel-fab-trigger.is-active .rel-icon-default {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.rel-fab-trigger.is-active .rel-icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Tooltip / Label lateral */
.rel-fab-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: #0f172a;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: all 0.25s ease;
    letter-spacing: 0.2px;
}

.rel-fab-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    border-width: 5px 0 5px 5px;
    border-style: solid;
    border-color: transparent transparent transparent #0f172a;
}

.rel-fab-trigger:hover .rel-fab-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.rel-fab-trigger.is-active .rel-fab-tooltip {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Pulso animado sutil */
.rel-fab-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #3b82f6;
    opacity: 0;
    animation: relFabPulseAnim 3s infinite;
    pointer-events: none;
}

@keyframes relFabPulseAnim {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.25);
        opacity: 0;
    }
    100% {
        transform: scale(0.95);
        opacity: 0;
    }
}

.rel-fab-trigger.is-active .rel-fab-pulse {
    display: none;
}

/* ==========================================================================
   2. TARJETA DESPLEGABLE (POPOVER MODAL)
   ========================================================================== */
.rel-fab-popover {
    position: absolute;
    bottom: 74px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 36px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2), 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.rel-fab-popover.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header del Popover */
.rel-fab-popover-header {
    background: linear-gradient(135deg, #0F3A85 0%, #1E40AF 100%);
    padding: 20px 20px 18px 20px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}

.rel-fab-gov-pill {
    display: inline-block;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.rel-fab-title {
    margin: 0 0 2px 0;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rel-fab-subtitle {
    margin: 0;
    font-size: 11px;
    color: #93c5fd;
    font-weight: 500;
}

.rel-fab-popover-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.rel-fab-popover-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Cuerpo con las Opciones */
.rel-fab-popover-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #f8fafc;
}

/* Tarjeta individual de acción */
.rel-fab-action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.rel-fab-action-card:hover {
    border-color: #0F3A85;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 58, 133, 0.1);
    background: #ffffff;
}

.rel-fab-action-card.is-disabled {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(0.6);
}

/* Iconos circulares de acción */
.rel-fab-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.rel-fab-action-card:hover .rel-fab-action-icon {
    transform: scale(1.08);
}

.rel-fab-icon-video {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
}

.rel-fab-icon-pdf {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}

.rel-fab-action-info {
    flex: 1;
    min-width: 0;
}

.rel-fab-action-tag {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #1d4ed8;
    background: #eff6ff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.rel-tag-pdf {
    color: #dc2626;
    background: #fef2f2;
}

.rel-fab-action-title {
    margin: 0 0 2px 0;
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.rel-fab-action-desc {
    margin: 0;
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.4;
}

.rel-fab-action-arrow {
    color: #94a3b8;
    font-size: 14px;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.rel-fab-action-card:hover .rel-fab-action-arrow {
    transform: translateX(3px);
    color: #0F3A85;
}

/* Footer del Popover */
.rel-fab-popover-footer {
    padding: 10px 16px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    text-align: center;
    font-size: 11px;
    color: #64748b;
}

.rel-fab-popover-footer a {
    color: #0F3A85;
    font-weight: 600;
    text-decoration: underline;
}

/* ==========================================================================
   3. MODAL LIGHTBOX PARA REPRODUCIR VIDEO TUTORIAL
   ========================================================================== */
.rel-video-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.rel-video-modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.rel-video-modal-dialog {
    background: #0f172a;
    border-radius: 16px;
    width: 820px;
    max-width: 100%;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rel-video-modal-overlay.is-active .rel-video-modal-dialog {
    transform: scale(1);
}

.rel-video-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #1e293b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rel-video-modal-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rel-video-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s ease;
}

.rel-video-modal-close:hover {
    background: #ef4444;
}

.rel-video-modal-body {
    padding: 0;
    background: #000000;
}

.rel-video-iframe-responsive {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.rel-video-iframe-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==========================================================================
   4. RESPONSIVE / ADAPTACIÓN MÓVIL
   ========================================================================== */
@media (max-width: 640px) {
    .rel-fab-container {
        bottom: 18px;
        right: 18px;
    }

    .rel-fab-trigger {
        width: 52px;
        height: 52px;
    }

    .rel-fab-tooltip {
        display: none !important;
    }

    .rel-fab-popover {
        bottom: 68px;
        right: 0;
        width: calc(100vw - 36px);
        max-width: 340px;
    }
}
