:root {
  --bg: #050a14;
  --cyan: #00d1ff;
  --glass: rgba(15, 23, 42, 0.8);
  --border: rgba(0, 209, 255, 0.2);
}

body {
  margin: 0;
  background: var(--bg);
  color: #e2e8f0;
  font-family: "Outfit", sans-serif;
  height: 100vh;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* --- LOGIN SCREEN --- */
#login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #0a192f 0%, #050a14 100%);
  z-index: 9999;
}

.login-box {
  background: var(--glass);
  padding: 3rem;
  border-radius: 30px;
  border: 1px solid var(--border);
  text-align: center;
  max-width: 400px;
  width: 80%;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.main-icon {
  font-size: 5rem;
  color: var(--cyan);
  margin-bottom: 1rem;
}
.login-box h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 3px;
}
.login-box input {
  width: calc(100% - 35px);
  padding: 1rem;
  margin: 2rem 0 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: white;
  text-align: center;
}
.login-box button {
  width: 100%;
  padding: 1rem;
  background: var(--cyan);
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

/* --- MAIN APP LAYOUT --- */
#main-app {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 300px;
  background: rgba(0, 0, 0, 0.3);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 600;
  color: var(--cyan);
}

#user-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s;
  margin-bottom: 0.5rem;
}
.user-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.user-avatar {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
  gap: 0.5rem;
}

.tab {
  padding: 1rem 1.5rem;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  transition: 0.3s;
}
.tab.active {
  border-color: var(--cyan);
  background: rgba(0, 209, 255, 0.05);
}

#chat-windows {
  flex: 1;
  position: relative;
}
.chat-window {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
}
.chat-window.active {
  display: flex;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.message {
  max-width: 70%;
  padding: 1rem 1.5rem;
  border-radius: 15px;
  position: relative;
  animation: fadeIn 0.2s ease-out;
}
.message.sent {
  align-self: flex-end;
  background: rgba(0, 209, 255, 0.1);
  border-bottom-right-radius: 2px;
}
.message.received {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border-bottom-left-radius: 2px;
}

.msg-user {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  display: block;
}
.msg-text {
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
}
.msg-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 0.6rem;
  display: block;
  text-align: right;
  font-family: "JetBrains Mono", monospace;
}

.system-msg {
  align-self: center;
  background: rgba(0, 209, 255, 0.05);
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  font-style: italic;
  border: 1px solid rgba(0, 209, 255, 0.1);
}

.msg-file {
  color: var(--cyan);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#typing-indicator {
  height: 20px;
  padding: 0 2rem;
  font-size: 0.7rem;
  color: var(--cyan);
  font-style: italic;
}

.input-container {
  padding: 1.5rem 2rem;
  display: flex;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.2);
}

#message-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
  color: white;
  outline: none;
}

.attach-btn,
#send-btn {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 209, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  color: var(--cyan);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
