:root {
    --primary-color: #BFDBFE; /* Biru muda utama */
    --primary-dark: #60A5FA; /* Aksen biru lebih gelap */
    --bg-color: #EFF6FF; /* Background luar aplikasi */
    --chat-bg: #FFFFFF; /* Background dalam area chat */
    --text-main: #1E3A8A; /* Teks utama */
    --text-muted: #64748B; /* Teks sekunder/placeholder */
    --bot-bubble: #F8FAFC; /* Warna bubble bot (putih/abu-abu terang) */
    --user-bubble: #BFDBFE; /* Warna bubble user (biru muda) */
    --border-color: #E2E8F0;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* App Container */
.app-container {
    width: 100%;
    height: 100vh;
    background-color: var(--chat-bg);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    position: relative;
}

/* Tampilan untuk layar tablet/laptop/desktop */
@media (min-width: 640px) {
    .app-container {
        max-width: 600px;
        height: 90vh;
        border-radius: 24px;
        overflow: hidden;
    }
}

/* Header */
.app-header {
    background-color: var(--primary-color);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    z-index: 10;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title i {
    font-size: 24px;
    color: var(--text-main);
}

.header-title h1 {
    font-size: 20px;
    font-weight: 700;
}

.icon-btn {
    background: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--primary-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.icon-btn:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: scale(1.05);
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar untuk Chat */
.chat-container::-webkit-scrollbar {
    width: 6px;
}
.chat-container::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
}

/* Messages */
.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.bot {
    align-self: flex-start;
}

/* Avatar */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    font-size: 18px;
}

.user .avatar {
    background-color: var(--primary-dark);
    color: white;
}

.bot .avatar {
    background-color: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-dark);
}

/* Chat Bubble */
.bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
}

.user .bubble {
    background-color: var(--user-bubble);
    color: var(--text-main);
    border-top-right-radius: 4px;
}

.bot .bubble {
    background-color: var(--bot-bubble);
    color: var(--text-main);
    border-top-left-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Markdown Styles inside bot bubble */
.bot .bubble p { margin-bottom: 8px; }
.bot .bubble p:last-child { margin-bottom: 0; }
.bot .bubble strong { font-weight: 700; color: var(--primary-dark); }
.bot .bubble em { font-style: italic; }
.bot .bubble ul, .bot .bubble ol { margin: 8px 0 8px 24px; padding-left: 0; }
.bot .bubble code { 
    background-color: #E2E8F0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}
.bot .bubble pre {
    background-color: #1E293B;
    color: #F8FAFC;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}
.bot .bubble pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

/* Shortcuts */
.shortcuts-container {
    padding: 10px 20px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    /* Menyembunyikan scrollbar untuk tampilan lebih bersih */
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-top: 1px solid var(--border-color);
}
.shortcuts-container::-webkit-scrollbar {
    display: none;
}

.shortcut-btn {
    background-color: white;
    border: 1px solid var(--primary-color);
    color: var(--primary-dark);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.shortcut-btn:hover {
    background-color: var(--primary-color);
    color: var(--text-main);
}

/* Input Area */
.input-area {
    padding: 16px 20px;
    background-color: white;
    /* Tidak ada border-top lagi karena sudah ada di shortcuts */
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background-color: var(--bot-bubble);
    border: 1px solid var(--primary-color);
    border-radius: 24px;
    padding: 8px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

#message-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    color: var(--text-main);
    resize: none;
    max-height: 120px;
    padding: 6px 0;
    outline: none;
}

#message-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    background-color: var(--primary-dark);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background-color: #3B82F6;
}

.send-btn:disabled {
    background-color: #93C5FD;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Typing Indicator Animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 4px;
    align-items: center;
}

.dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.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); }
}

/* Error message style */
.error-msg {
    color: #EF4444;
    font-size: 13px;
    margin-top: 8px;
    display: block;
    border-top: 1px dashed #FCA5A5;
    padding-top: 4px;
}
