/* ============================================================================ CHAT WIDGET — CV Assistant Mascot Uses CV design tokens from _variables.css Position: right side, just above back-to-top button (right: 2rem) ============================================================================ */ /* ========================================================================== Toggle Button — right side, above back-to-top (bottom: 6rem) Matches existing fixed button style: dark bg, 50px, subtle opacity ========================================================================== */ .chat-toggle-btn { position: fixed; bottom: 6rem; right: 2rem; z-index: 1000; width: 50px; height: 50px; border-radius: 50%; background: var(--black-bar, #2b2b2b); color: white; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); transition: all 0.3s ease; opacity: 0.4; } .chat-toggle-btn:hover { opacity: 1; transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); background: var(--accent-green, #27ae60); } /* Open state (robot): wiggle */ .chat-toggle-btn:hover .chat-icon-open { animation: iconWiggle 0.5s ease; } /* Closed state (X): rotate clockwise */ .chat-toggle-btn:hover .chat-icon-close { transform: rotate(90deg); transition: transform 0.3s ease; } /* Icon swap: show mascot by default, close when active */ .chat-toggle-btn .chat-icon-close { display: none; } /* Wave greeting — pops up 3 times then stays hidden */ /* Wave greeting — independent of button opacity */ .chat-wave { position: fixed; bottom: calc(6rem + 38px); right: calc(2rem + 38px); z-index: 1001; font-size: 1.1rem; animation: chatWaveHello 5s ease-in-out 2s forwards; opacity: 0; pointer-events: none; } @keyframes chatWaveHello { /* === First wave === */ 0% { opacity: 0; transform: rotate(0deg); } 4% { opacity: 1; transform: rotate(0deg); } 7% { transform: rotate(20deg); } 10% { transform: rotate(-15deg); } 13% { transform: rotate(18deg); } 16% { transform: rotate(-12deg); } 19% { transform: rotate(15deg); } 22% { transform: rotate(-8deg); } 25% { transform: rotate(0deg); } 30% { opacity: 1; } 35% { opacity: 0; } /* === Pause === */ 45% { opacity: 0; transform: rotate(0deg); } /* === Second wave === */ 49% { opacity: 1; transform: rotate(0deg); } 52% { transform: rotate(20deg); } 55% { transform: rotate(-15deg); } 58% { transform: rotate(18deg); } 61% { transform: rotate(-12deg); } 64% { transform: rotate(15deg); } 67% { transform: rotate(-8deg); } 70% { transform: rotate(0deg); } 78% { opacity: 1; } 90% { opacity: 0; } 100% { opacity: 0; } } /* Hide wave when chat is open */ .chat-wave.chat-wave-hidden { display: none; } .chat-toggle-btn.mascot-active { opacity: 1; background: var(--accent-green, #27ae60); } .chat-toggle-btn.mascot-active .chat-icon-open { display: none; } .chat-toggle-btn.mascot-active .chat-icon-close { display: inline-block; } /* ========================================================================== Panel — right side, above the button ========================================================================== */ .chat-panel { position: fixed; bottom: 10.5rem; right: 2rem; width: 360px; max-height: 500px; background: var(--paper-bg, #ffffff); border: 1px solid var(--border-light, #e0e0e0); border-radius: 8px; box-shadow: var(--shadow-lg, 2px 2px 9px rgba(0, 0, 0, 0.5)); display: none; flex-direction: column; z-index: 999; overflow: hidden; font-family: 'Source Sans Pro', 'Segoe UI', sans-serif; transition: all 0.25s ease; } .chat-panel.chat-open { display: flex; } /* Size: Half screen — docked right */ .chat-panel.chat-half { top: 0; right: 0; bottom: 0; left: auto; width: 50vw; height: auto; max-height: none; border-radius: 0; border-left: 2px solid var(--border-light); } .chat-panel.chat-half .chat-messages { max-height: none; flex: 1; } /* Size: Floating — draggable, resizable window */ .chat-panel.chat-float { bottom: 10.5rem; right: 2rem; top: auto; left: auto; width: 420px; height: 450px; max-height: 70vh; min-width: 300px; min-height: 250px; border-radius: 8px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); resize: both; overflow: hidden; transition: none; } /* Disable transition during active drag for instant movement */ .chat-panel.chat-dragging { transition: none !important; user-select: none; } .chat-panel.chat-float .chat-messages { max-height: none; flex: 1; } /* Size: Full screen */ .chat-panel.chat-full { top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: auto; max-height: none; border-radius: 0; border: none; } .chat-panel.chat-full .chat-messages { max-height: none; flex: 1; } /* ========================================================================== Header — accent-green for visual distinction ========================================================================== */ .chat-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--accent-green, #27ae60); color: #ffffff; font-family: 'Quicksand', sans-serif; font-size: 0.85rem; font-weight: 600; } .chat-header iconify-icon { font-size: 1.1rem; } /* Header actions — cog menu + help + close */ .chat-header-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; } .chat-mode-btn { background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; font-size: 0.95rem; padding: 4px; display: flex; align-items: center; justify-content: center; border-radius: 4px; transition: all 0.15s; } .chat-mode-btn:hover { color: #fff; background: rgba(255,255,255,0.15); } /* Cog dropdown wrapper */ .chat-cog-wrapper { position: relative; } .chat-cog-menu { display: none; position: absolute; top: calc(100% + 6px); right: 0; background: var(--paper-bg, #fff); border: 1px solid var(--border-light, #e0e0e0); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.2); padding: 4px; z-index: 1002; min-width: 140px; } .chat-cog-menu.chat-cog-open { display: flex; flex-direction: column; } .chat-cog-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: none; background: none; border-radius: 5px; font-size: 0.72rem; font-family: 'Source Sans Pro', sans-serif; color: var(--text-secondary, #333); cursor: pointer; transition: all 0.15s; white-space: nowrap; } .chat-cog-item:hover { background: var(--accent-green, #27ae60); color: #fff; } .chat-cog-item.active { background: rgba(39, 174, 96, 0.12); color: var(--accent-green, #27ae60); font-weight: 600; } .chat-cog-item iconify-icon { font-size: 0.9rem; flex-shrink: 0; } /* ========================================================================== Messages Area ========================================================================== */ .chat-messages { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: 260px; min-height: 60px; } /* Teams-style message rows */ .chat-row { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; overflow: hidden; flex-shrink: 0; } .chat-row-user { justify-content: flex-end; } .chat-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-green, #27ae60); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; margin-top: 2px; } .chat-avatar-user { background: var(--text-light, #999999); } .chat-avatar-juan { width: 36px; height: 36px; background: none; padding: 0; overflow: hidden; } .chat-avatar-juan img { width: 100%; height: 100%; object-fit: cover; object-position: center top; border-radius: 50%; } .chat-disclaimer { display: inline; text-decoration: underline dotted; text-underline-offset: 2px; opacity: 0.7; cursor: help; } .chat-msg { padding: 10px 14px; border-radius: 16px; font-size: 0.8rem; line-height: 1.5; max-width: 85%; min-width: 0; word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; } .chat-msg a, .chat-msg strong, .chat-msg p { overflow-wrap: break-word; word-break: break-word; } .chat-row-bot .chat-msg { background: var(--paper-secondary-bg, #f5f5f5); color: var(--text-secondary, #333333); border-top-left-radius: 4px; } .chat-row-user .chat-msg { background: var(--accent-green, #27ae60); color: #fff; border-top-right-radius: 4px; } /* Message content typography */ .chat-msg p { margin: 0 0 4px 0; } .chat-msg p:last-child { margin-bottom: 0; } .chat-msg ul { margin: 4px 0; padding-left: 16px; } .chat-msg li { margin-bottom: 2px; } /* Error message — simple styled div (not a chat-row) */ .chat-error { padding: 8px 12px; border-radius: 12px; background: #fef2f2; color: #991b1b; align-self: center; font-style: italic; border: 1px solid #fecaca; font-size: 0.75rem; } [data-color-theme="dark"] .chat-error { background: #3a1a1a; color: #fca5a5; border-color: #5a2a2a; } @media (prefers-color-scheme: dark) { [data-color-theme="auto"] .chat-error { background: #3a1a1a; color: #fca5a5; border-color: #5a2a2a; } } /* ========================================================================== Navigation Links in Chat Messages ========================================================================== */ /* Inline icons in chat messages — compact size to fit bubbles */ .chat-msg .icon-sprite.icon-chat { width: 20px; height: 20px; background-size: auto 20px; vertical-align: middle; margin-right: 2px; border-radius: 3px; } .chat-msg .icon-chat.icon-company { background-position-x: calc(var(--icon-index, 0) * -20px); } .chat-msg .icon-chat.icon-project { background-position-x: calc(var(--icon-index, 0) * -20px); } .chat-msg .icon-chat.icon-course { background-position-x: calc(var(--icon-index, 0) * -20px); } .chat-inline-icon { width: 20px; height: 20px; vertical-align: middle; margin-right: 2px; border-radius: 3px; object-fit: contain; } .chat-nav-link { color: var(--accent-green, #27ae60); text-decoration: none; font-weight: 600; cursor: pointer; border-bottom: 1px dotted var(--accent-green, #27ae60); word-break: break-word; overflow-wrap: break-word; } .chat-nav-link:hover { color: #1e8c4c; border-bottom-style: solid; } /* Highlight animation when scrolled to from chat */ .chat-highlight { animation: chatHighlight 2s ease; } @keyframes chatHighlight { 0%, 100% { box-shadow: none; } 20%, 80% { box-shadow: 0 0 0 3px var(--accent-green, #27ae60); border-radius: 4px; } } /* ========================================================================== Typing Indicator ========================================================================== */ .chat-typing { display: none; align-items: center; gap: 4px; padding: 6px 14px; } .chat-typing.htmx-request { display: flex; } .chat-typing-dots { display: inline-flex; align-items: center; gap: 4px; } .chat-status-text { font-size: 0.72rem; color: var(--accent-green, #27ae60); font-style: italic; animation: statusPulse 2s ease-in-out infinite; } @keyframes statusPulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } } .chat-typing-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-light, #999999); animation: typingBounce 1.4s infinite ease-in-out both; } .chat-typing-dot:nth-child(1) { animation-delay: 0s; } .chat-typing-dot:nth-child(2) { animation-delay: 0.16s; } .chat-typing-dot:nth-child(3) { animation-delay: 0.32s; } @keyframes typingBounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } } /* ========================================================================== Suggested Question Chips ========================================================================== */ .chat-suggestions { display: flex; gap: 5px; padding: 6px 10px; overflow-x: auto; flex-wrap: wrap; border-top: 1px solid var(--border-light, #e0e0e0); } .chat-chip { flex-shrink: 0; background: transparent; color: var(--text-muted, #666666); border: 1px solid var(--border-light, #e0e0e0); border-radius: 14px; padding: 3px 10px; font-size: 0.68rem; font-family: 'Source Sans Pro', sans-serif; cursor: pointer; transition: all 0.2s ease; white-space: nowrap; line-height: 1.4; } .chat-chip:hover { background: var(--accent-green, #27ae60); color: #fff; border-color: var(--accent-green, #27ae60); } /* ========================================================================== Input Area ========================================================================== */ .chat-input-area { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border-light, #e0e0e0); background: var(--paper-bg, #ffffff); } .chat-input { flex: 1; padding: 7px 12px; border: 1px solid var(--border-light, #e0e0e0); border-radius: 16px; font-size: 0.8rem; font-family: 'Source Sans Pro', sans-serif; outline: none; background: var(--paper-bg, #ffffff); color: var(--text-primary, #1a1a1a); transition: border-color 0.2s; } .chat-input:focus { border-color: var(--accent-green, #27ae60); } .chat-send-btn { background: var(--accent-green, #27ae60); color: #fff; border: none; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1rem; transition: background 0.2s; flex-shrink: 0; } .chat-send-btn:hover { background: #1e8c4c; } /* ========================================================================== Help Modal — Fullscreen Accordion ========================================================================== */ .chat-help-fullscreen .info-modal-content { max-width: 560px; max-height: 90vh; overflow-y: auto; } .chat-help-intro { font-size: 0.82rem; color: var(--text-muted, #666666); line-height: 1.5; margin: 0 0 16px 0; text-align: center; } .chat-help-accordion { display: flex; flex-direction: column; gap: 6px; } .chat-help-group { border: 1px solid var(--border-light, #e0e0e0); border-radius: 6px; overflow: hidden; } .chat-help-group summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-family: 'Quicksand', sans-serif; font-size: 0.85rem; font-weight: 600; color: var(--text-primary, #1a1a1a); cursor: pointer; background: var(--paper-secondary-bg, #f5f5f5); list-style: none; transition: background 0.2s; } .chat-help-group summary::-webkit-details-marker { display: none; } .chat-help-group summary::after { content: ''; margin-left: auto; width: 6px; height: 6px; border-right: 2px solid var(--text-muted, #666); border-bottom: 2px solid var(--text-muted, #666); transform: rotate(-45deg); transition: transform 0.2s; } .chat-help-group[open] summary::after { transform: rotate(45deg); } .chat-help-group summary:hover { background: var(--paper-bg, #ffffff); } .chat-help-group summary iconify-icon { font-size: 1.1rem; color: var(--accent-green, #27ae60); } .chat-help-questions { display: flex; flex-direction: column; padding: 4px 8px 8px; gap: 2px; } .chat-help-q { display: block; width: 100%; text-align: left; background: none; border: none; padding: 7px 12px; font-size: 0.78rem; font-family: 'Source Sans Pro', sans-serif; color: var(--text-secondary, #333333); cursor: pointer; border-radius: 4px; transition: all 0.15s; line-height: 1.4; } .chat-help-q:hover { background: var(--accent-green, #27ae60); color: #fff; } .chat-help-footer { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px; background: var(--paper-secondary-bg, #f5f5f5); border-radius: 6px; font-size: 0.7rem; color: var(--text-muted, #666666); line-height: 1.4; } .chat-help-footer iconify-icon { font-size: 1rem; flex-shrink: 0; color: var(--text-light, #999999); } /* ========================================================================== Dark Mode — lighter panel to distinguish from CV background ========================================================================== */ [data-color-theme="dark"] .chat-panel { background: #2c2c2c; border-color: #444; } [data-color-theme="dark"] .chat-row-bot .chat-msg { background: #383838; color: #e0e0e0; } [data-color-theme="dark"] .chat-input { background: #333; border-color: #555; color: #e0e0e0; } [data-color-theme="dark"] .chat-input-area { background: #2c2c2c; border-top-color: #444; } [data-color-theme="dark"] .chat-suggestions { border-top-color: #444; } [data-color-theme="dark"] .chat-chip { border-color: #555; color: #bbb; } [data-color-theme="dark"] .chat-nav-link { color: #4eca81; border-bottom-color: #4eca81; } [data-color-theme="dark"] .chat-cog-menu { background: #333; border-color: #555; } [data-color-theme="dark"] .chat-cog-item { color: #ddd; } [data-color-theme="dark"] .chat-cog-item.active { background: rgba(78, 202, 129, 0.15); color: #4eca81; } /* Auto dark (system preference) */ @media (prefers-color-scheme: dark) { [data-color-theme="auto"] .chat-panel { background: #2c2c2c; border-color: #444; } [data-color-theme="auto"] .chat-row-bot .chat-msg { background: #383838; color: #e0e0e0; } [data-color-theme="auto"] .chat-input { background: #333; border-color: #555; color: #e0e0e0; } [data-color-theme="auto"] .chat-input-area { background: #2c2c2c; border-top-color: #444; } [data-color-theme="auto"] .chat-suggestions { border-top-color: #444; } [data-color-theme="auto"] .chat-chip { border-color: #555; color: #bbb; } [data-color-theme="auto"] .chat-nav-link { color: #4eca81; border-bottom-color: #4eca81; } [data-color-theme="auto"] .chat-cog-menu { background: #333; border-color: #555; } [data-color-theme="auto"] .chat-cog-item { color: #ddd; } [data-color-theme="auto"] .chat-cog-item.active { background: rgba(78, 202, 129, 0.15); color: #4eca81; } } /* ========================================================================== Responsive ========================================================================== */ @media (max-width: 480px) { /* Prevent horizontal scroll when chat is open */ html, body { overflow-x: hidden; } /* Default compact: bottom sheet with clear separation */ .chat-panel { bottom: 0; left: 0; right: 0; width: 100%; max-width: 100%; max-height: 50vh; border-radius: 12px 12px 0 0; box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25); overflow: hidden; box-sizing: border-box; } .chat-toggle-btn { bottom: 5rem; right: 1rem; } .chat-messages { max-height: 160px; } /* Hide desktop-only cog items on mobile */ .chat-cog-item[data-mode="chat-half"], .chat-cog-item[data-mode="chat-float"], .chat-cog-item[data-mode="chat-full"] { display: none; } /* Mobile split: CV on top, chat on bottom half */ .chat-panel.chat-split { bottom: 0; left: 0; right: 0; top: auto; width: 100%; max-width: 100%; height: 50vh; max-height: 50vh; border-radius: 12px 12px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.3); border-top: 2px solid var(--accent-green, #27ae60); } .chat-panel.chat-split .chat-messages { max-height: none; flex: 1; } /* Force compact on mobile for desktop-only modes (safety) */ .chat-panel.chat-half, .chat-panel.chat-float, .chat-panel.chat-full { bottom: 0; left: 0; right: 0; top: auto; width: 100%; max-width: 100%; height: auto; max-height: 50vh; border-radius: 12px 12px 0 0; border: none; resize: none; box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25); } /* Wave position follows mobile button */ .chat-wave { bottom: calc(5rem + 38px); right: calc(1rem + 38px); } /* Tighter header on mobile */ .chat-header { padding: 8px 10px; font-size: 0.8rem; } .chat-mode-btn { font-size: 0.85rem; padding: 3px; } /* Cog menu on mobile */ .chat-cog-menu { right: -8px; min-width: 120px; } /* Prevent any child from expanding beyond panel */ .chat-msg { max-width: calc(100% - 44px); } .chat-suggestions { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; } }