:root {
  --bg-color: #0d1117;
  --panel-bg: #161b22;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent-color: #2f81f7;
  --accent-hover: #1f6feb;
  --border-color: #30363d;
  --error-color: #f85149;
  --success-color: #2ea043;
  
  --wa-bg: #111b21;
  --wa-panel: #202c33;
  --wa-primary: #00a884;
  --wa-msg-in: #202c33;
  --wa-msg-out: #005c4b;
  --wa-text: #e9edef;
  --wa-text-muted: #8696a0;
  --wa-border: #222d34;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

.auth-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

/* Premium Login & Dashboard Components */
.glass-container {
  background: rgba(22, 27, 34, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-container.large {
  max-width: 800px;
}

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

h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
  background: linear-gradient(90deg, #2f81f7, #a371f7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

p.subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

input {
  width: 100%;
  padding: 12px 16px;
  background: #0d1117;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 16px;
  transition: all 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.2);
}

button {
  width: 100%;
  padding: 14px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.nav-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.nav-tabs a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-tabs a:hover {
  background: rgba(255, 255, 255, 0.05);
}

.nav-tabs a.active {
  color: var(--text-primary);
  background: rgba(47, 129, 247, 0.1);
  color: var(--accent-color);
}

/* WhatsApp Clone UI */
.chat-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: var(--wa-bg);
  overflow: hidden;
  position: relative;
}

.sidebar {
  width: 30%;
  min-width: 280px;
  max-width: 420px;
  border-right: 1px solid var(--wa-border);
  display: flex;
  flex-direction: column;
  background-color: var(--wa-bg);
  height: 100%;
}

.sidebar-header {
  height: 60px;
  min-height: 60px;
  background-color: var(--wa-panel);
  display: flex;
  align-items: center;
  padding: 0 16px;
  justify-content: space-between;
  border-bottom: 1px solid var(--wa-border);
}

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

.contact-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--wa-border);
  cursor: pointer;
  transition: background 0.2s;
}

.contact-item:hover, .contact-item.active {
  background-color: var(--wa-panel);
}

.avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background-color: var(--wa-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 18px;
  font-weight: 600;
  color: white;
  user-select: none;
}

.contact-info {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-weight: 500;
  color: var(--wa-text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-time {
  font-size: 12px;
  color: var(--wa-text-muted);
}

.chat-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background-color: #0b141a;
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  height: 100%;
}

.chat-header {
  height: 60px;
  min-height: 60px;
  background-color: var(--wa-panel);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--wa-border);
  gap: 8px;
}

.back-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--wa-text);
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  width: 36px;
  height: 36px;
  min-width: 36px;
}

.back-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.message {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 8px;
  position: relative;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--wa-text);
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.message span, .message p {
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message.inbound {
  align-self: flex-start;
  background-color: var(--wa-msg-in);
  border-top-left-radius: 0;
}

.message.outbound {
  align-self: flex-end;
  background-color: var(--wa-msg-out);
  border-top-right-radius: 0;
}

.message-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  float: right;
  margin-left: 10px;
  margin-top: 4px;
  user-select: none;
  white-space: nowrap;
}

.chat-input {
  min-height: 62px;
  background-color: var(--wa-panel);
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 10px;
  border-top: 1px solid var(--wa-border);
}

.chat-input input {
  flex: 1;
  background-color: var(--wa-bg);
  border: 1px solid var(--wa-border);
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--wa-text);
  font-size: 15px;
  min-width: 0;
}

.chat-input input:focus {
  border-color: var(--wa-primary);
  outline: none;
}

.chat-input button {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  background-color: var(--wa-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.2s;
}

.chat-input button:hover {
  background-color: #008f70;
  transform: scale(1.04);
}

/* Responsive Styles for Mobile / Small Screens */
@media (max-width: 768px) {
  .chat-layout {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
  }

  .sidebar {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    border-right: none;
    display: flex;
  }

  .chat-area {
    width: 100%;
    min-width: 100%;
    display: none;
  }

  /* Toggling view on mobile when chat is active */
  .chat-layout.has-active-chat .sidebar {
    display: none;
  }

  .chat-layout.has-active-chat .chat-area {
    display: flex;
  }

  .back-btn {
    display: flex;
  }

  .message {
    max-width: 85%;
  }

  .messages {
    padding: 12px;
  }

  .chat-input {
    padding: 8px 10px;
    gap: 8px;
  }
}
