/* ==========================================
   CHATBOT UNOVA - DISEÑO GLASSMORPHISM
   ========================================== */

/* ==========================================
   VARIABLES CSS
   ========================================== */
:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-darker: #047857;
    --gray-400: #9ca3af;
    --gray-600: #6b7280;
    --gray-700: #374151;
    --error: #ef4444;
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --transition: all 0.3s ease;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   SECCIÓN DEMO
   ========================================== */
.demo {
    padding: 5rem 0;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    position: relative;
    overflow: hidden;
}

.demo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(16, 185, 129, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

.demo .container { 
    position: relative; 
    z-index: 1; 
}

.demo .section-header h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.demo .section-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 400;
}

/* ==========================================
   FORMULARIO EMAIL GLASSMORPHISM
   ========================================== */
.email-form-container {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 3rem 2.5rem;
    margin: 0 auto 2rem;
    text-align: center;
    max-width: 600px;
    position: relative;
}

.email-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

.email-form-container h3 {
    color: white;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.email-form-container p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.email-input-group {
    display: flex;
    gap: 12px;
    max-width: 450px;
    margin: 0 auto 1.5rem;
    position: relative;
    z-index: 1;
}

.email-input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    font-size: 16px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-weight: 500;
}

.email-input::placeholder { 
    color: rgba(255, 255, 255, 0.6); 
    font-weight: 400; 
}

.email-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.email-input.error {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.email-submit-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.email-submit-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;
}

.email-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-darker));
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.email-submit-btn:hover:not(:disabled)::before { 
    left: 100%; 
}

