/* ==========================================================================
   Widget Guía del Sistema - Estilos
   ========================================================================== */

.guia-widget-root {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 50000;
    font-family: inherit;
}

/* --- Burbuja flotante --- */
.guia-bubble {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 50002;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0369a1 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 14px rgba(3, 105, 161, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
    animation: guia-pulse 3s ease-in-out infinite;
}

.guia-bubble:hover {
    transform: scale(1.08);
    box-shadow:
        0 6px 20px rgba(3, 105, 161, 0.5),
        0 3px 10px rgba(0, 0, 0, 0.2);
}

.guia-bubble--open {
    animation: none;
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

@keyframes guia-pulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(3, 105, 161, 0.4), 0 0 0 0 rgba(3, 105, 161, 0.3); }
    50% { box-shadow: 0 4px 14px rgba(3, 105, 161, 0.4), 0 0 0 10px rgba(3, 105, 161, 0); }
}

/* --- Panel principal --- */
.guia-panel {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    z-index: 50001;
    width: 340px;
    max-height: min(480px, calc(100vh - 7rem));
    background: #fff;
    border-radius: 14px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- Header --- */
.guia-panel__header {
    background: linear-gradient(135deg, #0369a1 0%, #0c4a6e 100%);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.guia-back-btn {
    color: rgba(255, 255, 255, 0.8);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
}

.guia-back-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.guia-close-btn {
    color: rgba(255, 255, 255, 0.7);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
}

.guia-close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* --- Body --- */
.guia-panel__body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.guia-panel__body::-webkit-scrollbar {
    width: 4px;
}

.guia-panel__body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

/* --- Manual download link --- */
.guia-manual-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.guia-manual-link:hover {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.guia-manual-link--teacher {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.guia-manual-link--teacher:hover {
    background: #ffedd5;
    border-color: #fdba74;
}

.guia-manual-link--student {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.guia-manual-link--student:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.guia-manual-link .fa-file-pdf {
    font-size: 1rem;
    flex-shrink: 0;
}

.guia-manual-link span {
    flex: 1;
}

.guia-manual-dl {
    font-size: 0.75rem;
    opacity: 0.5;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.guia-manual-link:hover .guia-manual-dl {
    opacity: 1;
}

/* --- Items de categoría --- */
.guia-cat-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.guia-cat-item:hover {
    background: #f1f5f9;
}

.guia-cat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e0f2fe 0%, #ede9fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0369a1;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* --- Items de tour --- */
.guia-tour-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    background: none;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
}

.guia-tour-item:hover {
    background: #f0fdf4;
}

.guia-tour-item:last-child {
    border-bottom: none;
}

/* --- Footer --- */
.guia-panel__footer {
    padding: 0.375rem 0.75rem;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
    background: #fafafa;
}

/* ==========================================================================
   Driver.js Theme Override - Colores CEEB
   ========================================================================== */

.driver-popover {
    border-radius: 12px !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18) !important;
    max-width: 340px !important;
}

.driver-popover-title {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #0c4a6e !important;
}

.driver-popover-description {
    font-size: 0.875rem !important;
    color: #475569 !important;
    line-height: 1.5 !important;
}

.driver-popover-progress-text {
    font-size: 0.75rem !important;
    color: #94a3b8 !important;
}

.driver-popover-navigation-btns {
    gap: 0.5rem !important;
}

.driver-popover-next-btn {
    background: #0369a1 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 0.4rem 1rem !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    text-shadow: none !important;
}

.driver-popover-next-btn:hover {
    background: #075985 !important;
}

.driver-popover-prev-btn {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0.4rem 1rem !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    text-shadow: none !important;
}

.driver-popover-prev-btn:hover {
    background: #e2e8f0 !important;
}

.driver-popover-close-btn {
    color: #94a3b8 !important;
}

.driver-popover-close-btn:hover {
    color: #475569 !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
    .guia-panel {
        right: 0.5rem;
        left: 0.5rem;
        bottom: 5rem;
        width: auto;
        max-height: calc(100vh - 7rem);
    }

    .guia-bubble {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }
}
