/* Reset + base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: #121212;
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* AUTH SCREEN */
#auth-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  background: #121212;
}

#auth-screen h1 {
  margin-bottom: 20px;
  font-size: 2rem;
}

#auth-form {
  display: flex;
  flex-direction: column;
  width: 90%;
  max-width: 400px;
}

#auth-form input {
  margin: 5px 0;
  padding: 10px;
  border-radius: 8px;
  border: none;
  outline: none;
}

#auth-form button {
  margin: 5px 0;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background-color: #3897f0;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
}

#auth-form button:hover {
  background-color: #2a76c3;
}

#auth-msg {
  margin-top: 10px;
  color: #ff5555;
}

/* APP SCREEN */
#app-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

/* STORIES BAR */
#stories-bar {
  display: flex;
  align-items: center;
  padding: 10px;
  overflow-x: auto;
  background-color: #1c1c1c;
}

.story-item {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #333;
  margin-right: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1rem;
  text-align: center;
}

#stories-container {
  display: flex;
  gap: 10px;
}

/* CHAT LIST */
#chat-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px;
  overflow-y: auto;
  background-color: #121212;
}

#new-chat {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

#new-chat input {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: none;
  outline: none;
}

#new-chat button {
  padding: 8px;
  border-radius: 8px;
  border: none;
  background-color: #3897f0;
  color: #fff;
  cursor: pointer;
}

#chats-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* CHAT WINDOW */
#chat-window {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #121212;
}

#chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: #1c1c1c;
  font-weight: bold;
}

#messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.message {
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 15px;
  word-wrap: break-word;
}

.message.sent {
  background-color: #3897f0;
  align-self: flex-end;
  color: #fff;
}

.message.received {
  background-color: #2c2c2c;
  align-self: flex-start;
  color: #fff;
}

/* CHAT INPUT */
#chat-input-area {
  display: flex;
  padding: 10px;
  gap: 5px;
  background-color: #1c1c1c;
}

#chat-input-area input {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: none;
  outline: none;
}

#chat-input-area button {
  padding: 8px;
  border-radius: 8px;
  border: none;
  background-color: #3897f0;
  color: #fff;
  cursor: pointer;
}

/* SETTINGS PANEL */
#settings-panel {
  position: absolute;
  top: 50px;
  right: 20px;
  width: 250px;
  background-color: #1c1c1c;
  padding: 15px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

#settings-panel input,
#settings-panel select {
  padding: 8px;
  border-radius: 8px;
  border: none;
  outline: none;
}

/* LOCKED GROUP */
#locked-group {
  background-color: #2c2c2c;
  padding: 10px;
  margin: 10px;
  border-radius: 8px;
  text-align: center;
}

/* LIGHT THEME */
body.light {
  background-color: #fefefe;
  color: #000;
}

body.light #auth-screen,
body.light #chat-list,
body.light #chat-window,
body.light #stories-bar {
  background-color: #fff;
  color: #000;
}

body.light .message.sent {
  background-color: #007bff;
  color: #fff;
}

body.light .message.received {
  background-color: #e1e1e1;
  color: #000;
}

body.light #settings-panel {
  background-color: #f2f2f2;
}
