/* ========================= */
/* 1. GLOBAL RESET           */
/* ========================= */
* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  margin: 0;
  height: 100vh;
  background: #050505;
  color: #ffffff;
  /* Default: Center content (for Login Page) */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden; 
}

/* ========================= */
/* 2. LOGIN PAGE (Container) */
/* ========================= */
.container {
  background: #0c0c0c;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  width: 360px;
  padding: 30px;
  box-shadow: 0 0 30px rgba(0, 255, 150, 0.08);
  text-align: center;
}

.logo {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 5px;
}

.tagline {
  color: #8a8a8a;
  margin-bottom: 25px;
}

.app-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  display: block;
  object-fit: contain;
}

/* FORMS */
label {
  display: block;
  text-align: left;
  margin-bottom: 6px;
  font-size: 14px;
  color: #bdbdbd;
}

input, select {
  width: 100%;
  padding: 12px;
  background: #111;
  border: 1px solid #222;
  border-radius: 8px;
  color: white;
  margin-bottom: 18px;
  font-size: 15px;
}

input:focus, select:focus {
  outline: none;
  border-color: #00d084;
}

.checkbox-container {
  display: flex; 
  align-items: center; 
  gap: 8px; 
  margin-bottom: 18px;
}

.checkbox-container input {
  width: auto;
  margin-bottom: 0;
}

.checkbox-container label {
  margin-bottom: 0;
  cursor: pointer;
}

/* ALERTS */
#formMessage {
  margin-bottom: 14px;
  font-size: 13px;
  text-align: center;
  min-height: 16px;
}

