/* --- TEMA WARNA TERANG (Abu-Putih) --- */
:root {
    --bg-base: #f7f7f8; 
    --sidebar-bg: #f9f9f9; 
    --input-surface: #ffffff; 
    --text-primary: #0d0d0d; 
    --text-secondary: #5e5e5e; 
    --border-line: #e5e5e5; 
    --user-bubble-bg: #eeeeee; 
    --user-bubble-text: #0d0d0d; 
    --ai-bubble-bg: transparent; 
    --accent-color: #1a1a1a;
    --icon-color: #5e5e5e; 
    --grid-color: rgba(0, 0, 0, 0.04);
}

/* --- TEMA WARNA GELAP (Monokrom / Hitam-Abu) --- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-base: #111111; 
        --sidebar-bg: #171717; 
        --input-surface: #212121; 
        --text-primary: #ececec; 
        --text-secondary: #9b9b9b; 
        --border-line: #333333; 
        --user-bubble-bg: #2f2f2f; 
        --user-bubble-text: #ececec; 
        --ai-bubble-bg: transparent; 
        --accent-color: #ffffff;
        --icon-color: #aaaaaa; 
        --grid-color: rgba(255, 255, 255, 0.04);
    }
}

/* GLOBAL */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Google Sans', sans-serif; }
body { 
    background-color: var(--bg-base); 
    background-image: 
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 24px 24px; 
    color: var(--text-primary); 
    height: 100vh; height: 100dvh; overflow: hidden; 
}
.gemini-app { display: flex; height: 100vh; height: 100dvh; width: 100vw; position: relative; }
.material-symbols-outlined { font-size: 24px; color: var(--icon-color); }
.icon-btn { background: none; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 10px; border-radius: 50%; transition: 0.2s; }
.icon-btn:hover { background-color: rgba(128, 128, 128, 0.15); }

/* SIDEBAR & OVERLAY */
.gemini-sidebar { width: 280px; background-color: var(--sidebar-bg); border-right: 1px solid var(--border-line); display: flex; flex-direction: column; padding: 20px 16px; transition: transform 0.3s ease; z-index: 100; }
#sidebar-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; height: 100dvh; background: rgba(0, 0, 0, 0.5); z-index: 99; }
.new-chat-action { background-color: var(--bg-base); border: 1px solid var(--border-line); color: var(--text-primary); padding: 12px 18px; border-radius: 50px; cursor: pointer; font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 12px; }
.sidebar-history-area { flex: 1; margin-top: 30px; display: flex; flex-direction: column; overflow: hidden; }
.history-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 12px; padding-left: 12px; }
#history-list { display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; }
.sidebar-bottom { margin-top: auto; padding-bottom: env(safe-area-inset-bottom, 0px); }

/* MAIN CONTENT & HEADER */
.gemini-main { flex: 1; display: flex; flex-direction: column; position: relative; width: 100%; }
.top-navigation { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; z-index: 90; }
.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.app-logo-text { font-size: 20px; font-weight: 600; color: var(--accent-color); }

