/* Base layout */
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #121212;
  color: #ffffff;
}

.container {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: #1e1e1e;
  padding: 20px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.2);
}

.sidebar h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #ffffff;
}

.sidebar select {
  width: 100%;
  padding: 8px;
  margin-bottom: 15px;
  border-radius: 5px;
  background-color: #2a2a2a;
  color: #fff;
  border: none;
}

#sessionList {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

#sessionList li {
  background-color: #2e2e2e;
  color: #fff;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#sessionList li:hover {
  background-color: #3a3a3a;
}

#sessionList li.active {
  background-color: #3b5bfd;
  color: white;
}

#sessionList li button {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  margin-left: 8px;
  font-size: 14px;
}

#newSessionBtn {
  margin-top: 20px;
  padding: 10px;
  width: 100%;
  background-color: #3b5bfd;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

/* Chat area */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #181818;
}

.chat-box {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-box .welcome-message {
  margin: auto;
  text-align: center;
  font-size: 1.3rem;
  color: #ccc;
  max-width: 600px;
  line-height: 1.6;
}

/* Message bubbles */
.msg {
  display: inline-block;
  padding: 14px 18px;
  border-radius: 18px;
  line-height: 1.6;
  font-size: 1rem;
  word-wrap: break-word;
  max-width: 70%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  position: relative;
  transition: transform 0.2s ease;
}

.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #4250ff, #576aff);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg.therapist {
  align-self: flex-start;
  background: #2f4431;
  color: #b9fbc0;
  border-bottom-left-radius: 4px;
}

/* Chat input */
.chat-input {
  display: flex;
  padding: 12px;
  border-top: 1px solid #333;
  background-color: #1a1a1a;
}

.chat-input textarea {
  flex: 1;
  resize: none;
  padding: 12px;
  font-size: 1rem;
  background-color: #2a2a2a;
  color: #fff;
  border: 1px solid #444;
  border-radius: 6px;
}

.chat-input button {
  margin-left: 12px;
  padding: 12px 20px;
  font-size: 1rem;
  background-color: #3cb371;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

/* Incognito banner */
.incognito-banner {
  background-color: #333;
  color: #fff;
  font-size: 0.9rem;
  padding: 8px;
  margin-top: 10px;
  border-radius: 5px;
  text-align: center;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  z-index: 999;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #1e1e2f;
  color: #fff;
  padding: 30px 40px;
  border-radius: 16px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.3s ease-in-out;
}

.modal-content h2 {
  margin-bottom: 20px;
  font-size: 22px;
  font-weight: 600;
  color: #00ffaa;
}

.modal-content label {
  display: block;
  margin-top: 15px;
  margin-bottom: 5px;
  font-weight: bold;
}

.modal-content select {
  width: 100%;
  padding: 8px 12px;
  font-size: 15px;
  border-radius: 8px;
  border: none;
  outline: none;
  background: #2d2d44;
  color: #fff;
  margin-bottom: 10px;
}

.modal-content button {
  margin-top: 20px;
  width: 100%;
  padding: 10px;
  background: #00ffaa;
  color: #000;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
}

.modal-content button:disabled {
  background: #444;
  cursor: not-allowed;
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Make page layout account for navbar height */
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.navbar {
  flex-shrink: 0;
}

.container {
  flex: 1;
  display: flex;
  height: calc(100vh - 50px); /* 50px matches navbar height */
}

/* Ensure chat-container fills space and input stays fixed */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.chat-input {
  flex-shrink: 0;
  display: flex;
  padding: 10px;
  border-top: 1px solid #333;
  background-color: #1a1a1a;
}
