:root { --bg: #121212; --chat-bg: #1e1e1e; --user-msg-bg: #2a2a2a; --bot-msg-bg: #8b5cf6; --text-color: #e0e0e0; --bot-text-color: #ffffff; --input-bg: #2c2c2c; --input-border: #383838; --accent-color: #8b5cf6; --yellow-color: #facc15; --code-bg: #2c2c2c; --code-border: #444444; --shadow: rgba(0, 0, 0, 0.4); --border-radius: 12px; --transition-duration: 0.2s; } * { box-sizing: border-box; font-family: 'Tajawal', sans-serif; } body { margin: 0; padding: 0; background: var(--bg); color: var(--text-color); display: flex; height: 100vh; overflow: hidden; transition: margin-right 0.3s ease-in-out; } .sidebar-menu { position: fixed; top: 0; right: -300px; /* مخفية في البداية */ width: 280px; height: 100%; background: var(--chat-bg); box-shadow: -2px 0 15px var(--shadow); transition: right 0.3s ease-in-out; padding: 20px; display: flex; flex-direction: column; z-index: 1000; } .sidebar-menu.open { right: 0; } .chat-list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; } .chat-list-header h2 { margin: 0; color: var(--yellow-color); font-size: 1.5rem; } .close-sidebar-btn { background: none; border: none; color: var(--text-color); font-size: 2rem; cursor: pointer; } .chat-list { flex-grow: 1; overflow-y: auto; } .chat-item { display: block; background: var(--user-msg-bg); color: var(--text-color); padding: 10px; border-radius: 8px; margin-bottom: 10px; cursor: pointer; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .chat-item:hover { background: #444; } .main-content { flex-grow: 1; display: flex; flex-direction: column; position: relative; } .header { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; background: var(--chat-bg); border-bottom: 1px solid var(--input-border); } .header .chat-actions { display: flex; gap: 10px; } .chat-actions button, .menu-toggle-btn { background: var(--user-msg-bg); color: var(--text-color); border: none; padding: 10px 15px; border-radius: var(--border-radius); cursor: pointer; font-size: 1rem; transition: background-color var(--transition-duration); } .chat-actions button:hover, .menu-toggle-btn:hover { background: #444; } .chat-container { flex-grow: 1; padding: 20px; overflow-y: auto; scroll-behavior: smooth; } .message { display: flex; margin-bottom: 20px; max-width: 85%; word-wrap: break-word; animation: fadeIn 0.3s ease-in-out; } .message.user { margin-left: auto; flex-direction: row-reverse; } .message.bot { margin-right: auto; flex-direction: row; } .message-bubble { padding: 14px; border-radius: var(--border-radius); font-size: 1rem; line-height: 1.6; } .message.user .message-bubble { background: var(--user-msg-bg); border-bottom-left-radius: 0; } .message.bot .message-bubble { background: var(--bot-msg-bg); color: var(--bot-text-color); border-bottom-right-radius: 0; text-align: right; } .message-bubble img, .message-bubble video { max-width: 100%; height: auto; border-radius: var(--border-radius); margin-top: 10px; } .input-area { display: flex; padding: 10px 20px; border-top: 1px solid var(--input-border); background: var(--chat-bg); align-items: center; } #message-input { flex-grow: 1; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: var(--border-radius); padding: 12px 18px; color: var(--text-color); font-size: 1rem; outline: none; transition: border-color var(--transition-duration); margin-left: 10px; } #message-input:focus { border-color: var(--accent-color); } #send-btn { background: var(--accent-color); color: white; border: none; border-radius: var(--border-radius); padding: 12px 20px; font-size: 1rem; cursor: pointer; transition: transform var(--transition-duration), opacity var(--transition-duration); font-weight: 700; } #send-btn:hover { transform: scale(1.05); opacity: 0.9; } #send-btn:disabled { background: #444; cursor: not-allowed; } .file-upload-btn { position: relative; background: var(--user-msg-bg); color: var(--text-color); border: none; padding: 12px 15px; border-radius: var(--border-radius); cursor: pointer; margin-right: 10px; } .file-upload-btn input[type="file"] { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; } .typing-indicator { display: none; text-align: right; padding: 10px; color: var(--muted); font-style: italic; } /* تنسيقات خاصة للمحتوى من الـ API */ .message-bubble p { margin: 0 0 10px 0; } .message-bubble p:last-child { margin-bottom: 0; } .message-bubble ul, .message-bubble ol { margin-top: 0; padding-right: 20px; } .message-bubble ul li, .message-bubble ol li { margin-bottom: 5px; } .code-block { background-color: var(--code-bg); padding: 15px; border-radius: 8px; direction: ltr; text-align: left; margin-top: 10px; overflow-x: auto; white-space: pre-wrap; font-family: 'Courier New', Courier, monospace; border: 1px solid var(--code-border); } .code-block pre { margin: 0; } .search-results-section { margin-top: 15px; } .search-results-section h3 { margin-bottom: 10px; color: var(--yellow-color); font-size: 1.2rem; border-bottom: 2px solid var(--accent-color); padding-bottom: 5px; } .search-results-section ul { list-style: none; padding: 0; } .search-results-section li { background: #2c2c2c; border-radius: 8px; padding: 10px; margin-bottom: 10px; } .search-results-section a { color: var(--bot-text-color); text-decoration: none; font-weight: bold; display: block; } .search-results-section a:hover { text-decoration: underline; } @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }