/* ===================================================
   CLOUD THINGS NET - COMPONENTES ESPECIALES
   Modales, Chatbots, Notificaciones, etc.
   Versión: 2.0
   Fecha: 22 de octubre de 2025
   ================================================== */

/* ===========================
   MODALES ELEGANTES
   ========================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(25px);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-width: 500px;
    width: 90vw;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    text-align: center;
}

.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.modal-icon i {
    font-size: 2rem;
    color: white;
}

.modal-body {
    color: #1e293b;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    outline: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
}

.btn-close {
    background: rgba(156, 163, 175, 0.2);
    color: #6b7280;
    padding: 0.5rem 1rem;
    font-size: 1.2rem;
    margin-top: 1rem;
}

.btn-close:hover {
    background: rgba(59, 130, 246, 0.3) !important;
    color: #1e3a8a !important;
    transform: scale(1.05);
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ===========================
   CHATBOT ELEGANTE
   ========================== */

.chatbot-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
}

.chatbot-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #8b5cf6 100%);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chatbot-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.3s ease;
}

.chatbot-button:hover::before {
    transform: scale(1);
    animation: pulse-glow 2s infinite;
}

.chatbot-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-glow 2s infinite;
}

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

.chatbot-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 15px 35px rgba(30, 58, 138, 0.5),
        0 0 25px rgba(59, 130, 246, 0.3);
}

.chatbot-window {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 400px;
    height: 600px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(25px);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
}

.chatbot-header {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}

.chatbot-header > * {
    position: relative;
    z-index: 2;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chatbot-avatar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chatbot-avatar i {
    font-size: 1.3rem;
    color: white;
    position: relative;
    z-index: 2;
}

.chatbot-avatar:hover {
    transform: scale(1.08);
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.3) 0%, 
        rgba(59, 130, 246, 0.3) 50%, 
        rgba(100, 116, 139, 0.6) 100%);
    box-shadow: 
        0 0 20px rgba(16, 185, 129, 0.4),
        0 0 40px rgba(59, 130, 246, 0.3);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(10px);
    scrollbar-width: thin;
    scrollbar-color: rgba(203, 213, 225, 0.5) transparent;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(203, 213, 225, 0.5);
    border-radius: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-form {
    display: flex;
    background: var(--white);
    border-top: 1px solid rgba(203, 213, 225, 0.5);
    padding: 0.75rem;
}

.chatbot-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 1px solid rgba(203, 213, 225, 0.7);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    background: var(--white);
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.chatbot-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.chatbot-send {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: var(--white);
    border: none;
    border-radius: 8px;
    margin-left: 0.75rem;
    padding: 0 1.25rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
}

/* ===========================
   NOTIFICACIONES ELEGANTES
   ========================== */

@keyframes slideInRight {
    from { 
        transform: translateX(120%) rotate(5deg); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0) rotate(0deg); 
        opacity: 1; 
    }
}

@keyframes slideOutRight {
    from { 
        transform: translateX(0) rotate(0deg); 
        opacity: 1; 
    }
    to { 
        transform: translateX(120%) rotate(-3deg); 
        opacity: 0; 
    }
}

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

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===========================
   MENSAJES DE CHAT
   ========================== */

.message {
    margin-bottom: 1rem;
    display: flex;
}

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

.message-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
}

.message.user .message-bubble {
    background: var(--primary-color);
    color: var(--white);
}

.message.bot .message-bubble {
    background: var(--gray-200);
    color: var(--text-color);
}

.message.admin .message-bubble {
    background: linear-gradient(135deg, var(--warning), #fbbf24);
    color: var(--white);
    font-weight: 500;
}

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

/* Formulario de contacto SAGE */
.contact-form-bubble {
    padding: 20px;
    margin: 15px 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(248,250,252,0.95));
    border-radius: 20px;
    border: 1px solid rgba(59,130,246,0.3);
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(59,130,246,0.15);
    animation: chatBubbleIn 0.6s ease-out;
}

.contact-form-bubble .assistant-message {
    color: #1e40af;
    font-weight: 500;
    margin-bottom: 15px;
    text-align: center;
}

.contact-form-bubble input {
    transition: all 0.3s ease;
    border: 1px solid rgba(59,130,246,0.3) !important;
}

.contact-form-bubble input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
    transform: scale(1.02);
}

.contact-form-bubble button {
    transition: all 0.3s ease;
}

.contact-form-bubble button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(59,130,246,0.4);
}