.email-submit-btn:disabled {
    background: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.email-error, .email-success {
    font-size: 14px;
    margin-top: 1rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.email-error { color: #ff6b6b; }
.email-success { color: #51cf66; }

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* ==========================================
   CONTENEDOR CHAT GLASSMORPHISM
   ========================================== */
.chat-container {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-xl);
    display: flex;
    justify-content: center;
    margin: auto;
    max-width: 900px;
    position: relative;
    min-height: 400px;
}

.chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

.chat-container.visible {
    display: block;
    animation: slideInUp 0.6s ease-out;
}

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

.user-info {
    background: rgba(240, 249, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}

.user-info strong { color: white; font-weight: 600; }
.user-info small { color: rgba(255, 255, 255, 0.8); font-size: 14px; }

/* ==========================================
   CHAT PRINCIPAL
   ========================================== */
.custom-chat-container {
    height: 650px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

.custom-chat-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, var(--primary-darker) 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 
        0 4px 20px rgba(16, 185, 129, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
}

.custom-chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.chat-avatar {
    font-size: 2rem;
    width: 55px;
    height: 55px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

.chat-info h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    position: relative;
    z-index: 1;
}

.chat-status {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.custom-chat-messages {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: linear-gradient(to bottom, #f8fafc, #ffffff);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    order: 1;
}

.custom-chat-messages::-webkit-scrollbar { width: 6px; }
.custom-chat-messages::-webkit-scrollbar-track { background: rgba(241, 245, 249, 0.5); border-radius: 3px; }
.custom-chat-messages::-webkit-scrollbar-thumb { background: linear-gradient(to bottom, var(--primary), var(--primary-dark)); border-radius: 3px; }
.custom-chat-messages::-webkit-scrollbar-thumb:hover { background: linear-gradient(to bottom, var(--primary-dark), var(--primary-darker)); }

.chat-message {
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    animation: slideInMessage 0.4s ease-out;
    word-wrap: break-word;
    position: relative;
}

.chat-message.bot {
    background: white;
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: 20px 20px 20px 6px;
    color: var(--gray-700);
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    align-self: flex-start;
}

.chat-message.user {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 20px 20px 6px 20px;
    color: white;
    box-shadow: 
        0 4px 15px rgba(16, 185, 129, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    align-self: flex-end;
}

.chat-message.user::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    border-radius: inherit;
    pointer-events: none;
}

@keyframes slideInMessage {
    from { opacity: 0; transform: translateY(15px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================
   PREGUNTAS FRECUENTES
   ========================================== */
.quick-questions-container {
    padding: 1.5rem 2rem;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(229, 231, 235, 0.5);
    transition: var(--transition);
}

.quick-questions-container.initial-position { order: 2; }

.quick-questions-container.bottom-position {
    padding: 1rem 1.5rem;
    background: rgba(248, 250, 252, 0.6);
    border-top: 1px solid rgba(229, 231, 235, 0.3);
}

.quick-questions-title {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin: 0 0 1rem 0;
    text-align: center;
    font-weight: 500;
}

.quick-questions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.quick-btn {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-weight: 500;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.quick-btn:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    border-color: var(--primary);
}

/* ==========================================
   INPUT CHAT
   ========================================== */
.custom-chat-input-container {
    padding: 1.25rem 2rem 1.5rem 2rem;
    background: white;
    border-top: 1px solid rgba(229, 231, 235, 0.5);
    order: 3;
}

.typing-indicator {
    padding: 0.75rem 0 0.5rem 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 0.75rem;
}

.typing-dots { display: flex; gap: 4px; }

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: typingAnimation 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes typingAnimation {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.chat-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.custom-chat-input {
    flex: 1;
    border: 2px solid rgba(229, 231, 235, 0.6);
    border-radius: 25px;
    padding: 1rem 60px 1rem 1.25rem;
    font-size: 0.95rem;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    outline: none;
    font-family: inherit;
    font-weight: 500;
}

.custom-chat-input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 
        0 0 0 3px rgba(16, 185, 129, 0.1),
        0 4px 15px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.custom-chat-input:disabled {
    background: rgba(248, 250, 252, 0.5);
    color: var(--gray-400);
    cursor: not-allowed;
}

.custom-chat-input::placeholder {
    color: var(--gray-400);
    font-style: italic;
    font-weight: 400;
}

.custom-chat-send-btn {
    position: absolute;
    right: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 15px rgba(16, 185, 129, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.custom-chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05) translateY(-1px);
    box-shadow: 
        0 6px 20px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.custom-chat-send-btn:active { transform: scale(0.95); }

.custom-chat-send-btn:disabled {
    background: rgba(156, 163, 175, 0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .demo .section-header h2 { font-size: 2rem; }
    
    .email-form-container {
        padding: 2rem 1.5rem;
        margin: 0 1rem 2rem 1rem;
    }
    
    .email-input-group {
        flex-direction: column;
        gap: 1rem;
        max-width: 100%;
    }
    
    .email-submit-btn { width: 100%; }
    
    .chat-container {
        margin: 0 1rem 2rem 1rem;
        padding: 1.5rem;
    }
    
    .custom-chat-container { height: 550px; }
    .custom-chat-header { padding: 1.25rem 1.5rem; }
    .chat-info h4 { font-size: 1.1rem; }
    .custom-chat-messages { padding: 1.5rem; }
    
    .chat-message {
        font-size: 0.9rem;
        padding: 0.875rem 1rem;
        max-width: 90%;
    }
    
    .quick-questions-buttons { flex-direction: column; align-items: center; }
    .quick-btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
    
    .custom-chat-input-container { padding: 1rem 1.5rem 1.25rem 1.5rem; }
}

@media (max-width: 480px) {
    .demo .section-header h2 { font-size: 1.75rem; }
    
    .email-form-container {
        padding: 1.5rem 1rem;
        margin: 0 0.5rem 1.5rem 0.5rem;
    }
    
    .chat-container {
        margin: 0 0.5rem 1.5rem 0.5rem;
        padding: 1rem;
    }
    
    .custom-chat-container { height: 500px; }
    .custom-chat-header { padding: 1rem; }
    .chat-info h4 { font-size: 1rem; }
    .chat-status { font-size: 0.85rem; }
    .custom-chat-messages { padding: 1rem; }
    .custom-chat-input-container { padding: 0.75rem 1rem 1rem 1rem; }
    .typing-indicator { font-size: 0.8rem; }
    
    .custom-chat-input {
        padding: 0.875rem 50px 0.875rem 1rem;
        font-size: 0.9rem;
    }
    
    .custom-chat-send-btn {
        width: 38px;
        height: 38px;
        right: 6px;
    }
} 