/* =========================================
   VARIABEL TEMA GEMINI LIGHT MODE
========================================= */
:root {
    --bg-main: #ffffff;
    --bg-chat-me: #f0f4f9; /* Abu-abu kebiruan khas Google */
    --bg-chat-other: transparent;
    --text-main: #1f1f1f;
    --text-muted: #444746;
    --border-color: #e3e3e3;
    --primary-blue: #0b57d0;
    --input-bg: #f0f4f9;
}

/* =========================================
   RESET & BASE STYLES
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Menggunakan font sistem yang mirip Google Sans */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html, body {
    height: 100dvh;
    overflow: hidden;
    background-color: var(--bg-main);
    color: var(--text-main);
}

/* Animasi anti-kedip (FOUC) saat halaman dimuat */
body {
    animation: fadeInPage 0.2s ease-in-out;
}
@keyframes fadeInPage {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Ikon bintang khas Gemini (Sparkle) dengan efek gradasi */
.sparkle-icon {
    color: #d3e3fd; 
    background: linear-gradient(74deg, #4285f4 0, #9b72cb 9%, #d96570 20%, #d96570 24%, #9b72cb 35%, #4285f4 44%, #9b72cb 50%, #d96570 56%, #1DA1F2 75%, #1DA1F2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =========================================
   GAYA HALAMAN CHAT (TANYO.PHP) - FULL SCREEN
========================================= */
.app-container {
    width: 100%;
    max-width: 100%; /* Dibuat full screen */
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
}

/* HEADER (Mirip Topbar Gemini) */
.chat-header {
    background-color: var(--bg-main);
    color: var(--text-main);
    padding: 15px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gemini-logo {
    font-size: 22px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}

/* Kustomisasi Dropdown Teman agar mirip pemilih model (Gemini Advanced) */
.contact-selector select {
    background: transparent;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    padding: 5px 10px;
    border-radius: 8px;
}
.contact-selector select:hover {
    background: #f0f4f9;
}

/* =========================================
   HAMBURGER MENU & DROPDOWN SETTINGS
========================================= */
.hamburger-container {
    position: relative;
}

.hamburger-menu {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.hamburger-menu:hover {
    background: var(--bg-chat-me); 
}

.hamburger-dropdown {
    display: none;
    position: absolute;
    top: 48px;
    left: 0;
    background: var(--bg-main);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    width: 220px;
    z-index: 100;
    padding: 10px 0;
    border: 1px solid var(--border-color);
}
.hamburger-dropdown.show {
    display: block;
    animation: popIn 0.2s ease;
}
@keyframes popIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-user-info {
    padding: 10px 20px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.dropdown-divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 5px 0;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}
.dropdown-item:hover {
    background: var(--bg-chat-me);
}

/* =========================================
   AREA OBROLAN
========================================= */
.chat-box {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center; /* Memusatkan chat di tengah layar lebar */
}

/* Container untuk membatasi lebar teks agar nyaman dibaca seperti Gemini */
.chat-content-wrapper {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.welcome-text {
    text-align: center;
    color: var(--text-muted);
    margin: 40px auto;
    font-size: 24px;
    font-weight: 400;
}

.bubble {
    max-width: 90%;
    padding: 12px 20px;
    font-size: 16px;
    line-height: 1.6;
    position: relative;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
}

/* Pesan Saya (Sebelah Kanan, Bubble abu-abu seperti Gemini) */
.bubble.me {
    background-color: var(--bg-chat-me);
    align-self: flex-end;
    border-radius: 24px;
    border-bottom-right-radius: 8px;
}

/* Pesan Teman (Sebelah Kiri, Tanpa background, seperti jawaban Gemini) */
.bubble.other {
    background-color: var(--bg-chat-other);
    align-self: flex-start;
    border-radius: 0;
    padding: 0;
    display: flex;
    gap: 16px;
}

/* Avatar Teman (Kilauan Bintang Gemini) */
.other-avatar {
    background: transparent;
    width: auto;
    height: auto;
    margin-right: 8px;
    margin-top: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}
.other-avatar i {
    background: linear-gradient(74deg, #4285f4 0, #9b72cb 9%, #d96570 20%, #d96570 24%, #9b72cb 35%, #4285f4 44%, #9b72cb 50%, #d96570 56%, #1DA1F2 75%, #1DA1F2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 20px;
}

.other-text {
    margin-top: 4px;
}

.bubble-time {
    font-size: 11px;
    color: #888;
    margin-top: 8px;
    display: block;
}
.bubble.other .bubble-time {
    text-align: left;
}
.bubble.me .bubble-time {
    text-align: right;
}

/* =========================================
   AREA INPUT (Mirip Prompt Gemini)
========================================= */
.chat-input-area {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: var(--bg-main);
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border-radius: 32px; /* Bentuk pill/oval */
    padding: 8px 16px;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.input-wrapper input[type="text"] {
    flex: 1;
    padding: 12px 10px;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    color: var(--text-main);
}

.input-wrapper button {
    background: transparent;
    color: var(--text-main);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

.input-wrapper button:hover:not(:disabled) {
    background: rgba(0,0,0,0.05);
}

.input-wrapper button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* =========================================
   ANIMASI & SCROLLBAR
========================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sembunyikan scrollbar agar rapi */
.chat-box::-webkit-scrollbar {
    width: 6px;
}
.chat-box::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}