* { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Inter', sans-serif; background-color: #f3f4f6; /* bg-gray-100 */ display: flex; justify-content: center; align-items: center; min-height: 100vh; overflow: hidden; -webkit-font-smoothing: antialiased; /* Font lebih halus di WebKit browsers */ -moz-osx-font-smoothing: grayscale; /* Font lebih halus di Firefox macOS */ } .app-container { display: flex; width: 100%; height: 100dvh; /* Gunakan dynamic viewport height untuk iOS */ max-width: 1440px; /* Sedikit lebih besar untuk layar lebar */ background-color: #ffffff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); /* Shadow lebih lembut */ overflow: hidden; } /* Sidebar */ .sidebar { width: 80%; /* Lebar relatif untuk responsivitas */ max-width: 300px; /* Batas maksimum agar tidak terlalu lebar */ background: linear-gradient(180deg, #1e293b 0%, #111827 100%); color: #d1d5db; display: flex; flex-direction: column; padding: 1.5rem; position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-100%); transition: transform 0.3s ease-in-out; /* Transisi lebih halus */ z-index: 40; border-top-right-radius: 12px; border-bottom-right-radius: 12px; box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3); /* Shadow untuk kontras */ overflow-y: auto; } .sidebar.open { transform: translateX(0); } .sidebar-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 1rem; border-bottom: 1px solid #374151; margin-bottom: 1rem; } .sidebar h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; /* Tipografi lebih modern */ } .sidebar-close-btn { background: none; border: none; color: #9ca3af; cursor: pointer; padding: 0.5rem; border-radius: 50%; /* Bentuk lingkaran */ transition: color 0.2s ease, background-color 0.2s ease; display: flex; align-items: center; justify-content: center; width: 2rem; /* Ukuran tetap */ height: 2rem; } .sidebar-close-btn:hover { color: #ffffff; background-color: rgba(255, 255, 255, 0.1); } .sidebar-close-btn .icon { width: 1rem; height: 1rem; stroke-width: 2; } .new-chat-btn { width: 100%; background: linear-gradient(90deg, #6b46c1 0%, #8e44ad 100%); color: white; font-weight: 500; padding: 0.75rem; border-radius: 8px; border: none; cursor: pointer; margin-bottom: 1rem; font-size: 0.95rem; /* Ukuran font lebih kecil */ transition: transform 0.2s ease, box-shadow 0.2s ease; text-align: center; white-space: nowrap; /* Hindari patah baris */ overflow: hidden; text-overflow: ellipsis; /* Potong teks jika terlalu panjang */ } .new-chat-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); } .chat-history-list { flex-grow: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #6b7280 #1f2937; padding-right: 0.5rem; /* Ruang untuk scrollbar */ } .chat-history-list::-webkit-scrollbar { width: 6px; } .chat-history-list::-webkit-scrollbar-track { background: #1f2937; border-radius: 10px; } .chat-history-list::-webkit-scrollbar-thumb { background: #6b7280; border-radius: 10px; } .chat-history-item button { width: 100%; text-align: left; padding: 0.5rem 0.75rem; margin-bottom: 0.25rem; border-radius: 6px; background: none; border: none; color: #d1d5db; cursor: pointer; font-size: 0.875rem; transition: background-color 0.2s ease, color 0.2s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .chat-history-item button:hover { background-color: #374151; color: #ffffff; } .chat-history-item button.active { background-color: #6b46c1; color: #ffffff; } /* Responsivitas untuk semua perangkat mobile */ @media (max-width: 768px) { .sidebar { width: 80%; max-width: 280px; min-width: 220px; padding: 1rem; } .sidebar h2 { font-size: 1.1rem; } .new-chat-btn { font-size: 0.9rem; padding: 0.6rem; } .chat-history-item button { font-size: 0.8rem; padding: 0.4rem 0.6rem; } } @media (max-width: 480px) { .sidebar { width: 85%; max-width: 250px; min-width: 200px; padding: 0.75rem; } .sidebar h2 { font-size: 1rem; } .new-chat-btn { font-size: 0.85rem; padding: 0.5rem; } .chat-history-item button { font-size: 0.75rem; padding: 0.35rem 0.5rem; } .sidebar-close-btn { width: 1.75rem; height: 1.75rem; padding: 0.4rem; } .sidebar-close-btn .icon { width: 0.9rem; height: 0.9rem; } } @media (max-width: 360px) { .sidebar { width: 90%; max-width: 220px; min-width: 180px; padding: 0.5rem; } .sidebar h2 { font-size: 0.9rem; max-width: 70%; } .new-chat-btn { font-size: 0.8rem; padding: 0.45rem; } .chat-history-item button { font-size: 0.7rem; padding: 0.3rem 0.45rem; } .sidebar-close-btn { width: 1.5rem; height: 1.5rem; padding: 0.3rem; } .sidebar-close-btn .icon { width: 0.8rem; height: 0.8rem; } } /* Main Chat Area */ .chat-main { flex-grow: 1; display: flex; flex-direction: column; background-color: #ffffff; position: relative; min-height: 0; } .mobile-sidebar-toggle { display: block; /* Ditampilkan hanya di mobile */ position: fixed; /* Tetap di sudut kiri atas */ top: 1rem; /* Jarak dari atas */ left: 1rem; /* Jarak dari kiri */ background: linear-gradient(135deg, #6b46c1 0%, #8e44ad 100%); /* Gradien lebih dinamis */ color: white; padding: 0.75rem; /* Padding lebih nyaman */ border-radius: 50%; /* Bentuk lingkaran untuk estetika */ border: 2px solid rgba(255, 255, 255, 0.2); /* Batas tipis untuk kontras */ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Shadow untuk kedalaman */ cursor: pointer; z-index: 30; /* Pastikan di atas konten lain */ transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease; /* Transisi halus */ overflow: hidden; } .mobile-sidebar-toggle .icon { width: 1.25rem; /* Ukuran ikon lebih proporsional */ height: 1.25rem; stroke-width: 2; stroke: currentColor; /* Warna ikon mengikuti teks */ transition: transform 0.3s ease; /* Animasi kecil saat hover */ } /* Efek hover */ .mobile-sidebar-toggle:hover { transform: translateY(-2px) rotate(5deg); /* Geser ke atas dan sedikit rotasi */ box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); /* Shadow lebih kuat */ background: linear-gradient(135deg, #5a38a3 0%, #7d3a9e 100%); /* Gradien lebih gelap */ } .mobile-sidebar-toggle:hover .icon { transform: scale(1.1); /* Ikon sedikit membesar */ } /* Efek aktif (saat diklik) */ .mobile-sidebar-toggle:active { transform: translateY(0) rotate(0deg); /* Kembali ke posisi awal */ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); background: linear-gradient(135deg, #4f2e8a 0%, #6b2e8a 100%); /* Gradien lebih tua */ } /* Responsivitas */ @media (max-width: 480px) { .mobile-sidebar-toggle { top: 0.75rem; /* Kurangi jarak pada layar kecil */ left: 0.75rem; padding: 0.6rem; /* Kurangi padding */ } .mobile-sidebar-toggle .icon { width: 1rem; height: 1rem; } } @media (max-width: 360px) { .mobile-sidebar-toggle { top: 0.5rem; left: 0.5rem; padding: 0.5rem; } .mobile-sidebar-toggle .icon { width: 0.9rem; height: 0.9rem; } } .chat-messages { flex-grow: 1; padding: 1.5rem; overflow-y: auto; background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%); scrollbar-width: thin; scrollbar-color: #6b7280 #f3f4f6; padding-top: 4rem; /* Ruang untuk toggle di mobile */ padding-bottom: 4rem; margin-bottom: 0; } .chat-messages::-webkit-scrollbar { width: 6px; } .chat-messages::-webkit-scrollbar-track { background: #f3f4f6; border-radius: 10px; } .chat-messages::-webkit-scrollbar-thumb { background: #6b7280; border-radius: 10px; } .chat-messages::-webkit-scrollbar-thumb:hover { background: #4b5563; } .chat-welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #6b7280; text-align: center; } .chat-welcome h1 { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; color: #1f2937; } .chat-welcome p { font-size: 1.125rem; margin-bottom: 1.5rem; } .chat-welcome svg { width: 3.5rem; height: 3.5rem; margin-bottom: 1rem; color: #4f46e5; } .chat-welcome-btn { background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%); color: white; font-weight: 500; padding: 0.75rem 1.5rem; border-radius: 8px; border: none; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; } .chat-welcome-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); } /* Messages */ .message-container { display: flex; flex-direction: column; margin-bottom: 1rem; } .message-container.user { align-items: flex-end; } .message-container.ai { align-items: flex-start; } .message-bubble { max-width: 80%; padding: 0.75rem 1rem; border-radius: 12px; word-wrap: break-word; transition: transform 0.2s ease; } .message-container.user .message-bubble { background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%); color: white; border-bottom-right-radius: 4px; } .message-container.ai .message-bubble { background-color: #ffffff; color: #1f2937; border-bottom-left-radius: 4px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } .message-image { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid #e5e7eb; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); } .message-image + p { font-size: 0.75rem; color: #6b7280; font-style: italic; margin-top: 0.25rem; text-align: right; } .message-timestamp { font-size: 0.75rem; color: #6b7280; margin-top: 0.25rem; } /* Loading Indicator */ .loading-indicator { display: flex; justify-content: center; margin: 1rem 0; } .loading-dots { display: flex; gap: 0.5rem; } .loading-dot { width: 10px; height: 10px; background-color: #4f46e5; border-radius: 50%; animation: bounce-slow 1.2s infinite ease-in-out; } .loading-dot:nth-child(2) { animation-delay: 0.3s; } .loading-dot:nth-child(3) { animation-delay: 0.6s; } @keyframes bounce-slow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } } /* Chat Input Area */ .chat-input-area { padding: 1rem; bottom: 0; left: 0; right: 0; background-color: #f3f4f6; flex-shrink: 0; display: flex; width: 100%; align-items: center; position: fixed; z-index: 10; border-top: 1px solid #e5e7eb; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05); } .chat-input-wrapper { display: flex; gap: 0.75rem; flex-grow: 1; align-items: center; max-width: 100%; background-color: #ffffff; /* Latar putih untuk kontras */ border-radius: 8px; padding: 0.25rem; /* Padding kecil di sekitar wrapper */ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); } .chat-textarea { flex-grow: 1; resize: none; padding: 0.75rem; border: 1px solid #d1d5db; border-radius: 8px; font-size: 1rem; line-height: 1.5; max-height: 120px; overflow-y: auto; margin-bottom: 0; scrollbar-width: thin; scrollbar-color: #6b7280 #e5e7eb; transition: border-color 0.2s ease, box-shadow 0.2s ease; } .chat-textarea:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); } .chat-textarea::-webkit-scrollbar { width: 6px; } .chat-textarea::-webkit-scrollbar-track { background: #e5e7eb; border-radius: 8px; } .chat-textarea::-webkit-scrollbar-thumb { background: #6b7280; border-radius: 8px; } .chat-textarea::-webkit-scrollbar-thumb:hover { background: #4b5563; } .send-btn { background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%); color: white; width: 30px; padding: 0.75rem; border-radius: 8px; border: none; cursor: pointer; margin-bottom: 0; flex-shrink: 0; transition: transform 0.2s ease, box-shadow 0.2s ease; } .send-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); } .send-btn:disabled { opacity: 0.5; cursor: not-allowed; } /* Loading Animation */ #loading-wrapper { position: fixed; background: #111827; width: 100%; height: 100%; z-index: 9999; display: flex; align-items: center; justify-content: center; } #loading-text { position: absolute; color: #d1d5db; font-size: 1.25rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; } #loading-content { width: 90px; height: 90px; border: 3px solid transparent; border-top-color: #4f46e5; border-bottom-color: #4f46e5; border-radius: 50%; animation: loader 1.5s linear infinite; } #loading-content:before, #loading-content:after { content: ''; position: absolute; border-radius: 50%; border: 3px solid transparent; } #loading-content:before { border-top-color: #7c3aed; border-bottom-color: #7c3aed; top: 5px; left: 5px; right: 5px; bottom: 5px; animation: loader 2s linear infinite; } #loading-content:after { border-top-color: #a5b4fc; border-bottom-color: #a5b4fc; top: 15px; left: 15px; right: 15px; bottom: 15px; animation: loader 1s linear infinite; } @keyframes loader { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* Media Queries untuk Responsivitas */ @media (min-width: 768px) { .app-container { border-radius: 12px; } .sidebar { position: static; transform: translateX(0); } .sidebar-close-btn, .mobile-sidebar-toggle { display: none; } .chat-messages { padding-top: 1.5rem; } } @media (max-width: 767px) { .sidebar { width: 80%; max-width: 300px; z-index: 50; } .chat-main { padding-top: 4rem; } } @media (max-width: 480px) { .chat-textarea { font-size: 0.875rem; padding: 0.5rem; } .send-btn { padding: 0.5rem; } .chat-welcome h1 { font-size: 1.5rem; } .chat-welcome p { font-size: 1rem; } .message-bubble { max-width: 90%; } } /* Optimasi untuk layar kecil */ @media (max-width: 360px) { .sidebar { width: 100%; max-width: none; } .chat-input-wrapper { gap: 0.5rem; } .chat-textarea { font-size: 0.75rem; } .send-btn { padding: 0.5rem; } }