:root {
    --bg-app: #09090b;
    --bg-sidebar: #0c0c0e;
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary-gradient: linear-gradient(135deg, #6366f1, #a855f7);
    --accent: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --surface-card: #1e1e24;
    --surface-hover: #27272a;
    --sidebar-width: 280px;
    --radius-lg: 16px;
}

body {
    background-color: var(--bg-app);
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    height: 100vh;
    overflow: hidden;
}

.app-layout { display: flex; height: 100%; width: 100%; }

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    transition: transform 0.3s ease;
    z-index: 50;
}

.sidebar-header { margin-bottom: 2rem; }

.logo-area { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }

/* LOGO SIDEBAR (Kiri Atas) */
.logo-icon-sidebar {
    width: 42px; height: 42px; /* Ukuran pas di sidebar */
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.logo-icon-sidebar img { width: 100%; height: 100%; object-fit: cover; }

.logo-text { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.5px; }
.pro-badge { font-size: 0.6rem; background: #fbbf24; color: #000; padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }

.btn-new-chat {
    width: 100%; padding: 12px; background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border); color: white; border-radius: var(--radius-lg);
    display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; transition: all 0.2s;
}
.btn-new-chat:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255,255,255,0.2); }

.history-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin: 20px 0 10px; font-weight: 600; }
.history-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }

.history-item {
    padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--text-muted);
    font-size: 0.9rem; display: flex; justify-content: space-between; align-items: center;
    transition: all 0.2s; border: 1px solid transparent;
}
.history-item:hover { background: rgba(255, 255, 255, 0.03); color: white; }
.history-item.active { background: rgba(139, 92, 246, 0.15); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.3); }
.history-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.history-actions { display: none; gap: 4px; }
.history-item:hover .history-actions { display: flex; }
.action-btn { background: transparent; border: none; color: inherit; padding: 4px; border-radius: 4px; cursor: pointer; }
.action-btn:hover { background: rgba(255,255,255,0.1); color: white; }

.sidebar-footer { margin-top: auto; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 10px; background: rgba(255,255,255,0.03); border-radius: 12px; }
.user-avatar img { width: 36px; height: 36px; border-radius: 50%; }
.user-info { display: flex; flex-direction: column; }
.username { font-size: 0.9rem; font-weight: 600; }
.status { font-size: 0.7rem; color: #fbbf24; }

/* MAIN CONTENT */
.main-content { flex: 1; display: flex; flex-direction: column; position: relative; }
.top-bar { padding: 15px 24px; display: flex; align-items: center; justify-content: space-between; }
#currentChatTitle { font-weight: 600; font-size: 1rem; }
.model-badge { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.model-badge::before { content: ''; width: 6px; height: 6px; background: #22c55e; border-radius: 50%; }

.chat-area { flex: 1; padding: 2rem; overflow-y: auto; display: flex; flex-direction: column; gap: 24px; max-width: 900px; margin: 0 auto; width: 100%; scroll-behavior: smooth; }

/* WELCOME SCREEN */
.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: white; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* LOGO BESAR (WELCOME SCREEN) */
.empty-icon-large {
    width: 120px; height: 120px; /* Diperbesar jadi 120px */
    margin-bottom: 2rem;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.4); /* Glow lebih kuat */
    transition: transform 0.3s;
}
.empty-icon-large:hover { transform: scale(1.05); }
.empty-icon-large img { width: 100%; height: 100%; object-fit: cover; }

.empty-state h2 { margin-bottom: 2rem; font-weight: 600; font-size: 1.5rem; }
.suggestion-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: 100%; max-width: 600px; }
.suggestion-card {
    background: var(--surface-card); border: 1px solid var(--glass-border); padding: 16px; border-radius: var(--radius-lg);
    text-align: left; cursor: pointer; transition: all 0.2s; color: var(--text-muted); display: flex; align-items: center; gap: 12px;
}
.suggestion-card i { font-size: 1.2rem; color: var(--accent); }
.suggestion-card:hover { border-color: var(--accent); background: var(--surface-hover); transform: translateY(-2px); color: white; }

/* MESSAGES */
.message { display: flex; gap: 16px; animation: slideUp 0.3s ease-out forwards; opacity: 0; }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.avatar-img { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; overflow: hidden; }
.user-msg .avatar-img { background: #333; color: white; }

/* AVATAR BOT (Chat) - Tetap SVG (Sesuai request sebelumnya) */
.bot-msg .avatar-img { background: transparent; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2); }
.bot-msg .avatar-img svg { width: 100%; height: 100%; object-fit: cover; }

.msg-bubble { padding-top: 6px; line-height: 1.6; font-size: 1rem; color: #e2e8f0; max-width: 100%; overflow-x: hidden; }
.user-msg { flex-direction: row-reverse; }
.user-msg .msg-bubble { background: var(--surface-card); padding: 12px 18px; border-radius: 18px 4px 18px 18px; border: 1px solid var(--glass-border); }

/* CODE BLOCK */
.code-wrapper { margin: 16px 0; border-radius: 12px; overflow: hidden; background: #1e1e1e; border: 1px solid #333; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.code-header { background: #252526; padding: 8px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #333; }
.window-controls { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.red { background: #ff5f56; } .yellow { background: #ffbd2e; } .green { background: #27c93f; }
.lang-label { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: #aaa; margin-left: 10px; }
.copy-btn { background: transparent; border: none; color: #aaa; font-size: 0.8rem; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.copy-btn:hover { color: white; }
pre { margin: 0; padding: 16px; overflow-x: auto; }
code { font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; color: #d4d4d4; }

/* INPUT */
.input-container { padding: 20px 0; width: 100%; display: flex; flex-direction: column; align-items: center; background: linear-gradient(to top, var(--bg-app) 80%, transparent); }
.glass-panel {
    width: 90%; max-width: 800px;
    background: rgba(30, 30, 35, 0.8); backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border); border-radius: 24px; padding: 8px 8px 8px 20px;
    display: flex; align-items: flex-end; gap: 10px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2); transition: border 0.3s;
}
.glass-panel:focus-within { border-color: var(--accent); }
textarea { flex: 1; background: transparent; border: none; color: white; resize: none; max-height: 150px; outline: none; padding: 12px 0; font-family: inherit; line-height: 1.5; }
.send-btn { width: 44px; height: 44px; border-radius: 16px; background: var(--text-main); color: black; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; transition: transform 0.2s; }
.send-btn:hover { transform: scale(1.05); background: white; }
.disclaimer { font-size: 0.7rem; color: #555; margin-top: 10px; }
.custom-scroll::-webkit-scrollbar { width: 6px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }

/* MOBILE BTN */
.icon-btn-small {
    background: transparent; border: none; color: var(--text-muted);
    font-size: 1.2rem; cursor: pointer; padding: 8px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.icon-btn-small:hover { background: rgba(255, 255, 255, 0.1); color: white; }

/* RESPONSIVE */
.mobile-only { display: none; }
@media (max-width: 768px) {
    .sidebar { position: fixed; height: 100%; transform: translateX(-100%); width: 280px; box-shadow: 20px 0 50px rgba(0,0,0,0.5); }
    .sidebar.open { transform: translateX(0); }
    .mobile-only { display: block; }
    .suggestion-grid { grid-template-columns: 1fr; }
    .glass-panel { width: 95%; }
}