﻿/* ============================================
   CHATBOT BUBBLE - Asistente flotante
   ============================================ */

.chatbot-bubble {
    position: fixed;
    width: 80px;
    height: 80px;
    z-index: 9998;
    cursor: move;
    transition: transform 0.2s ease;
    user-select: none;
}

    .chatbot-bubble.dragging {
        transition: none;
        cursor: grabbing;
    }

    .chatbot-bubble:hover {
        transform: scale(1.05);
    }

.bubble-character {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4), 0 4px 12px rgba(118, 75, 162, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .bubble-character:hover {
        box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5), 0 6px 16px rgba(118, 75, 162, 0.4);
    }

.character-face {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.eyes {
    display: flex;
    gap: 12px;
}

.eye {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    position: relative;
    animation: blink 4s infinite;
}

    .eye::after {
        content: '';
        position: absolute;
        width: 6px;
        height: 6px;
        background: #333;
        border-radius: 50%;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        animation: lookAround 3s infinite;
    }

@keyframes blink {
    0%, 49%, 51%, 100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(0.1);
    }
}

@keyframes lookAround {
    0%, 100% {
        transform: translate(-50%, -50%);
    }

    25% {
        transform: translate(-30%, -50%);
    }

    50% {
        transform: translate(-50%, -30%);
    }

    75% {
        transform: translate(-70%, -50%);
    }
}

.mouth {
    width: 20px;
    height: 10px;
    border: 2px solid white;
    border-top: none;
    border-radius: 0 0 20px 20px;
    animation: smile 2s infinite;
}

@keyframes smile {
    0%, 100% {
        transform: scaleX(1);
    }

    50% {
        transform: scaleX(1.2);
    }
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.5);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.bubble-message {
    position: absolute;
    left: 100px;  /* 🔥 Cambiado de -180px a 100px para que aparezca a la DERECHA */
    top: 50%;
    transform: translateY(-50%);
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    max-width: 200px;
    cursor: pointer;
    animation: fadeInRight 0.3s ease;  /* 🔥 Cambiada la animación */
    transition: all 0.2s ease;
}

    .bubble-message:hover {
        transform: translateY(-50%) scale(1.05);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    }

@keyframes fadeInRight {  /* 🔥 Nueva animación desde la derecha */
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.message-arrow {
    position: absolute;
    left: -8px;  /* 🔥 Cambiado de right a left */
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid white;  /* 🔥 Cambiado de border-left a border-right */
}

.message-text {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

/* ============================================
   HELP PANEL - Panel lateral
   ============================================ */

.help-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.help-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

    .help-panel.open {
        right: 0;
    }

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
}

    .panel-title i {
        font-size: 24px;
    }

.panel-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

    .panel-close:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
    }

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ============================================
   HELP CATEGORIES
   ============================================ */

