/* ============================================================
   RESET & CSS VARIABLES (Gemini Vibe)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --surface: #f0f4f9;
  --surface-hover: #e0e5eb;
  --border: #e3e3e3;
  --text: #1f1f1f;
  --text-muted: #444746;
  --accent: #1a73e8;
  --user-bubble: #f0f4f9;
  --shadow-soft: 0 4px 12px rgba(0,0,0,0.05);
  --font-family: 'Inter', sans-serif;
}

[data-theme="dark"] {
  --bg: #131314;
  --surface: #1e1f20;
  --surface-hover: #333537;
  --border: #444746;
  --text: #e3e3e3;
  --text-muted: #c4c7c5;
  --accent: #8ab4f8;
  --user-bubble: #333537;
  --shadow-soft: 0 4px 12px rgba(0,0,0,0.3);
}

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  display: flex;
  overflow: hidden;
  transition: background 0.3s, color 0.3s;
}
.logo-box{
    width:260px;
    height:50px;
    background:#ffffff;
    border-radius:50px;

    display:flex;
    align-items:center;
    justify-content:center;

    box-shadow:
        0 4px 12px rgba(0,0,0,0.06),
        0 1px 2px rgba(0,0,0,0.04);

    overflow:hidden;
}

/* Increase actual logo size */
.logo-img{
    width:100px;
    height:auto;
    object-fit:contain;

    transform:scale(1.4);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
aside {
  width: 260px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 12px;
  border-radius: 0 16px 16px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 500;
  padding-bottom: 20px;
}

.logo-icon {
  width: 30px; height: 30px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-style: italic; font-weight: bold;
}

.new-chat-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 24px;
  border: none;
  background: var(--bg);
  color: var(--text);
  font-family: inherit; font-size: 0.9rem; font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: all 0.2s;
}
.new-chat-btn:hover { background: var(--surface-hover); }

.sidebar-bottom { margin-top: auto; }
.theme-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px; font-size: 0.9rem;}
.theme-label { display: flex; align-items: center; gap: 10px; color: var(--text-muted); }

.toggle-switch { position: relative; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0; background: var(--border); border-radius: 20px; cursor: pointer; transition: 0.3s;
}
.toggle-track::after {
  content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: 0.3s;
}
.toggle-switch input:checked + .toggle-track { background: var(--accent); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(18px); }

/* ============================================================
   MAIN CHAT & BUBBLES
   ============================================================ */
main { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }

#chat-container {
  flex: 1; overflow-y: auto; padding: 40px 0 120px; scroll-behavior: smooth;
}
#chat-container::-webkit-scrollbar { width: 6px; }
#chat-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.chat-inner, #empty-state, .input-wrap, .hint { max-width: 800px; margin: 0 auto; width: 100%; padding: 0 20px; }

#empty-state { text-align: center; padding-top: 10vh; animation: fadeUp 0.5s ease both; }
.ai-greeting-icon { font-size: 40px; margin-bottom: 20px; animation: pulse 2s infinite; }
.welcome-title { font-size: 2rem; font-weight: 500; color: var(--text); margin-bottom: 10px; }
.welcome-sub { font-size: 1rem; color: var(--text-muted); }

.msg-row { display: flex; gap: 16px; padding: 16px 0; animation: fadeUp 0.3s ease both; }
.msg-row.user { flex-direction: row-reverse; }

.avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 14px;}
.ai-avatar { background: linear-gradient(135deg, var(--accent), #9b51e0); color: white; font-style: italic; }
.user-avatar { background: var(--user-bubble); color: var(--text); }

.msg-content { max-width: 85%; font-size: 1rem; line-height: 1.6; color: var(--text); }
.user .msg-content { background: var(--user-bubble); padding: 12px 20px; border-radius: 20px; border-top-right-radius: 4px; }
.ai .msg-content { padding: 4px 0; }

.timer-line { font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; font-family: monospace; }
.streaming-cursor { display: inline-block; width: 3px; height: 1em; background: var(--accent); animation: blink 1s infinite; margin-left: 4px; vertical-align: bottom;}

/* ============================================================
   FLOATING INPUT BAR
   ============================================================ */
#input-area {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  padding: 20px 0;
}

.input-wrap {
  background: var(--surface);
  border-radius: 30px;
  padding: 12px 16px 12px 24px;
  display: flex; align-items: flex-end; gap: 12px;
  box-shadow: var(--shadow-soft);
}

#user-input {
  flex: 1; background: transparent; border: none; outline: none; color: var(--text);
  font-family: inherit; font-size: 1rem; resize: none; max-height: 150px; line-height: 1.5;
  padding-bottom: 6px; padding-top: 6px;
}

.send-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: transparent; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: 0.2s;
}
.send-btn:hover { background: var(--border); color: var(--text); }

.hint { text-align: center; font-size: 0.75rem; color: var(--text-muted); margin-top: 12px; }

/* Animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

/* Typing indicator */
#typing-wrap { display: none; padding: 10px 20px; max-width: 800px; margin: 0 auto; }
.typing-inner { display: flex; align-items: center; gap: 16px; }
.typing-dots { display: flex; gap: 4px; }
.tdot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: bounce 1.4s infinite ease-in-out both; }
.tdot:nth-child(1) { animation-delay: -0.32s; }
.tdot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }