:root {
  --bg-color: #131314;
  --sidebar-bg: #1e1f20;
  --text-primary: #e3e3e3;
  --text-secondary: #a8a8a8;
  /* Muted text */
  --accent-blue: #4c8df6;
  --accent-purple: #c58af9;
  --surface-hover: #2a2b2e;
  --input-bg: #1e1f20;
  --border-color: #444746;
  --card-bg: #1e1f20;
  --font-main: 'Outfit', 'Google Sans', sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  overflow: hidden;
}

.app-container {
  display: flex;
  width: 100%;
  height: 100%;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  /* Almost same as bg in some versions, but slightly distinct */
  background-color: var(--bg-color);
  /* Actually, modern Gemini sidebar is often same as bg but separated by space or purely visual */
  display: flex;
  flex-direction: column;
  padding: 1rem;
  transition: transform 0.3s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.menu-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s;
}

.menu-btn:hover {
  background-color: var(--surface-hover);
  color: var(--text-primary);
}

.new-chat-btn {
  background-color: #1b1b1b;
  border: 1px solid #333;
  color: var(--text-secondary);
  padding: 10px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.new-chat-btn:hover {
  background-color: #2b2b2b;
  color: var(--text-primary);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
}

.history-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  padding-left: 12px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 20px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: background 0.2s;
  overflow: hidden;
  white-space: nowrap;
}

.history-item:hover,
.history-item.active {
  background-color: #004a77;
  /* Active blue tint */
  background-color: #28292c;
}

.history-item.active {
  background-color: #004a7740;
  /* Subtle blue highlight */
  color: #a8c7fa;
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
  text-align: left;
}

.footer-item:hover {
  background-color: var(--surface-hover);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-color);
  border-radius: 20px;
  /* Slight roundness if detached, but full screen usually */
  margin: 0;
}


.top-bar {
  padding: 1rem 2rem;
  padding-left: 4rem;
  /* Add space for the absolute menu button */
  display: flex;
  justify-content: space-between;
  align-items: center;
}


.model-name {
  font-size: 1.1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge {
  font-size: 0.75rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: black;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: #7c4dff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}

/* Chat Container */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  position: relative;
}

/* Intro View */
.intro-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Center horizontally */
  justify-content: center;
  width: 100%;
  max-width: 900px;
  margin-top: 5vh;
}

.greeting {
  text-align: left;
  width: 100%;
  margin-bottom: 3rem;
}

.greeting .gradient-text {
  font-size: 3.5rem;
  font-weight: 500;
  background: linear-gradient(90deg, #4285f4, #9b72cb, #d96570);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: block;
  letter-spacing: -1px;
}

.greeting p {
  font-size: 3.5rem;
  font-weight: 500;
  color: #444746;
  /* Dark grey similar to unlit pixels */
  color: #5e5e5e;
  line-height: 1.2;
}

.suggestion-cards {
  display: flex;
  gap: 1rem;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.card {
  flex: 1;
  min-width: 180px;
  background-color: var(--card-bg);
  padding: 1rem;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  height: 180px;
  display: flex;
  flex-direction: column;
  transition: background 0.2s;
}

.card:hover {
  background-color: #28292c;
}

.card p {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card span {
  font-size: 1rem;
  color: var(--text-secondary);
  /* Continuing text inside card */
}

.card .icon-box {
  background-color: black;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Messages Area */
.messages-area {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 200px;
  /* Increased from 100px for better spacing */
}

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

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

.message-avatar.user {
  background: #7c4dff;
}

.message-avatar.model {
  background: transparent;
}

.message-avatar.model img {
  width: 100%;
  height: 100%;
}

.message-content {
  flex: 1;
  line-height: 1.6;
  font-size: 1rem;
  color: var(--text-primary);
}

.message-content h2 {
  font-size: 1.2rem;
  margin: 1rem 0 0.5rem;
}

.message-content p {
  margin-bottom: 0.5rem;
}

.message-content code {
  background: #2b2b2b;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: monospace;
}

/* Input Container */
.input-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 1rem 1rem 1rem;
  background: linear-gradient(transparent, var(--bg-color) 40%);
}

.input-wrapper {
  background-color: var(--input-bg);
  border-radius: 32px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  transition: background 0.2s, border 0.2s;
}

.input-wrapper:focus-within {
  background-color: #28292c;
  border-color: #444746;
}

.input-wrapper input {
  flex: 1;
  background: none;
  border: none;
  font-size: 1rem;
  color: white;
  outline: none;
  padding: 8px 0;
}

.attach-btn,
.mic-btn,
.send-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attach-btn:hover,
.mic-btn:hover,
.send-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.disclaimer {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.8rem;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: #444746;
  border-radius: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}
/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeInModal 0.3s forwards;
}

@keyframes fadeInModal {
    to { opacity: 1; }
}

.modal {
    background: #1e1f20;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    border: 1px solid #444746;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    animation: slideUpModal 0.3s forwards;
}

@keyframes slideUpModal {
    to { transform: translateY(0); }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 500;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
}

.icon-btn:hover {
    background: #333;
    color: white;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.setting-item input[type="password"],
.setting-item select {
    width: 100%;
    background: #2b2c2f;
    border: 1px solid #444746;
    padding: 12px;
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}

.setting-item input:focus, .setting-item select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(76, 141, 246, 0.2);
}

.hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
}

.primary-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: filter 0.2s;
}

.primary-btn:hover {
    filter: brightness(1.1);
}


/* Mobile Responsiveness */
@media (max-width: 768px) {
  .app-container {
    position: relative;
    overflow-x: hidden;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1000;
    width: 280px;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
  }

  .main-content {
    width: 100%;
    margin-left: 0;
  }

  .top-bar {
    padding: 1rem;
    padding-left: 3.5rem; /* Space for the toggle button */
  }

  .greeting .gradient-text {
    font-size: 2.5rem; /* Smaller text */
  }
  
  .greeting p {
    font-size: 2.5rem;
  }

  .suggestion-cards {
    padding-left: 1rem;
    padding-right: 1rem;
    -webkit-overflow-scrolling: touch;
  }

  .card {
    min-width: 160px;
    height: 160px;
  }
  
  .input-container {
    width: 100%;
    padding: 0 1rem 1rem 1rem;
  }

  .modal {
    width: 95%;
    margin: 10px;
  }
}

