:root {
  --primary: #26355D;
  --primary-light: #3a4a7a;
  --secondary: #AF47D2;
  --secondary-light: #c16adf;
  --accent: #46df2d;
  --bg-color: #f5f7fa;
  --text-color: #333;
  --card-bg: #fff;
  --border-color: #e1e5eb;
}

[data-theme="dark"] {
  --bg-color: #1a1a2e;
  --text-color: #f0f0f0;
  --card-bg: #16213e;
  --border-color: #2a3a5a;
}

/* Base Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  transition: background 0.3s, color 0.3s;
}

/* Auth Page */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.auth-logo {
  width: 75%;
  margin-bottom: 1px;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: #14003a;
  color: rgb(255, 255, 255);
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 1rem;
}

.btn-google:hover {
  background: #c2e0ff;
}

.btn-theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--secondary);
  color: rgb(43, 35, 148);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* Chat Page */
.navbar {
  background: var(--primary);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
}

.logo {
  height: 50px;
}
.btn-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.btn-logout {
  background: var(--secondary);
  color: white;
  border: none;
  height: 50px;
  padding: 8px 16px;
  margin: 10px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-logout:hover {
  background: var(--secondary-light);
}

.chat-container {
  display: flex;
  height: calc(100vh - 60px);
}

.sidebar {
  width: 250px;
  background: var(--card-bg);
  border-right: 1px solid var(--border-color);
  padding: 1rem;
  overflow-y: auto;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.status {
  font-size: 0.8rem;
  color: var(--accent);
}

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

.message {
  display: flex;
  gap: 10px;
  margin-bottom: 1rem;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.message-content {
  max-width: 70%;
}

.message-text {
  background: var(--border-color);
  padding: 0.75rem;
  border-radius: 0 12px 12px 12px;
}

.message.current-user {
  flex-direction: row-reverse;
}

.message.current-user .message-text {
  background: var(--secondary);
  color: white;
  border-radius: 12px 0 12px 12px;
}

.message-input {
    position: fixed;
    bottom: 0;
    left: 283px;
    right: 0;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
    z-index: 999;
}

.message-input input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-color);
}

.btn-primary {
  background: var(--secondary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--secondary-light);
}
/* Hide sidebar on screens below 768px */
@media screen and (max-width: 768px) {
  .sidebar {
    display: none;
  }
}
/* Existing variables, theme, base styles... */
.user-name-top {
  text-align: center;
  padding: 0.75rem;
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--primary);
}
.d-mobile-only { display: none; }

@media screen and (max-width: 768px) {
  .d-mobile-only { display: block; }
  .sidebar { display: none !important; }

  .message-input {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
    z-index: 999;
  }

  .messages {
    padding-bottom: 160px !important;
  }
}

html, body {
  height: 100%;
  overflow: hidden;
}

.chat-container {
  display: flex;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: 20%;
}

.message-input {
  display: flex;
  padding: 1rem;
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
}

.message-input input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 16px;
}

/* Show username below navbar */
.user-name-top {
  text-align: center;
  padding: 0.75rem;
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--primary);
}
