/* Reset Dasar & Variabel Tema Neon (Dark Mode) */
:root {
    --bg-dark: #0a0a0f; /* Hitam sangat tua */
    --bg-panel: #14141c; /* Panel abu-abu gelap */
    --neon-cyan: #00f3ff;
    --neon-magenta: #ff00ff;
    --neon-green: #39ff14;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --chat-user-bg: #1a1a2e; /* Latar bubble user (agak keunguan) */
    --chat-ai-bg: #162129;   /* Latar bubble AI (agak kebiruan) */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden; /* Mencegah scroll pada body */
}

/* Container Utama Chat */
.chat-container {
    width: 100%;
    max-width: 800px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
    position: relative;
}

/* Responsivitas untuk laptop / desktop */
@media (min-width: 801px) {
    .chat-container {
        height: 95vh;
        border-radius: 12px;
        border: 1px solid rgba(0, 243, 255, 0.2);
        box-shadow: 0 0 30px rgba(0, 243, 255, 0.05); /* Glow yang elegan */
    }
}

/* Header */
.app-header {
    padding: 20px;
    text-align: center;
    background-color: var(--bg-panel);
    border-bottom: 1px solid rgba(0, 243, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--neon-cyan);
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.6), 0 0 20px rgba(0, 243, 255, 0.4);
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* Area Daftar Percakapan */
.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

/* Kustomisasi Scrollbar Webkit */
.chat-box::-webkit-scrollbar {
    width: 6px;
}
.chat-box::-webkit-scrollbar-track {
    background: transparent;
}
.chat-box::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.3);
    border-radius: 3px;
}
.chat-box::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 243, 255, 0.6);
}

/* Bubble Pesan (Umum) */
.message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 12px;
    line-height: 1.6;
    font-size: 15px;
    animation: fadeIn 0.3s ease-in-out;
}

/* Animasi Fade In */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Bubble Pesan User */
.message.user {
    align-self: flex-end;
    background-color: var(--chat-user-bg);
    border: 1px solid rgba(255, 0, 255, 0.3); /* Border magenta */
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(255, 0, 255, 0.1);
}

/* Bubble Pesan AI */
.message.ai {
    align-self: flex-start;
    background-color: var(--chat-ai-bg);
    border: 1px solid rgba(0, 243, 255, 0.3); /* Border cyan */
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 243, 255, 0.1);
}

/* Styling Elemen dalam Pesan (Hasil Parse Markdown) */
.message p {
    margin-bottom: 12px;
}
.message p:last-child {
    margin-bottom: 0;
}
.message ul, .message ol {
    margin-left: 20px;
    margin-bottom: 12px;
}
.message li {
    margin-bottom: 6px;
}
/* Aksen Bold dalam teks AI menggunakan Cyan */
.message.ai strong {
    color: var(--neon-cyan);
    font-weight: 600;
}
/* Aksen Bold dalam teks User menggunakan Magenta */
.message.user strong {
    color: var(--neon-magenta);
    font-weight: 600;
}

/* Indikator Mengetik (Typing Indicator) */
.typing-indicator {
    align-self: flex-start;
    background-color: transparent;
    padding: 10px 18px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--neon-cyan);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
    box-shadow: 0 0 5px var(--neon-cyan);
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Area Input (Fixed di Bawah) */
.input-area {
    padding: 20px;
    background-color: var(--bg-panel);
    border-top: 1px solid rgba(0, 243, 255, 0.2);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
}

.input-wrapper {
    display: flex;
    gap: 12px;
    position: relative;
}

/* Kolom Input Text */
#user-input {
    flex: 1;
    background-color: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 14px 20px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

#user-input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

#user-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Tombol Kirim */
#send-btn {
    background-color: transparent;
    border: 1px solid var(--neon-cyan);
    border-radius: 8px;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--neon-cyan);
    transition: all 0.3s ease;
}

#send-btn:hover {
    background-color: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4); /* Efek glow saat di-hover */
}

.send-icon {
    width: 20px;
    height: 20px;
}
