--- ## 5. `public/style.css` (Frontend Styling) css /** * AI Chatbot - Professional Styling * Modern, responsive design with smooth animations */ /* ========================================================================== */ /* RESET & BASE STYLES */ /* ========================================================================== */ * { margin: 0; padding: 0; box-sizing: border-box; } html, body { height: 100%; width: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); overflow: hidden; } /* ========================================================================== */ /* CHATBOT CONTAINER */ /* ========================================================================== */ .chatbot-container { display: flex; flex-direction: column; height: 100vh; background: #ffffff; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); max-width: 1200px; margin: 0 auto; position: relative; } /* ========================================================================== */ /* HEADER */ /* ========================================================================== */ .chatbot-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 20px 30px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); } .header-content { display: flex; justify-content: space-between; align-items: center; max-width: 100%; } .header-title h1 { font-size: 28px; font-weight: 700; margin-bottom: 4px; } .header-title p { font-size: 12px; opacity: 0.9; font-weight: 500; } .header-status { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.1); padding: 8px 16px; border-radius: 20px; font-size: 12px; font-weight: 600; } .status-indicator { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; animation: pulse 2s infinite; } .status-indicator.active { box-shadow: 0 0 8px rgba(74, 222, 128, 0.5); } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } /* ========================================================================== */ /* CHAT AREA */ /* ========================================================================== */ .chat-area { flex: 1; overflow-y: auto; padding: 30px; background: linear-gradient(to bottom, #f8f9fa, #ffffff); display: flex; flex-direction: column; gap: 20px; } .messages-container { display: flex; flex-direction: column; gap: 20px; } /* ========================================================================== */ /* MESSAGE STYLES */ /* ========================================================================== */ .message-group { display: flex; animation: slideIn 0.3s ease-out; } @keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } .message { max-width: 70%; word-wrap: break-word; border-radius: 16px; padding: 14px 18px; font-size: 14px; line-height: 1.5; animation: fadeIn 0.3s ease-out; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } /* User Message */ .user-message { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; margin-left: auto; border-bottom-right-radius: 4px; box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3); } .user-message .message-content { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; } .user-message .message-text { flex: 1; } .user-message .replay-btn { display: none; } /* Bot Message */ .bot-message { background: #f0f0f0; color: #333; margin-right: auto; border-bottom-left-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); border: 1px solid #e0e0e0; } .bot-message .message-content { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; } .bot-message .message-text { flex: 1; } .bot-message ul { margin: 10px 0 0 20px; padding-left: 10px; } .bot-message li { margin: 4px 0; } /* Message Controls */ .message-controls { display: flex; gap: 6px; } .replay-btn { background: none; border: none; color: #667eea; cursor: pointer; padding: 4px; border-radius: 4px; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; } .replay-btn:hover { background: rgba(102, 126, 234, 0.1); color: #764ba2; } .bot-message .replay-btn { display: flex; color: #666; } /* Welcome Message */ .welcome-message .message { max-width: 100%; background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%); border: 2px solid #667eea; color: #333; } /* ========================================================================== */ /* IMAGES GALLERY */ /* ========================================================================== */ .images-gallery { margin-top: 20px; padding: 20px; background: #f8f9fa; border-radius: 12px; border: 1px solid #e0e0e0; } .images-gallery h3 { font-size: 16px; font-weight: 600; margin-bottom: 15px; color: #333; } .images-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; } .image-item { position: relative; border-radius: 8px; overflow: hidden; background: white; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); transition: transform 0.2s ease, box-shadow 0.2s ease; } .image-item:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15); } .image-item img { width: 100%; height: 200px; object-fit: cover; display: block; } .image-caption { padding: 10px; font-size: 12px; color: #666; background: white; max-height: 60px; overflow: hidden; text-overflow: ellipsis; } .download-btn { position: absolute; top: 10px; right: 10px; background: rgba(102, 126, 234, 0.9); color: white; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; opacity: 0; transition: opacity 0.2s ease, background 0.2s ease; } .image-item:hover .download-btn { opacity: 1; } .download-btn:hover { background: rgba(102, 126, 234, 1); } /* ========================================================================== */ /* INPUT AREA */ /* ========================================================================== */ .input-area { padding: 20px 30px; background: white; border-top: 1px solid #e0e0e0; box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05); } .input-wrapper { display: flex; gap: 10px; align-items: center; background: #f5f5f5; border: 2px solid #e0e0e0; border-radius: 24px; padding: 8px 12px; transition: all 0.3s ease; } .input-wrapper:focus-within { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); } .message-input { flex: 1; border: none; background: transparent; outline: none; font-size: 14px; padding: 8px 12px; color: #333; } .message-input::placeholder { color: #999; } .control-btn { background: none; border: none; color: #667eea; cursor: pointer; padding: 8px; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; min-width: 40px; height: 40px; } .control-btn:hover { background: rgba(102, 126, 234, 0.1); color: #764ba2; } .control-btn:active { transform: scale(0.95); } .voice-btn.listening { background: rgba(239, 68, 68, 0.1); color: #ef4444; animation: pulse 1s infinite; } .send-btn { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 50%; width: 40px; height: 40px; padding: 0; } .send-btn:hover { background: linear-gradient(135deg, #764ba2 0%, #667eea 100%); box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3); } /* ========================================================================== */ /* TRANSCRIPTION DISPLAY */ /* ========================================================================== */ .transcription-display { display: flex; justify-content: space-between; align-items: center; background: #f0f7ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 10px 15px; margin-top: 10px; font-size: 13px; color: #1e40af; } #transcriptionText { flex: 1; font-style: italic; } .clear-btn { background: none; border: none; color: #1e40af; cursor: pointer; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 4px; transition: all 0.2s ease; } .clear-btn:hover { background: rgba(30, 64, 175, 0.1); } /* ========================================================================== */ /* VOICE STATUS */ /* ========================================================================== */ .voice-status { display: flex; align-items: center; gap: 10px; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 8px; padding: 10px 15px; margin-top: 10px; font-size: 13px; color: #92400e; } .listening-indicator { display: flex; gap: 4px; align-items: flex-end; height: 16px; } .listening-indicator span { width: 3px; background: #f59e0b; border-radius: 2px; animation: bounce 0.6s infinite; } .listening-indicator span:nth-child(1) { animation-delay: 0s; } .listening-indicator span:nth-child(2) { animation-delay: 0.2s; } .listening-indicator span:nth-child(3) { animation-delay: 0.4s; } @keyframes bounce { 0%, 100% { height: 4px; } 50% { height: 16px; } } /* ========================================================================== */ /* LOADING SPINNER */ /* ========================================================================== */ .loading-spinner { position: fixed; bottom: 30px; right: 30px; background: white; border-radius: 12px; padding: 20px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 1000; } .spinner { width: 40px; height: 40px; border: 4px solid #e0e0e0; border-top-color: #667eea; border-radius: 50%; animation: spin 0.8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } .loading-spinner p { font-size: 13px; color: #666; font-weight: 500; } /* ========================================================================== */ /* TOAST NOTIFICATION */ /* ========================================================================== */ .toast { position: fixed; bottom: 20px; left: 20px; background: #333; color: white; padding: 14px 20px; border-radius: 8px; font-size: 13px; opacity: 0; transform const Component = App; const root = ReactDOM.createRoot(document.getElementById('root')); root.render();