/* ===============================================
   SMART AGENCY - ESTILOS PRINCIPALES
   =============================================== */

/* Estilos generales del cuerpo y fuente */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0d0f1a;
    color: #e0e7ff;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Degradado de fondo para la página */
.gradient-bg {
    background: linear-gradient(135deg, #0d0f1a 0%, #1a1e36 100%);
    min-height: 100vh;
}

/* Estilos para el efecto de partículas */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    display: block;
}

/* Efecto de revelado al hacer scroll */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===============================================
   BOTONES CTA MEJORADOS
   =============================================== */

/* Estilo principal de los botones de llamada a la acción */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 40px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 25px;
    color: #000000;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 12px 35px rgba(255, 215, 0, 0.5),
        0 6px 20px rgba(255, 140, 0, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    min-width: 220px;
    text-align: center;
}

/* Efecto de brillo que pasa por el botón */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Estados hover y activo */
.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, #FFED4E 0%, #FFB800 50%, #FF9500 100%);
    box-shadow: 
        0 20px 50px rgba(255, 215, 0, 0.7),
        0 10px 30px rgba(255, 140, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(255, 215, 0, 0.6),
        0 4px 15px rgba(255, 140, 0, 0.4);
}

/* Iconos en los botones */
.btn-primary svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    z-index: 2;
    position: relative;
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

/* Botón con efecto de pulso */
.btn-pulse {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 
            0 12px 35px rgba(255, 215, 0, 0.5),
            0 6px 20px rgba(255, 140, 0, 0.4),
            inset 0 2px 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow: 
            0 16px 45px rgba(255, 215, 0, 0.7),
            0 8px 25px rgba(255, 140, 0, 0.6),
            inset 0 2px 0 rgba(255, 255, 255, 0.5);
    }
    100% {
        box-shadow: 
            0 12px 35px rgba(255, 215, 0, 0.5),
            0 6px 20px rgba(255, 140, 0, 0.4),
            inset 0 2px 0 rgba(255, 255, 255, 0.4);
    }
}

/* Estilo para las tarjetas de servicios */
.card {
    background: #18181b;
    border-radius: 20px;
    padding: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.3);
}

/* ===============================================
   MODAL DE CHAT SUPERPUESTO
   =============================================== */

/* Overlay que cubre toda la pantalla */
.chat-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Cuando el modal está activo */
.chat-modal-overlay.active {
    display: flex !important;
    opacity: 1 !important;
}

/* Contenedor principal del chat */
.chat-modal-content {
    background: linear-gradient(145deg, #1f2937, #111827);
    border-radius: 25px;
    width: 100%;
    max-width: 480px;
    height: 85vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(255, 215, 0, 0.2);
    transform: scale(0.8) translateY(50px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    position: relative;
}

/* Animación de entrada del modal */
.chat-modal-overlay.active .chat-modal-content {
    transform: scale(1) translateY(0) !important;
}

/* Header del chat */
.chat-header {
    padding: 25px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    background: linear-gradient(135deg, #374151, #1f2937);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-status-indicator {
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.chat-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.chat-close-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 24px;
}

.chat-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.6);
    transform: scale(1.1);
}

/* Contenedor de mensajes */
.chat-messages {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Scrollbar personalizado */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* Estilos de mensajes */
.message {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    animation: messageSlideIn 0.4s ease-out;
    max-width: 85%;
}

.message.user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border: 2px solid rgba(245, 158, 11, 0.3);
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    border: 2px solid rgba(59, 130, 246, 0.3);
}

.message-content {
    flex: 1;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    opacity: 0.8;
}

.message.bot .message-sender {
    color: #f59e0b;
}

.message.user .message-sender {
    color: #3b82f6;
    text-align: right;
}

.message-text {
    background: rgba(255, 255, 255, 0.08);
    padding: 15px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    line-height: 1.6;
    word-wrap: break-word;
}

.message.user .message-text {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border: none;
}

/* Animación de entrada de mensajes */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Indicador de escritura */
.typing-indicator {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    max-width: 85%;
}

.typing-indicator .message-avatar {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border: 2px solid rgba(245, 158, 11, 0.3);
}

.typing-indicator .message-content {
    background: rgba(255, 255, 255, 0.08);
    padding: 15px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.typing-dots {
    display: flex;
    gap: 6px;
}

.typing-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f59e0b;
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Formulario del chat */
.chat-form {
    padding: 25px;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 25px;
    padding: 15px 25px;
    color: #ffffff;
    font-size: 16px;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
    min-height: 50px;
    max-height: 120px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
    background: rgba(255, 255, 255, 0.12);
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-send-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 768px) {
    .btn-primary {
        padding: 16px 32px;
        font-size: 16px;
        min-width: 200px;
    }
    
    .chat-modal-overlay {
        padding: 10px;
    }
    
    .chat-modal-content {
        max-width: 100%;
        height: 90vh;
        border-radius: 20px;
    }
    
    .message {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .btn-primary {
        padding: 14px 28px;
        font-size: 14px;
        min-width: 180px;
    }
}