/* ========== RUMBERO CHAT - ESTILOS EXTREMOS ========== */

/* ========== BURBUJA DE CHAT ========== */
.rumbero-chat-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    cursor: pointer;
    animation: bounceIn 0.5s ease;
}

.bubble-content {
    background: linear-gradient(135deg, #A601B3, #3004E1);
    border-radius: 60px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(166, 1, 179, 0.4);
    position: relative;
    transition: all 0.3s ease;
}

.rumbero-chat-bubble:hover .bubble-content {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(166, 1, 179, 0.6);
}

.bubble-icon {
    width: 40px;
    height: 40px;
    background: #FFB800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #1e293b;
    animation: flame 2s infinite;
}

.bubble-text {
    display: flex;
    flex-direction: column;
}

.bubble-title {
    font-weight: 700;
    font-size: 1rem;
    color: white;
    letter-spacing: 1px;
}

.bubble-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.bubble-pulse {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 60px;
    animation: pulse 2s infinite;
}

.bubble-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    border: 2px solid white;
    animation: pulse 1.5s infinite;
}

/* ========== MODAL DEL CHAT ========== */
.rumbero-chat-modal {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(166, 1, 179, 0.3);
}

.rumbero-chat-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ========== HEADER DEL MODAL ========== */
.modal-header {
    background: linear-gradient(135deg, #A601B3, #3004E1);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #FFB800;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-avatar {
    width: 45px;
    height: 45px;
    background: #FFB800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #1e293b;
    animation: flame 2s infinite;
}

.header-info {
    display: flex;
    flex-direction: column;
}

.header-title {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
}

/* ========== SELECTOR DE IA ========== */
.ia-selector {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50px;
    padding: 3px;
    gap: 3px;
}

.ia-option {
    position: relative;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.ia-option i {
    font-size: 0.9rem;
}

.ia-option.active {
    background: #FFB800;
    color: #1e293b;
    font-weight: 600;
}

.ia-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}

.ia-option:hover .ia-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: -35px;
}

.close-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ========== CUERPO DEL MODAL ========== */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    scrollbar-width: thin;
    scrollbar-color: #A601B3 #e2e8f0;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #e2e8f0;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #A601B3, #3004E1);
    border-radius: 3px;
}

/* ========== MENSAJES ========== */
.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: fadeInUp 0.3s ease;
}

.message.user-message-wrapper {
    justify-content: flex-end;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.message-avatar.gemini {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.message-avatar.deepseek {
    background: linear-gradient(135deg, #A601B3, #3004E1);
    color: white;
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.message-sender {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
}

.message-ia-badge {
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.message-ia-badge.gemini {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.message-ia-badge.deepseek {
    background: rgba(166, 1, 179, 0.2);
    color: #A601B3;
    border: 1px solid rgba(166, 1, 179, 0.3);
}

.message-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    max-width: 85%;
}

.message-bubble.welcome {
    background: linear-gradient(135deg, #faf5ff, #ffffff);
    border: 2px solid #A601B3;
}

.message-bubble p {
    margin: 0;
    color: #1e293b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.welcome-text {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.welcome-emoji {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

.welcome-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.feature {
    background: rgba(166, 1, 179, 0.1);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #A601B3;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.user-message-container {
    max-width: 85%;
    text-align: right;
}

.user-message {
    background: linear-gradient(135deg, #A601B3, #3004E1);
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    color: white;
    display: inline-block;
}

.user-message p {
    margin: 0;
    color: white;
}

.message-time {
    font-size: 0.65rem;
    color: #94a3b8;
    margin-top: 4px;
    display: block;
}

/* ========== MENSAJES DEL SISTEMA ========== */
.system-message {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.system-content {
    background: #f1f5f9;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.system-content i {
    color: #A601B3;
    animation: spin 3s linear infinite;
}

/* ========== TYPING INDICATOR ========== */
.typing-container {
    animation: fadeIn 0.3s ease;
}

.typing-indicator {
    background: white;
    padding: 15px 20px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #A601B3;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

.typing-text {
    font-size: 0.75rem;
    color: #64748b;
    margin-left: 10px;
}

/* ========== FOOTER DEL MODAL ========== */
.modal-footer {
    padding: 20px;
    background: white;
    border-top: 2px solid #f1f5f9;
}

.quick-options {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.quick-option {
    background: #f1f5f9;
    border: none;
    padding: 8px 15px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.quick-option:hover {
    background: linear-gradient(135deg, #A601B3, #3004E1);
    color: white;
    transform: translateY(-2px);
    border-color: #FFB800;
}

.quick-option i {
    font-size: 0.9rem;
    color: #FFB800;
}

.quick-option:hover i {
    color: white;
}

.input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.chat-input:focus {
    outline: none;
    border-color: #A601B3;
    box-shadow: 0 0 0 3px rgba(166, 1, 179, 0.1);
}

.send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #A601B3, #3004E1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(166, 1, 179, 0.2);
}

.send-btn:hover {
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 8px 20px rgba(166, 1, 179, 0.3);
}

.footer-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: #94a3b8;
}

.footer-note i {
    color: #10b981;
}

/* ========== OVERLAY PARA MÓVILES ========== */
.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.chat-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ========== ANIMACIONES ========== */
@keyframes bounceIn {
    from {
        opacity: 0;
        transform: scale(0.3) translateY(100px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes flame {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
        box-shadow: 0 0 20px #FFB800;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .rumbero-chat-bubble {
        bottom: 20px;
        right: 20px;
    }

    .bubble-content {
        padding: 8px 16px;
    }

    .bubble-icon {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .bubble-title {
        font-size: 0.9rem;
    }

    .bubble-subtitle {
        font-size: 0.7rem;
    }

    .rumbero-chat-modal {
        width: 90%;
        height: 80vh;
        bottom: 80px;
        right: 5%;
        left: 5%;
    }

    .quick-options {
        justify-content: center;
    }

    .quick-option {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .ia-tooltip {
        display: none;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 15px;
    }

    .header-avatar {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .ia-option {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .ia-option i {
        font-size: 0.8rem;
    }

    .ia-label {
        display: none;
    }

    .quick-option {
        padding: 5px 10px;
        font-size: 0.7rem;
    }

    .quick-option i {
        font-size: 0.8rem;
    }

    .message-bubble {
        max-width: 90%;
    }

    .user-message-container {
        max-width: 90%;
    }
}

/* ========== MODO OSCURO ========== */
@media (prefers-color-scheme: dark) {
    .rumbero-chat-modal {
        background: #1e293b;
    }

    .modal-body {
        background: #0f172a;
    }

    .message-bubble {
        background: #334155;
    }

    .message-bubble p {
        color: #f1f5f9;
    }

    .message-sender {
        color: #f1f5f9;
    }

    .quick-option {
        background: #334155;
        color: #e2e8f0;
    }

    .chat-input {
        background: #334155;
        border-color: #475569;
        color: #f1f5f9;
    }

    .modal-footer {
        background: #1e293b;
        border-color: #334155;
    }

    .footer-note {
        color: #64748b;
    }
}