/* RUANG CHAT */
.chat-viewport { flex: 1; overflow-y: auto; padding: 0 24px 130px 24px; max-width: 850px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.welcome-banner { margin-top: 60px; margin-bottom: 20px; }
.welcome-banner h1 { font-size: 42px; background: linear-gradient(74deg, var(--accent-color) 0%, var(--icon-color) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 10px; }
.welcome-banner p { font-size: 24px; color: var(--text-secondary); font-weight: 500; opacity: 0.9; }
.message { display: flex; flex-direction: column; max-width: 100%; line-height: 1.6; font-size: 16px; }
.user-message { align-self: flex-end; background-color: var(--user-bubble-bg); color: var(--user-bubble-text); padding: 12px 20px; border-radius: 24px; border-bottom-right-radius: 4px; max-width: 80%; }
.ai-message { align-self: flex-start; padding: 0; max-width: 100%; }
.chat-image { max-width: 250px; border-radius: 12px; margin-bottom: 10px; }

/* FORMAT JAWABAN AI (MARKDOWN & KODE) */
.markdown-body { font-size: 15px; line-height: 1.6; }
.markdown-body p { margin-bottom: 12px; }
.markdown-body ul, .markdown-body ol { margin-left: 20px; margin-bottom: 12px; }
.markdown-body strong { color: var(--text-primary); }
.markdown-body code { background-color: var(--border-line); padding: 2px 6px; border-radius: 6px; font-family: 'Courier New', Courier, monospace; font-size: 13px; color: #e83e8c; }
.markdown-body pre { background-color: #1e1e1e !important; color: #d4d4d4; padding: 16px; border-radius: 12px; overflow-x: auto; margin: 12px 0; }
.markdown-body pre code { background-color: transparent; padding: 0; color: inherit; }

/* LOADING */
.thinking-state { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); }
.spin-icon { animation: spin 1.5s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }
.image-preview-box { background-color: var(--input-surface); padding: 8px; border-radius: 12px; border: 1px solid var(--border-line); display: inline-flex; align-items: center; gap: 8px; position: absolute; bottom: 90px; left: 24px; z-index: 10; }
.image-preview-box img { width: 45px; height: 45px; object-fit: cover; border-radius: 8px; }
.icon-btn-small { background: none; border: none; cursor: pointer; padding: 4px; }

/* INPUT MELAYANG */
.floating-input-container { position: absolute; bottom: 0; left: 0; right: 0; padding: 0 24px calc(20px + env(safe-area-inset-bottom, 0px)) 24px; background: linear-gradient(to top, var(--bg-base) 80%, transparent); display: flex; flex-direction: column; align-items: center; }
.input-card-gemini { background-color: var(--input-surface); border: 1px solid var(--border-line); border-radius: 32px; display: flex; align-items: flex-end; padding: 10px 16px; max-width: 850px; width: 100%; gap: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.input-card-gemini textarea { flex: 1; background: transparent; border: none; color: var(--text-primary); font-size: 16px; resize: none; outline: none; padding: 12px 0; min-height: 48px; max-height: 150px; }
.input-card-gemini textarea::placeholder { color: var(--text-secondary); opacity: 0.7; }
.send-btn-active .material-symbols-outlined { color: var(--accent-color); }
.model-selector-wrapper { position: relative; align-self: center; }
.model-select-btn { display: flex; align-items: center; gap: 2px; background: transparent; border: 1px solid var(--border-line); color: var(--text-secondary); padding: 8px 10px 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: 0.2s; }
.model-select-btn:hover { background-color: rgba(128, 128, 128, 0.12); }
.disclaimer-text { font-size: 12px; color: var(--text-secondary); margin-top: 12px; text-align: center; opacity: 0.8; }
.hidden { display: none !important; }

/* TOMBOL ACTION (Copy, Like, Dislike) */
.message-actions { display: flex; gap: 6px; margin-top: 10px; opacity: 0; transition: opacity 0.2s ease-in-out; }
.ai-message:hover .message-actions { opacity: 1; }
.message-actions .icon-btn-small { background: transparent; border: none; color: var(--text-secondary); cursor: pointer; padding: 6px; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s, color 0.2s; }
.message-actions .icon-btn-small:hover { background-color: var(--border-line); color: var(--text-primary); }

/* FITUR RIWAYAT OBROLAN & MENU OPSI */
.history-item-container { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 50px; cursor: pointer; position: relative; color: var(--text-primary); margin-bottom: 4px; }
.history-item-container:hover { background-color: var(--border-line); }
.history-item-container.active { background-color: rgba(128, 128, 128, 0.15); font-weight: 500; }
.history-item-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; display: flex; align-items: center; gap: 12px; }
.history-options-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; display: none; padding: 4px; border-radius: 50%; align-items: center; justify-content: center; }
.history-item-container:hover .history-options-btn { display: flex; }
.history-options-btn:hover { background-color: rgba(128, 128, 128, 0.2); color: var(--text-primary); }
.history-dropdown { position: absolute; top: 100%; right: 0; background-color: var(--input-surface); border: 1px solid var(--border-line); border-radius: 12px; padding: 8px 0; z-index: 1000; min-width: 200px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.history-dropdown button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; background: none; border: none; color: var(--text-primary); text-align: left; cursor: pointer; font-size: 14px; }
.history-dropdown button:hover { background-color: var(--border-line); }

/* DROPDOWN MODEL KRAA (RAPI KE BAWAH) */
.model-dropdown-menu { position: absolute; bottom: calc(100% + 12px); left: 0; background-color: var(--sidebar-bg); border: 1px solid var(--border-line); border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); width: 240px; padding: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 200; }
.model-option { display: flex; flex-direction: column; align-items: flex-start; background: transparent; border: none; text-align: left; padding: 10px 12px; border-radius: 10px; cursor: pointer; width: 100%; color: var(--text-primary); transition: 0.2s; }
.model-option:hover, .model-option.active { background-color: var(--border-line); }
.model-option-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.model-option-title-row { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.model-option-desc { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.pro-lock-icon { font-size: 16px !important; color: var(--text-secondary); }
.pro-lock-icon.unlocked { color: #2ecc71 !important; }

/* MODAL & LOGIN/REGISTER */
.pro-modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: flex; align-items: center; justify-content: center; z-index: 300; padding: 20px; }
.pro-modal-card { background-color: var(--sidebar-bg); border: 1px solid var(--border-line); border-radius: 24px; width: 100%; max-width: 380px; max-height: 90vh; max-height: 90dvh; overflow-y: auto; padding: 28px 24px 24px 24px; position: relative; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); }
.pro-modal-close-btn { position: absolute; top: 14px; right: 14px; background: none; border: none; cursor: pointer; color: var(--text-secondary); }
.pro-modal-header { text-align: center; margin-bottom: 18px; }
.pro-modal-icon { font-size: 40px !important; color: var(--accent-color); }
.pro-modal-price { text-align: center; font-size: 26px; font-weight: 700; color: var(--accent-color); margin-bottom: 18px; }
.pro-modal-price span { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-top: 2px; }
.pro-qris-box { background-color: var(--input-surface); border: 1px solid var(--border-line); border-radius: 16px; padding: 16px; text-align: center; margin-bottom: 16px; min-height: 100px; }
.pro-qris-box canvas { max-width: 100%; border-radius: 8px; margin-bottom: 10px; background: #fff; padding: 6px; }
.pro-qris-canvas-wrap { display: inline-block; background: #fff; padding: 10px; border-radius: 8px; margin-bottom: 10px; }
.pro-qris-canvas-wrap img { display: block; }
.pro-qris-box p { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.pro-qris-loading { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 0; font-size: 13px; color: var(--text-secondary); }
.pro-payment-status { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.pro-recheck-btn { background: none; border: none; color: var(--accent-color); font-size: 12px; font-weight: 600; text-decoration: underline; cursor: pointer; margin-top: 8px; }
.pro-history-hint { font-size: 11px; color: var(--text-secondary); text-align: center; margin-top: 8px; opacity: 0.8; line-height: 1.4; }
.pro-manual-divider { text-align: center; font-size: 11px; color: var(--text-secondary); opacity: 0.7; margin: 4px 0 10px 0; }
.pro-manual-hint { font-size: 12px; color: var(--text-secondary); text-align: center; line-height: 1.5; margin-bottom: 14px; }
.pro-manual-hint a { color: var(--accent-color); font-weight: 600; }
.pro-steps { padding-left: 20px; margin-bottom: 18px; }
.pro-steps li { font-size: 13px; color: var(--text-primary); line-height: 1.8; }
.pro-steps a { color: var(--accent-color); font-weight: 600; }
.pro-redeem-row { display: flex; gap: 8px; }
.pro-redeem-row input { flex: 1; background-color: var(--input-surface); border: 1px solid var(--border-line); color: var(--text-primary); padding: 12px 14px; border-radius: 12px; font-size: 14px; outline: none; }
.pro-redeem-row button { background-color: var(--accent-color); color: #ffffff; border: none; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 14px; cursor: pointer; transition: 0.2s; }
.pro-redeem-row button:hover { opacity: 0.9; }
.pro-redeem-msg { margin-top: 12px; font-size: 13px; text-align: center; font-weight: 500; }
.pro-redeem-success { color: #2ecc71; }
.pro-redeem-error { color: #e74c3c; font-size: 13px; margin-bottom: 10px; text-align: center; }

.auth-form-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.auth-input { background-color: var(--input-surface); border: 1px solid var(--border-line); color: var(--text-primary); padding: 14px 16px; border-radius: 12px; font-size: 14px; outline: none; width: 100%; }
.auth-submit-btn { background-color: var(--accent-color); color: #ffffff; border: none; padding: 14px; border-radius: 12px; font-weight: 600; font-size: 15px; cursor: pointer; width: 100%; transition: 0.2s; }
.auth-submit-btn:hover { opacity: 0.9; }
.auth-switch-text { font-size: 13px; color: var(--text-secondary); text-align: center; margin-top: 16px; }
#auth-switch-mode { color: var(--accent-color); cursor: pointer; font-weight: 600; }

.user-profile-card { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 20px; background-color: var(--input-surface); border: 1px solid var(--border-line); margin-bottom: 10px; }
.user-info { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.user-avatar-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border-line); }
.logout-btn { background: none; border: none; color: #e74c3c; cursor: pointer; display: flex; }
.login-trigger-btn { background-color: var(--accent-color); color: #fff; border: none; padding: 10px 16px; border-radius: 50px; font-size: 14px; font-weight: 600; cursor: pointer; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px; }

/* =========================================
   TAMPILAN HALAMAN ABOUT DEVELOPER
   ========================================= */
.about-page-body { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    min-height: 100dvh;
    padding: 20px; 
}

.about-card-container { 
    width: 100%; 
    max-width: 420px; 
    background-color: var(--sidebar-bg); 
    border: 1px solid var(--border-line); 
    border-radius: 24px; 
    padding: 30px 24px 24px 24px; 
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); 
    position: relative;
}

.about-nav { 
    position: absolute; 
    top: 16px; 
    left: 16px; 
}

.about-nav .back-link { 
    color: var(--text-primary); 
    text-decoration: none; 
}

.profile-card { 
    margin-top: 20px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center; 
}

.profile-avatar-wrapper { 
    width: 120px; 
    height: 120px; 
    border-radius: 50%; 
    border: 4px solid var(--border-line); 
    overflow: hidden; 
    margin-bottom: 16px; 
    background-color: var(--input-surface);
}

.profile-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.profile-name { 
    font-size: 26px; 
    font-weight: 700; 
    color: var(--text-primary);
    margin-bottom: 4px; 
}

.profile-title { 
    font-size: 14px; 
    color: var(--text-secondary); 
    margin-bottom: 20px; 
}

.profile-bio { 
    background-color: var(--input-surface); 
    border: 1px solid var(--border-line); 
    color: var(--text-primary); 
    padding: 16px; 
    border-radius: 16px; 
    width: 100%; 
    text-align: left; 
    font-size: 14px; 
    line-height: 1.6; 
    margin-bottom: 24px; 
}

.profile-socials { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    width: 100%; 
}

.soc-btn { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
    padding: 14px; 
    border-radius: 14px; 
    text-decoration: none !important; /* Biar gak biru kyk link biasa */
    font-weight: 600; 
    font-size: 15px; 
    background-color: var(--input-surface); 
    border: 1px solid var(--border-line); 
    color: var(--text-primary) !important; 
    transition: all 0.2s ease; 
}

.soc-btn:hover { 
    background-color: var(--border-line); 
    transform: translateY(-2px); 
}

.soc-btn i { 
    font-size: 20px; 
}

/* RESPONSIVE LAYAR HP */
@media (max-width: 768px) {
    .gemini-sidebar { position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh; transform: translateX(-100%); }
    .gemini-sidebar.active { transform: translateX(0); }
    .top-navigation { padding: 12px 16px; }
    .floating-input-container { padding: 0 16px 16px 16px; }
    .chat-viewport { padding: 0 16px 200px 16px; }
    .input-card-gemini { flex-wrap: wrap; padding: 8px 12px; gap: 6px; }
    .model-selector-wrapper { order: -1; width: 100%; margin-bottom: 4px; }
    .model-dropdown-menu { width: 220px; bottom: calc(100% + 8px); }
}
@media (min-width: 769px) { #sidebar-overlay { display: none !important; } }