:root {
    /* Color Palette - Dark Clean Aesthetic */
    --bg-color: #121212;
    --header-bg: #181818;
    --chat-bg: #0d0d0d;
    --input-bg: #262626;
    
    --text-primary: #e0e0e0;
    --text-secondary: #888888;
    
    --user-bubble: #2b2b2b;
    --bot-bubble: #181818;
    --border-color: #333;
    
    /* Warna Mode Netral */
    --badge-bg: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--bg-color); color: var(--text-primary); height: 100dvh; overflow: hidden; }

/* Layout */
.main-container { display: flex; flex-direction: column; height: 100%; width: 100%; max-width: 600px; margin: 0 auto; background: var(--chat-bg); position: relative; }

/* Header */
.header { background: var(--header-bg); padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); z-index: 10; }
.header-left { display: flex; align-items: center; gap: 15px; }
.header h2 { font-size: 1.1rem; font-weight: 700; }
.status-indicator { width: 8px; height: 8px; background: #10b981; border-radius: 50%; margin-left: 5px; display: inline-block; box-shadow: 0 0 8px #10b981; }
.btn-icon { background: none; border: none; color: var(--text-primary); font-size: 1.2rem; cursor: pointer; padding: 5px; }

/* Sidebar */
.sidebar { position: fixed; top: 0; left: 0; width: 280px; height: 100%; background: #181818; z-index: 100; transform: translateX(-100%); transition: transform 0.3s; display: flex; flex-direction: column; box-shadow: 5px 0 15px rgba(0,0,0,0.5); }
.sidebar.active { transform: translateX(0); }
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.session-list { flex: 1; overflow-y: auto; padding: 10px; }
.session-item { padding: 14px; margin-bottom: 5px; border-radius: 8px; cursor: pointer; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-item.active { background: #262626; color: white; }

/* Footer Sidebar */
.sidebar-footer { padding: 20px; border-top: 1px solid var(--border-color); text-align: center; }
.btn-danger { width: 100%; padding: 12px; background: #2a1515; color: #ff8888; border: 1px solid #522; border-radius: 8px; margin-bottom: 15px; cursor: pointer; }
.dev-info p { font-size: 0.8rem; color: #666; margin-bottom: 5px; }
.dev-info a { color: var(--text-secondary); text-decoration: none; font-weight: 500; font-size: 0.85rem; transition: color 0.2s; }
.dev-info a:hover { color: white; }
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 90; display: none; }
.overlay.active { display: block; }

/* Chat Area */
.chat-box { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; scroll-behavior: smooth; }
.welcome-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 70%; text-align: center; color: var(--text-secondary); }
.glow-text { 
    font-size: 3.5rem; font-weight: 800; margin-bottom: 10px; color: #fff; 
    text-shadow: 0 0 15px rgba(255,255,255,0.1), 0 0 30px rgba(255,255,255,0.05); 
    animation: smoothFloat 4s ease-in-out infinite;
}
@keyframes smoothFloat {
    0%, 100% { transform: translateY(0); opacity: 0.9; }
    50% { transform: translateY(-10px); opacity: 1; text-shadow: 0 0 20px rgba(255,255,255,0.2); }
}

/* Bubbles */
.message { display: flex; flex-direction: column; max-width: 85%; }
.user-message { align-self: flex-end; align-items: flex-end; }
.bot-message { align-self: flex-start; align-items: flex-start; }
.bubble { padding: 12px 16px; border-radius: 18px; position: relative; line-height: 1.5; font-size: 0.95rem; word-wrap: break-word; }
.user-message .bubble { background: var(--user-bubble); color: white; border-bottom-right-radius: 4px; }
.bot-message .bubble { background: var(--bot-bubble); color: var(--text-primary); border-bottom-left-radius: 4px; border: 1px solid #222; }
.img-attachment { width: 100%; max-width: 250px; border-radius: 12px; margin-bottom: 8px; border: 1px solid #333; }

/* COPY & SHARE BUTTONS */
.msg-actions { display: flex; align-items: center; gap: 15px; margin-top: 6px; margin-left: 8px; opacity: 0.6; transition: opacity 0.2s; }
.msg-actions:hover { opacity: 1; }
.action-btn { background: none; border: none; color: var(--text-secondary); font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; gap: 5px; padding: 4px; transition: color 0.2s, transform 0.1s; }
.action-btn:hover { color: white; }
.action-btn:active { transform: scale(0.9); }
.action-label { font-size: 0.75rem; font-weight: 500; }

/* Input Area */
.input-area {
    padding: 10px 15px; background: var(--header-bg); border-top: 1px solid var(--border-color);
    display: flex; align-items: center; gap: 12px; padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.btn-upload-icon {
    background: transparent; color: var(--text-secondary); border: none;
    width: 32px; height: 32px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; flex-shrink: 0; transition: color 0.2s;
}
.btn-upload-icon:hover { color: white; }

.input-wrapper {
    flex: 1; background: var(--input-bg); border-radius: 24px;
    display: flex; align-items: center; padding-right: 8px; min-width: 0;
}
textarea {
    flex: 1; background: transparent; color: white; border: none; padding: 12px 15px;
    resize: none; outline: none; max-height: 120px; font-size: 0.95rem;
}
.mode-badge {
    padding: 6px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
    cursor: pointer; margin-right: 2px; transition: all 0.3s ease;
    background: var(--badge-bg); color: var(--text-secondary); border: 1px solid transparent;
}
.mode-pro { border-color: #666; color: #fff; }
.mode-fast { border-color: #666; color: #fff; }

.btn-send {
    background: none; border: none; color: white; font-size: 1.3rem; 
    padding: 0 5px; cursor: pointer; flex-shrink: 0;
}
.btn-send:disabled { color: #444; }

/* Utilities */
.hidden { display: none !important; }
.image-preview { padding: 10px; background: var(--header-bg); border-top: 1px solid var(--border-color); }
#imagePreview { height: 80px; border-radius: 8px; border: 1px solid #444; display: block; }
.btn-close-img { position: absolute; top: -8px; right: -8px; background: #333; color: white; width: 24px; height: 24px; border-radius: 50%; border: 1px solid #555; cursor: pointer; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