.error { color: #ff4d4d; }
.success { color: #00d084; }

/* GENERIC BUTTONS */
button {
  width: 100%;
  padding: 14px;
  background: #00d084;
  border: none;
  border-radius: 10px;
  color: #000;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #00b873;
}

/* ========================= */
/* 3. USERS & INBOX PAGE     */
/* ========================= */
.users-page {
  background: #050505;
  color: #ffffff;
  min-height: 100vh;
  width: 100%;           
  display: flex;
  flex-direction: column;
  align-items: stretch; 
  justify-content: flex-start;
  margin: 0;
  padding: 0;
}

/* TOP BAR */
.topbar {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #0c0c0c;
  border-bottom: 1px solid #1f1f1f;
  flex-shrink: 0;
  position: relative;
}

/* 🔥 FIX: LOGO & NAME WRAPPER */
.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 🔥 FIX: LOGO SIZE LIMIT */
.top-logo {
  height: 32px; /* Keeps logo small */
  width: auto;
  display: block;
}

/* 🔥 FIX: BRAND NAME (Next to Logo) */
.brand-name {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
}

/* 🔥 FIX: PAGE TITLE (Centered - For Inbox) */
.page-title {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none; /* Lets clicks pass through */
}

/* BACK BUTTON */
.back-btn {
  width: 40px !important; 
  height: 40px !important;
  background: transparent !important;
  border: none !important;
  color: #00d084 !important;
  font-size: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.inbox-btn {
  background: none;
  border: 1px solid #00d084;
  color: #00d084;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

/* FILTER SECTION */
.filter-section {
  width: 100%;
  padding: 12px 24px;
  border-bottom: 1px solid #1f1f1f;
  background: #050505;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-section select {
  width: auto;
  min-width: 120px;
  padding: 8px 12px;
  margin: 0;
}

.logout-btn {
  width: auto !important;
  background-color: #ff4d4d;
  color: white;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

.logout-btn:hover {
  background-color: #d93636;
}

/* USERS LIST */
.users-container {
  width: 100%;
  padding: 20px 24px;
  flex: 1;
  overflow-y: auto;
}

.status-text {
  font-size: 14px;
  color: #8a8a8a;
  text-align: center;
  margin-top: 20px;
}

/* USER CARDS */
.user-card {
  background: #0c0c0c;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.user-card:hover {
  border-color: #333;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.user-name {
  font-size: 16px;
  font-weight: bold;
  color: #fff;
}

.user-meta {
  font-size: 14px;
  color: #9a9a9a;
  margin-top: 6px;
}

/* BADGES */
.unread-badge {
  background-color: #ff4d4d;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.4);
}

/* ========================= */
/* 4. CHAT PAGE              */
/* ========================= */
.chat-page {
  background: #050505;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden; 
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  border-bottom: 1px solid #1f1f1f;
  background: #0c0c0c;
  position: relative;
  flex-shrink: 0;
}

.chat-header .back-btn {
  position: absolute;
  left: 16px;
}

.chat-user-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chat-username {
  font-size: 16px;
  font-weight: bold;
  color: #fff;
}

.chat-meta {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

/* MESSAGES */
.chat-messages {
  flex: 1;
  padding: 20px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.message {
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.4;
  word-wrap: break-word;
  max-width: 75%;
  border-radius: 18px;
  position: relative;
}

.sent {
  align-self: flex-end;
  background: #00d084;
  color: #000;
  border-bottom-right-radius: 4px;
}

.received {
  align-self: flex-start;
  background: #1f1f1f;
  color: #fff;
  border-bottom-left-radius: 4px;
}

/* INPUT AREA */
.chat-input {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 16px;
  background: #0c0c0c;
  border-top: 1px solid #1f1f1f;
  width: 100%;
  flex-shrink: 0;
}

.chat-input textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 12px 14px;
  border-radius: 22px;
  border: 1px solid #333;
  background: #111;
  color: #fff;
  font-size: 15px;
  resize: none;
  outline: none;
}

.chat-input textarea:focus {
  border-color: #00d084;
}

.chat-input button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #00d084;
  color: #000;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ========================= */
/* 5. MODALS                 */
/* ========================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: #111;
  border: 1px solid #333;
  padding: 24px;
  border-radius: 12px;
  width: 300px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.modal-box h3 { margin-top: 0; color: #fff; }
.modal-box p { color: #aaa; font-size: 14px; margin-bottom: 20px; }

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.cancel-btn {
  background: #222;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  width: auto;
}

.delete-btn {
  background: #ff4d4d;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  width: auto;
}

.delete-btn:hover { background: #d93636; }

@media (max-width: 480px) {
  .container {
    width: 92%;
    padding: 24px;
  }
  .logo { font-size: 26px; }
}

/* ========================= */
/* 7. ADSENSE & SEO UPDATES  */
/* ========================= */

/* SEO SECTION (Below Login) */
.seo-section {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
  text-align: center;
  color: #888;
  line-height: 1.6;
}

.seo-section h2 {
  color: #fff;
  font-size: 20px;
  margin-bottom: 15px;
}

.seo-section p {
  margin-bottom: 15px;
  font-size: 15px;
}

/* FOOTER */
.site-footer {
  width: 100%;
  background: #0c0c0c;
  border-top: 1px solid #1f1f1f;
  padding: 30px 20px;
  text-align: center;
  margin-top: auto; /* Pushes footer to bottom */
  flex-shrink: 0;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #888;
  text-decoration: none;
  font-size: 14px;
}

.footer-links a:hover {
  color: #00d084;
}

.copyright {
  color: #555;
  font-size: 12px;
}

/* POLICY PAGES (Privacy, Terms, Contact) */
.policy-body {
  background: #050505;
  color: #ddd;
  padding: 40px 20px;
  display: block; /* Override flex centering */
  height: auto;
  min-height: 100vh;
}

.policy-container {
  max-width: 800px;
  margin: 0 auto;
  background: #0c0c0c;
  padding: 40px;
  border-radius: 12px;
  border: 1px solid #1f1f1f;
}

.policy-container h1 {
  color: #00d084;
  margin-bottom: 20px;
}

.policy-container h2 {
  color: #fff;
  margin-top: 30px;
  margin-bottom: 10px;
}

.policy-container p {
  line-height: 1.6;
  margin-bottom: 15px;
  color: #bbb;
}

.policy-container ul {
  margin-bottom: 15px;
  padding-left: 20px;
  color: #bbb;
}

.policy-container li {
  margin-bottom: 8px;
}