:root {
  --primary-color: #25D366;
  --secondary-color: #075E54;
  --bg-color: #f0f2f5;
  --card-bg: #ffffff;
  --text-primary: #41525d;
  --text-secondary: #667781;
  --accent-color: #008069;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --border-radius: 16px;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg-color: #111b21;
  --card-bg: #222e35;
  --text-primary: #e9edef;
  --text-secondary: #8696a0;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  flex: 1;
}

/* Simple Login UI */
.simple-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  padding: 20px;
}

.login-header {
  background: white;
  padding: 30px 60px;
  border-radius: 20px 20px 0 0;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 450px;
}

.login-header h1 {
  font-size: 1.8rem;
  color: #41525d;
  font-weight: 600;
}

#qrcode-container {
  background: white;
  padding: 40px;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 350px;
  position: relative;
  border-top: 1px solid #f0f0f0;
}

#qrcode-container img {
  width: 100%;
  max-width: 250px;
  border: 1px solid #eee;
  padding: 10px;
  border-radius: 10px;
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #25D366;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.status-msg {
  margin-top: 30px;
  color: white;
  font-weight: 300;
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Success Message */
.success-message {
  text-align: center;
}

.check-icon {
  font-size: 4rem;
  color: #25D366;
  margin-bottom: 20px;
}

/* Chat Interface Styles (Keeping the existing one but ensuring it works) */
.chat-app {
  display: flex;
  height: 100vh;
  width: 100vw;
  background: var(--bg-color);
  overflow: hidden;
}

.sidebar {
  width: 400px;
  background: var(--card-bg);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  height: 60px;
  padding: 10px 16px;
  background: #f0f2f5;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-avatar,
.chat-avatar {
  width: 40px;
  height: 40px;
  background: #dfe5e7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #54656f;
}

.search-bar {
  padding: 8px 12px;
}

.search-bar input {
  width: 100%;
  padding: 8px 15px;
  border-radius: 8px;
  border: none;
  background: #f0f2f5;
  outline: none;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
}

.chat-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  border-bottom: 1px solid #f5f6f6;
}

.chat-item:hover {
  background: #f5f6f6;
}

.chat-item.active {
  background: #ebebeb;
}

.chat-info {
  flex: 1;
  overflow: hidden;
}

.chat-header-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}

.chat-name {
  font-weight: 500;
  color: #111b21;
}

.chat-time {
  font-size: 0.75rem;
  color: #667781;
}

.chat-last-msg {
  font-size: 0.85rem;
  color: #667781;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #efeae2;
}

.chat-window-header {
  height: 60px;
  padding: 10px 16px;
  background: #f0f2f5;
  display: flex;
  align-items: center;
  gap: 15px;
}

.message-container {
  flex: 1;
  padding: 20px 5%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.message {
  max-width: 65%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.sent {
  align-self: flex-end;
  background: #d9fdd3;
}

.received {
  align-self: flex-start;
  background: #ffffff;
}

.chat-footer {
  padding: 10px;
  background: #f0f2f5;
  display: flex;
  gap: 10px;
}

.chat-footer input {
  flex: 1;
  padding: 10px 15px;
  border-radius: 8px;
  border: none;
  outline: none;
}

.send-btn {
  background: #25D366;
  color: white;
  border: none;
  padding: 0 20px;
  border-radius: 8px;
  cursor: pointer;
}