* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #131314; /* Gemini style dark bg */
  color: #e3e3e3;
}

.layout {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
  width: 260px;
  background-color: #1e1e20;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-right: 1px solid #2d2d30;
  transition: all 0.3s ease;
  z-index: 100;
}

.new-chat-btn {
  width: 100%;
  padding: 0.8rem 1rem;
  background-color: #2b2b2e;
  border: 1px solid #3c3c40;
  color: #fff;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  transition: background 0.2s;
}

.new-chat-btn:hover {
  background-color: #37373a;
}

.chat-history {
  flex: 1;
  margin-top: 1.5rem;
  overflow-y: auto;
}

.history-item {
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #c4c7c5;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item:hover, .history-item.active {
  background-color: #2d2d30;
  color: #fff;
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid #2d2d30;
}

.portfolio-btn {
  color: #a8c7fa;
  text-decoration: none;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- MAIN CONTENT --- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  background-color: #131314;
}

.top-nav {
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 15px;
}

.toggle-sidebar-btn {
  background: none;
  border: none;
  color: #e3e3e3;
  font-size: 1.2rem;
  cursor: pointer;
}

.ai-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  color: #d3e3fd;
}

.brand-icon {
  color: #7cacf8;
}

/* CHAT AREA */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 15%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.welcome-screen {
  margin: auto;
  text-align: center;
  max-width: 500px;
}

.welcome-icon {
  font-size: 2.5rem;
  color: #7cacf8;
  margin-bottom: 1rem;
}

.welcome-screen h1 {
  font-weight: 500;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #4285f4, #d93025, #fbbc04, #34a853);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-screen p {
  color: #8e918f;
  font-size: 0.95rem;
}

.message-row {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.message-row.user {
  justify-content: flex-end;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.ai .avatar {
  background-color: #004a77;
  color: #c2e7ff;
}

.user-bubble {
  background-color: #282a2c;
  padding: 0.8rem 1.2rem;
  border-radius: 18px;
  max-width: 70%;
  line-height: 1.6;
}

.ai-bubble {
  padding: 0.2rem 0;
  max-width: 85%;
  line-height: 1.6;
  color: #e3e3e3;
}

/* INPUT AREA */
.input-wrapper {
  padding: 1rem 15% 1.5rem 15%;
  background-color: #131314;
}

.input-box {
  background-color: #1e1e20;
  border: 1px solid #3c3c40;
  border-radius: 28px;
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-box:focus-within {
  border-color: #666;
}

textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 1rem;
  resize: none;
  max-height: 150px;
}

.send-btn {
  background-color: #e3e3e3;
  color: #131314;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.send-btn:hover {
  opacity: 0.8;
}

.disclaimer {
  text-align: center;
  font-size: 0.75rem;
  color: #8e918f;
  margin-top: 0.6rem;
}

/* RESPONSIVE (MOBILE) */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    left: -260px;
    height: 100%;
  }
  .sidebar.active {
    left: 0;
  }
  .chat-container, .input-wrapper {
    padding-left: 5%;
    padding-right: 5%;
  }
}