.help-categories {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .category-card:hover {
        border-color: #667eea;
        background: #f8f9ff;
        transform: translateX(4px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    }

.category-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    flex-shrink: 0;
}

.category-info {
    flex: 1;
}

    .category-info h4 {
        margin: 0 0 4px 0;
        font-size: 16px;
        font-weight: 600;
        color: #212529;
    }

    .category-info p {
        margin: 0;
        font-size: 13px;
        color: #6c757d;
    }

.category-card > i {
    color: #adb5bd;
    font-size: 18px;
}

/* ============================================
   HELP DETAIL
   ============================================ */

.help-detail {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.back-button {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    margin-bottom: 24px;
    transition: all 0.2s;
}

    .back-button:hover {
        background: #e9ecef;
        transform: translateX(-4px);
    }

.detail-content h3 {
    font-size: 22px;
    color: #212529;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

    .detail-content h3 i {
        color: #667eea;
    }

.help-section {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

    .help-section h4 {
        font-size: 16px;
        color: #212529;
        margin-bottom: 12px;
        font-weight: 600;
    }

    .help-section ol,
    .help-section ul {
        margin: 12px 0;
        padding-left: 20px;
    }

    .help-section li {
        margin-bottom: 8px;
        line-height: 1.6;
        color: #495057;
    }

    .help-section strong {
        color: #212529;
        font-weight: 600;
    }

.help-tip {
    background: #d1f2eb;
    border-left: 4px solid #20c997;
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 16px;
    font-size: 14px;
    color: #0a5a47;
}

.help-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 16px;
    font-size: 14px;
    color: #664d03;
}

.help-subsection {
    background: white;
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
    border: 1px solid #dee2e6;
}

    .help-subsection h5 {
        font-size: 15px;
        color: #495057;
        margin-bottom: 12px;
        font-weight: 600;
    }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .help-panel {
        width: 100%;
        right: -100%;
    }

    .bubble-message {
        left: auto;
        right: 100px;
        top: -60px;
        transform: none;
    }

        .bubble-message:hover {
            transform: scale(1.05);
        }

    .message-arrow {
        right: auto;
        left: 50%;
        top: auto;
        bottom: -8px;
        transform: translateX(-50%) rotate(-90deg);
    }

    .chatbot-bubble {
        width: 70px;
        height: 70px;
    }

    .bubble-character {
        width: 70px;
        height: 70px;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */

.panel-content::-webkit-scrollbar {
    width: 8px;
}

.panel-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.panel-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

    .panel-content::-webkit-scrollbar-thumb:hover {
        background: #a0aec0;
    }

/* ============================================
   BÚSQUEDA
   ============================================ */

.search-container {
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    background: white;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #6c757d;
    font-size: 16px;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 40px;
    border: 2px solid #e9ecef;
    border-radius: 24px;
    font-size: 14px;
    transition: all 0.3s;
}

    .search-input:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

.clear-search {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    background: #e9ecef;
    color: #6c757d;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .clear-search:hover {
        background: #dc3545;
        color: white;
    }

/* ============================================
   RESULTADOS DE BÚSQUEDA
   ============================================ */

.search-results {
    animation: fadeIn 0.3s ease;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
}

    .results-header h4 {
        margin: 0;
        font-size: 18px;
        color: #212529;
    }

.results-count {
    font-size: 14px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 4px 12px;
    border-radius: 12px;
}

.search-result-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

    .search-result-item:hover {
        border-color: #667eea;
        background: #f8f9ff;
        transform: translateX(4px);
    }

.result-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.result-content {
    flex: 1;
    min-width: 0;
}

    .result-content h5 {
        margin: 0 0 8px 0;
        font-size: 16px;
        font-weight: 600;
        color: #212529;
    }

    .result-content p {
        margin: 0 0 8px 0;
        font-size: 14px;
        color: #495057;
        line-height: 1.5;
    }

    .result-content mark {
        background: #fff3cd;
        color: #856404;
        padding: 2px 4px;
        border-radius: 3px;
        font-weight: 600;
    }

.result-category {
    display: inline-block;
    font-size: 12px;
    color: #667eea;
    background: #f8f9ff;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 500;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
}

    .no-results i {
        font-size: 64px;
        color: #dee2e6;
        margin-bottom: 20px;
    }

    .no-results h4 {
        color: #495057;
        margin-bottom: 8px;
    }

    .no-results p {
        color: #6c757d;
        font-size: 14px;
    }

/* 🔥 ESTILO PARA CATEGORÍAS AGRUP ADORAS */
.category-card.category-group {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

    .category-card.category-group .category-icon {
        background-color: rgba(255, 255, 255, 0.2);
        color: white;
    }

    .category-card.category-group .category-info h4 {
        color: white;
    }

    .category-card.category-group .category-info p {
        color: rgba(255, 255, 255, 0.9);
    }

    .category-card.category-group .fa-chevron-right {
        color: white;
    }

    .category-card.category-group:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    }