:root { --main-bg: #212121; --glass-bg: #232323; --primary: #fafafa; --secondary: #000000; --accent: #424242; --bot-bubble: #242424; --user-bubble: #292929; --shadow: 0 8px 32px 0 rgba(0,0,0,0.45), 0 1.5px 8px #1118; --radius: 22px; --font: 'Inter', 'Segoe UI', Arial, sans-serif; } html, body { overflow: hidden; height: 100%; width: 100%; font-family: var(--font); } body { position: fixed; inset: 0; overscroll-behavior: none; display: flex; align-items: center; justify-content: center; min-height: 100vh; min-width: 100vw; background: var(--main-bg); position: relative; z-index: 1; } #bgParticles { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: auto; /* <-- Cambia esto */ z-index: 0; display: block; } .chat-widget { position: relative; margin: auto; left: 0; right: 0; top: 0; bottom: 0; width: 1200px; max-width: 96vw; height: 850px; max-height: 90vh; background: var(--glass-bg); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; z-index: 100; transition: box-shadow 0.2s, opacity 0.2s; opacity: 1; animation: fadeInUp 0.5s, chatFadeIn 0.7s cubic-bezier(.61,-0.01,.45,1.35); border-radius: 32px 32px 24px 24px; border: 2.5px solid #353535; box-shadow: 0 8px 40px 0 rgba(0,0,0,0.32), 0 2px 12px #111a, 0 0 0 3px #44444444 inset; background: linear-gradient(135deg, #232323 80%, #292929 100%); overflow: hidden; } /* Animación de entrada para el chat (más suave y elástica) */ .chat-widget { animation: chatFadeIn 0.8s cubic-bezier(.61,-0.01,.45,1.35); } @keyframes chatFadeIn { from { opacity: 0; transform: scale(0.92) translateY(60px);} 60% { opacity: 1; transform: scale(1.04) translateY(-8px);} to { opacity: 1; transform: scale(1) translateY(0);} } @keyframes fadeInUp { from { opacity: 0; transform: translateY(40px);} to { opacity: 1; transform: translateY(0);} } /* Animación de entrada para el chat */ @keyframes chatFadeIn { from { opacity: 0; transform: scale(0.92) translateY(60px);} 60% { opacity: 1; transform: scale(1.04) translateY(-8px);} to { opacity: 1; transform: scale(1) translateY(0);} } /* Animación de cierre del chat */ @keyframes chatCloseEffect { to { opacity: 0; transform: scale(0.7); } } .chat-widget.closing { animation: chatCloseEffect 0.45s cubic-bezier(.61,-0.01,.45,1.35) forwards; } .chat-header { background: var(--glass-bg); border-bottom: 1.5px solid #61616155; padding: 0.8em 1.2em; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-radius: 18px 18px 0 0; border-bottom: 1.5px solid #444444; border-top: none; box-shadow: 0 2px 8px #23232322; } .chat-header-left { display: flex; align-items: center; gap: 12px; } .chat-avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #ffffff 60%, #3f3f3f 100%); box-shadow: 0 2px 12px #5e5e5e55; border: 2px solid #444444; } .chat-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; } .chat-title { font-weight: 500; font-size: 0.97em; color: var(--primary); letter-spacing: 0.5px; } .chat-subtitle { font-size: 0.93em; color: #1d1d1d; opacity: 0.85; margin-top: 2px; } .chat-close { background: none; border: none; font-size: 1.25em; color: #474747; cursor: pointer; padding: 0 0 0 8px; transition: transform 0.18s cubic-bezier(.61,-0.01,.45,1.35), color 0.2s; } .chat-close:hover, .chat-close:focus { transform: scale(1.22); color: #000000; outline: none; } .chat-body { flex: 1; overflow-y: auto; padding: 22px 18px 12px 18px; background: transparent; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; } /* Barra de scroll personalizada para el chat */ .chat-body::-webkit-scrollbar { width: 10px; background: #d3d3d3; border-radius: 8px; } .chat-body::-webkit-scrollbar-thumb { background: #292929; border-radius: 8px; min-height: 40px; box-shadow: 0 2px 8px #6c63ff22; } .chat-body::-webkit-scrollbar-thumb:hover { background: linear-gradient(135deg, #3b3b3b 60%, #3d3d3d 100%); } .message-row { display: flex; align-items: flex-end; gap: 10px; max-width: 90%; margin-bottom: 2px; opacity: 0; transform: translateY(30px) scale(0.98); animation: msgIn 0.5s cubic-bezier(.61,-0.01,.45,1.35) forwards; } .message-row.user { flex-direction: row-reverse; } .message-row.visible { opacity: 1; transform: none; } @keyframes msgIn { 0% { opacity: 0; transform: translateY(40px) scale(0.97);} 70% { opacity: 1; transform: translateY(-8px) scale(1.03);} 100% { opacity: 1; transform: translateY(0) scale(1);} } .message-bubble { padding: 14px 18px; border-radius: 18px 18px 18px 8px; background: var(--bot-bubble); color: var(--primary); font-size: 1.08em; box-shadow: 0 2px 8px #63636322; border: 2px solid #353535; position: relative; min-width: 48px; max-width: 80vw; word-break: break-word; animation: fadeInBubble 0.4s; margin-bottom: 8px; border-radius: 22px 22px 18px 18px; border: 1.8px solid #353535; box-shadow: 0 2px 12px #1118; background-clip: padding-box; padding: 16px 22px 16px 22px; position: relative; padding-right: 44px; /* deja espacio para el botón */ border: 2px solid #353535 !important; box-shadow: 0 2px 12px #23232355, 0 1px 6px #1118; background-clip: padding-box; } @keyframes fadeInBubble { from { opacity: 0; transform: scale(0.95);} to { opacity: 1; transform: scale(1);} } .message-row.user .message-bubble { background: var(--user-bubble); color: var(--primary); border: 2px solid #444444; border-radius: 18px 18px 8px 18px; background: linear-gradient(135deg, #292929 80%, #232323 100%); margin-left: 5vw; margin-right: 0; } .message-meta { font-size: 0.62em; color: #3b3b3b; margin-top: 6px; text-align: right; opacity: 0.7; display: block; } .typing-row { display: flex; align-items: center; gap: 8px; margin-left: 6px; } .typing-dot { display: inline-block; width: 5px; height: 5px; margin: 0 2px; background: #353535b7; border-radius: 50%; opacity: 0.7; animation: blink 1.2s infinite; } .typing-dot:nth-child(2) { animation-delay: 0.2s;} .typing-dot:nth-child(3) { animation-delay: 0.4s;} @keyframes blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } } .chat-footer { position: relative; display: flex; align-items: center; gap: 10px; padding: 16px 16px 16px 16px; background: #52525218; border-top: 1.5px solid #29292955; border-radius: 0 0 18px 18px; border-top: 1.5px solid #444444; border-bottom: none; box-shadow: 0 -2px 8px #23232322; } .chat-footer-row { width: 100%; display: flex; align-items: center; justify-content: flex-end; gap: 12px; /* Más espacio entre botones */ } .chat-footer input[type="text"] { width: 100%; min-width: 0; max-width: 100%; flex: 1 1 auto; padding-left: 18px; padding-right: 18px; height: 52px; font-size: 1.08em; border-radius: 18px; margin-right: 10px; box-sizing: border-box; } .chat-footer input[type="text"]:focus { border: 1.5px solid var(--primary); outline: none; box-shadow: 0 0 0 3px #FFD70033; transition: box-shadow 0.2s; } .chat-footer button { background: none; border: none; font-size: 1.05em; color: #505050; cursor: pointer; padding: 0 8px; transition: color 0.2s; display: flex; align-items: center; justify-content: center; } .chat-footer button.chat-send { background: linear-gradient(90deg, #47474700 0%rgba(92, 92, 92, 0)5c 100%); color: #444444; border-radius: 50%; font-size: 1.25em; box-shadow: 0 2px 8px #46464600; padding: 0; width: 44px; height: 44px; margin-left: 12px !important; display: flex; align-items: center; justify-content: center; border: none; transition: background 0.3s, box-shadow 0.3s, transform 0.18s cubic-bezier(.61,-0.01,.45,1.35); } .chat-footer button.chat-send:hover, .chat-footer button.chat-send:focus { background: linear-gradient(90deg, #25252500 0%, #11111100 100%); box-shadow: 0 4px 16px #50505000; transform: scale(1.13); outline: none; } .chat-footer button.chat-extra { color: #3b3b3b; } .chat-footer button.chat-extra:hover { color: #272727; } .chat-fab { position: fixed; bottom: 32px; right: 32px; width: 64px; height: 64px; background: #292929; color: var(--primary); border: none; border-radius: 50%; box-shadow: 0 4px 24px #111a; font-size: 2em; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.2s, box-shadow 0.2s, transform 0.18s cubic-bezier(.61,-0.01,.45,1.35); } .chat-fab:hover { background: #424242; color: var(--primary); box-shadow: 0 8px 32px #20202055; transform: scale(1.08); } .copy-btn { position: absolute; top: 25%; right: 12px; transform: translateY(-50%); background: #2323238e; color: #555555; border: none; border-radius: 7px; padding: 5px 10px; font-size: 1em; box-shadow: 0 1px 6px #1114; opacity: 0; pointer-events: none; transition: opacity 0.2s, background 0.2s, color 0.2s; z-index: 2; display: flex; align-items: center; max-width: 60%; min-width: 32px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* Muestra el botón solo al pasar el mouse o enfocar la burbuja */ .message-bubble:hover .copy-btn, .message-bubble:focus-within .copy-btn, .message-row:hover .copy-btn, .message-row:focus-within .copy-btn { opacity: 1; pointer-events: auto; } /* Si la burbuja es muy pequeña, el botón también se reduce */ .message-bubble { min-height: 28px; } .char-counter { width: 100%; text-align: right; font-size: 0.80em; color: #5e5e5e; margin: 0 2px 0 0; pointer-events: none; } @media (max-width: 600px) { .chat-widget { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; bottom: 0; right: 0; border-radius: 0; } .chat-fab { right: 16px; bottom: 16px; width: 54px; height: 54px; font-size: 1.5em; } .char-counter { right: 8px; bottom: 60px; font-size: 0.88em; } } /* Mejor adaptación profesional para celular */ @media (max-width: 600px), (max-height: 700px) { body.mobile .chat-widget { width: 100vw !important; max-width: 100vw !important; height: 100vh !important; max-height: 100vh !important; border-radius: 0 !important; box-shadow: none !important; left: 0; right: 0; top: 0; bottom: 0; padding: 0 !important; display: flex !important; flex-direction: column !important; } body.mobile .chat-header { padding: 10px 8px 10px 8px !important; min-height: 54px; } body.mobile .chat-body { padding: 10px 4px 8px 4px !important; gap: 10px !important; font-size: 1em !important; max-height: calc(100vh - 170px) !important; } body.mobile .message-bubble { font-size: 1em !important; padding: 12px 14px 12px 14px !important; min-width: 36px !important; max-width: 90vw !important; border-radius: 16px 16px 12px 12px !important; } body.mobile .message-row { max-width: 100vw !important; gap: 6px !important; } body.mobile .chat-footer { padding: 8px 4px 8px 4px !important; min-height: 64px; background: #232323f2; border-top: 1.5px solid #29292955; box-sizing: border-box; } body.mobile .chat-footer-row { width: 100%; max-width: 100vw; display: flex; align-items: center; justify-content: space-between; gap: 6px; } body.mobile .chat-footer input[type="text"] { width: 100%; min-width: 0; max-width: 100vw; flex: 1 1 auto; padding-left: 10px; padding-right: 10px; height: 38px; font-size: 1em; border-radius: 12px; margin-right: 0; box-sizing: border-box; } body.mobile .chat-footer button.chat-send { width: 38px; height: 38px; font-size: 1.1em; margin-left: 2px; border-radius: 50%; padding: 0; } body.mobile .chat-footer button.chat-extra { font-size: 1.1em; margin-right: 2px; } body.mobile .char-counter { font-size: 0.93em; margin-top: 2px; margin-bottom: 0; padding-right: 2px; text-align: right; } body.mobile .copy-btn { right: 6px !important; font-size: 0.95em !important; padding: 4px 7px !important; max-width: 80% !important; } body.mobile .image-preview { max-width: 96vw !important; max-height: 180px !important; } body.mobile .image-preview-container { margin: 8px 0 !important; } } .image-upload-btn { color: #666666; font-size: 1.25em; cursor: pointer; margin-right: 8px; transition: color 0.2s; } .image-upload-btn:hover { color: #e0e0e0; } .chat-img-preview { max-width: 180px; max-height: 180px; border-radius: 10px; margin: 6px 0; display: block; box-shadow: 0 2px 8px #23252655; } /* Vista previa de imagen generada */ .image-preview-container { display: flex; flex-direction: column; align-items: center; margin: 12px 0; position: relative; } .image-preview { max-width: 220px; max-height: 220px; border-radius: 14px; box-shadow: 0 2px 12px #23252633; margin-bottom: 10px; transition: box-shadow 0.2s, transform 0.2s; border: 2px solid #e0e7ff; object-fit: cover; } .image-preview:hover { box-shadow: 0 4px 24px #6c63ff44; transform: scale(1.03); } .download-btn { display: flex; align-items: center; justify-content: center; background: #e0e7ff; color: #232526; border: none; border-radius: 8px; padding: 7px 14px 7px 10px; font-size: 1.1em; cursor: pointer; box-shadow: 0 1px 6px #e0e7ff33; transition: background 0.2s, color 0.2s, transform 0.15s; position: absolute; bottom: 10px; right: 10px; } .download-btn:hover { background: #c7d2fe; color: #6c63ff; transform: scale(1.08); } .download-btn .fa-copy { margin-right: 4px; font-size: 1.1em; position: relative; } .download-btn .arrow-down { display: inline-block; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 8px solid #232526; margin-left: 2px; margin-bottom: -2px; } /* Todo el texto en blanco por defecto */ html, body, .chat-widget, .chat-header, .chat-title, .chat-subtitle, .chat-body, .message-bubble, .message-row.user .message-bubble, .copy-btn, .download-btn, .chat-fab, .new-chat-btn, .char-counter, input, button, label, span, div, p, a { color: #fff !important; } /* EXCEPTO el input de la barra de chat, que será negro */ .chat-footer input[type="text"] { color: #111 !important; background: #a8a8a8 !important; /* Opcional: fondo blanco para mejor contraste */ } .device-selector-overlay { position: fixed; z-index: 9999; inset: 0; background: rgba(33,33,33,0.95); display: flex; align-items: center; justify-content: center; transition: opacity 0.4s; } .device-selector-box { background: linear-gradient(135deg, #232323 80%, #292929 100%); border-radius: 28px; box-shadow: 0 8px 40px #23232388; padding: 38px 32px 32px 32px; text-align: center; border: 2.5px solid #444444; color: #fff; min-width: 260px; } .device-selector-box h2 { font-size: 1.25em; margin-bottom: 22px; color: #fff; font-weight: 600; } .device-btn { background: linear-gradient(90deg, #303030 60%, #3b3b3b 100%); color: #232323; border: none; border-radius: 14px; font-size: 1.1em; font-weight: 600; padding: 14px 28px; margin: 0 16px; margin-top: 8px; box-shadow: 0 2px 12px #63636333; cursor: pointer; transition: background 0.2s, color 0.2s, transform 0.15s; display: inline-flex; align-items: center; gap: 10px; } .device-btn:hover { background: linear-gradient(90deg, #8a8a8a 60%, #4b4b4b 100%); color: #232323; transform: scale(1.06); } /* Animación de entrada para el chat (más suave y elástica) */ .chat-widget { animation: chatFadeIn 0.8s cubic-bezier(.61,-0.01,.45,1.35); } @keyframes chatFadeIn { from { opacity: 0; transform: scale(0.92) translateY(60px);} 60% { opacity: 1; transform: scale(1.04) translateY(-8px);} to { opacity: 1; transform: scale(1) translateY(0);} } /* Animación de entrada para cada mensaje (más rebote) */ .message-row { opacity: 0; transform: translateY(40px) scale(0.97); animation: msgIn 0.55s cubic-bezier(.61,-0.01,.45,1.35) forwards; } @keyframes msgIn { 0% { opacity: 0; transform: translateY(40px) scale(0.97);} 70% { opacity: 1; transform: translateY(-8px) scale(1.03);} 100% { opacity: 1; transform: translateY(0) scale(1);} } /* Animación para el botón de enviar */ .chat-footer button, .chat-footer .chat-send { transition: background 0.2s, color 0.2s, transform 0.18s cubic-bezier(.61,-0.01,.45,1.35), box-shadow 0.18s; } .chat-footer button:active, .chat-footer .chat-send:active { transform: scale(0.93) rotate(-8deg); box-shadow: 0 2px 12px #0003; } /* Animación para el input al enfocar */ .chat-footer input[type="text"]:focus { box-shadow: 0 0 0 3px #FFD70033; transition: box-shadow 0.2s; } /* Animación para el botón de copiar */ .copy-btn { transition: background 0.2s, color 0.2s, transform 0.18s cubic-bezier(.61,-0.01,.45,1.35), opacity 0.2s; } .copy-btn:active { transform: scale(0.93) rotate(8deg); } /* Animación para la imagen generada */ .message-bubble img { animation: imgPop 0.7s cubic-bezier(.61,-0.01,.45,1.35); box-shadow: 0 2px 16px #0003; } @keyframes imgPop { 0% { opacity: 0; transform: scale(0.85);} 70% { opacity: 1; transform: scale(1.05);} 100% { opacity: 1; transform: scale(1);} } /* Animación para el selector de dispositivo */ .device-selector-overlay { animation: fadeInOverlay 0.5s cubic-bezier(.61,-0.01,.45,1.35); } @keyframes fadeInOverlay { from { opacity: 0;} to { opacity: 1;} } .device-selector-box { animation: popInBox 0.7s cubic-bezier(.61,-0.01,.45,1.35); } @keyframes popInBox { from { opacity: 0; transform: scale(0.85);} 70% { opacity: 1; transform: scale(1.05);} to { opacity: 1; transform: scale(1);} } /* Animación para el FAB */ .chat-fab { transition: background 0.2s, box-shadow 0.2s, transform 0.18s cubic-bezier(.61,-0.01,.45,1.35); } .chat-fab:active { transform: scale(0.93) rotate(-8deg); } /* Adaptación para móvil */ body.mobile .chat-widget { width: 100vw !important; max-width: 100vw !important; height: 100vh !important; max-height: 100vh !important; border-radius: 0 !important; box-shadow: none !important; left: 0; right: 0; top: 0; bottom: 0; } body.mobile .chat-header, body.mobile .chat-footer { padding-left: 8px !important; padding-right: 8px !important; } body.mobile .chat-body { padding-left: 6px !important; padding-right: 6px !important; } body.mobile .chat-fab { right: 12px !important; bottom: 12px !important; width: 54px !important; height: 54px !important; font-size: 1.5em !important; } /* Adaptación para PC */ body.pc .chat-widget { width: 1200px !important; max-width: 96vw !important; height: 850px !important; max-height: 90vh !important; border-radius: 32px 32px 24px 24px !important; box-shadow: 0 8px 40px 0 rgba(0,0,0,0.32), 0 2px 12px #111a !important; } body.pc .chat-fab { right: 32px !important; bottom: 32px !important; width: 64px !important; height: 64px !important; font-size: 2em !important; } /* Forzar la burbuja del usuario más a la izquierda */ .message-row.user { justify-content: flex-end !important; } .message-row.user .message-bubble { margin-right: -8.5vw !important; margin-left: auto !important; } .chat-send { margin-left: 12px !important; } /* Mejora botón "Pensar" y su luz */ .chat-think { position: relative; background: #232323 !important; color: #949494 !important; border: none; border-radius: 50% !important; width: 48px !important; height: 48px !important; min-width: 48px !important; min-height: 48px !important; font-size: 1.25em; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px #FFD70033; transition: background 0.3s cubic-bezier(.61,-0.01,.45,1.35), color 0.3s cubic-bezier(.61,-0.01,.45,1.35), box-shadow 0.3s cubic-bezier(.61,-0.01,.45,1.35), transform 0.18s cubic-bezier(.61,-0.01,.45,1.35); z-index: 2; overflow: visible; } .chat-think .fa-lightbulb { color: #949494 !important; transition: color 0.3s cubic-bezier(.61,-0.01,.45,1.35), text-shadow 0.3s; z-index: 2; } .chat-think .think-light { position: absolute; left: 50%; top: 50%; width: 80px; height: 80px; pointer-events: none; border-radius: 50% !important; transform: translate(-50%, -50%); opacity: 0; background: radial-gradient(circle, #ffe066 0%, #ffd70088 60%, transparent 100%); filter: blur(2px); transition: opacity 0.3s, filter 0.3s; z-index: 1; } .chat-think.thinking .think-light { opacity: 0.5; animation: thinkGlowReal 1.2s infinite alternate; filter: blur(4px); } @keyframes thinkGlowReal { 0% { opacity: 0.3; filter: blur(2px);} 60% { opacity: 0.5; filter: blur(6px);} 100% { opacity: 0.4; filter: blur(4px);} } .chat-think.thinking { background: #ffd90049 !important; color: #232323 !important; box-shadow: 0 0 32px 10px #ffd90036, 0 2px 8px #FFD70033; } .chat-think.thinking .fa-lightbulb { color: #fff7008e !important; text-shadow: 0 0 6px #ffe066, 0 0 32px #ffd9005b; } .chat-think.thinking .think-light { opacity: 1; animation: thinkGlowReal 1.2s infinite alternate; filter: blur(10px); } @keyframes thinkGlowReal { 0% { opacity: 0.7; filter: blur(4px);} 60% { opacity: 1; filter: blur(16px);} 100% { opacity: 0.85; filter: blur(8px);} }