/* ====================================================
   ANMOL API - WHATSAPP CLOUD SAAS STYLESHEET
   100% Mobile-First Responsive CSS Architecture
   ==================================================== */

:root {
  --bg-dark: #0b141a;
  --bg-card: #111b21;
  --bg-hover: #202c33;
  --wa-green: #25d366;
  --wa-teal: #00a884;
  --meta-blue: #0084ff;
  --text-main: #e9edef;
  --text-muted: #8696a0;
  --border-color: rgba(134, 150, 160, 0.15);
  --accent-purple: #8a2be2;
  --accent-amber: #f59e0b;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body.dark-theme {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ----------------------------------------------------
   HEADER NAVIGATION BAR
   ---------------------------------------------------- */
.app-header {
  height: 60px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.drawer-toggle-btn:hover {
  background: var(--bg-hover);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--wa-green), var(--wa-teal));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.5px;
  color: #fff;
  line-height: 1.1;
}

.brand-sub {
  font-size: 10px;
  color: var(--wa-green);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-wrapper {
  position: relative;
}

.notif-bell-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-hover);
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.user-pill img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.user-info-text {
  display: flex;
  flex-direction: column;
}

.user-pill-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  line-height: 1.1;
}

.user-pill-role {
  font-size: 9.5px;
  color: var(--text-muted);
}

.logout-header-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.logout-header-btn:hover {
  background: #ef4444;
  color: #fff;
}

/* ----------------------------------------------------
   SIDE DRAWER MENU
   ---------------------------------------------------- */
.app-drawer {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-color);
  z-index: 1000;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.app-drawer.open {
  left: 0;
}

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

.drawer-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.drawer-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
}

.nav-item:hover, .nav-item.active {
  background-color: var(--bg-hover);
  color: var(--wa-green);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 4px;
  background-color: var(--wa-green);
  border-radius: 0 4px 4px 0;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.nav-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 12px 0;
}

.drawer-logout-btn {
  width: 100%;
  padding: 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ----------------------------------------------------
   MAIN VIEWPORT & GLASS PANELS
   ---------------------------------------------------- */
.app-viewport {
  flex: 1;
  padding: 16px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 80px; /* Space for mobile bottom dock */
}

.glass-panel {
  background: rgba(17, 27, 33, 0.75);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(12px);
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-heading {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.page-subheading {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ----------------------------------------------------
   CODE URL BOX (PRETTIEST & SLEEKEST ELEGANT STYLING)
   ---------------------------------------------------- */
.code-url-box {
  background: #111b21;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(37, 211, 102, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.code-url-text {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--wa-green);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE */
  flex: 1;
}

.code-url-text::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* ----------------------------------------------------
   STATS & CARDS GRID
   ---------------------------------------------------- */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(37, 211, 102, 0.12);
  color: var(--wa-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-heading);
}

/* ----------------------------------------------------
   INBOX LIVE CHAT MOBILE RESPONSIVE UI
   ---------------------------------------------------- */
.inbox-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 120px);
  min-height: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
}

.inbox-contacts-view {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: #111b21;
}

.contacts-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

.contact-item:hover, .contact-item.active {
  background: var(--bg-hover);
}

.contact-item img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

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

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

.contact-name {
  font-weight: 600;
  color: #fff;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.contact-msg-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contact-last-msg {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unread-badge {
  background: var(--wa-green);
  color: #0b141a;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

.inbox-chat-view {
  display: flex;
  flex-direction: column;
  background: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
  background-size: 24px 24px;
}

.chat-header {
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-to-contacts-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.chat-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.chat-user-name {
  font-weight: 600;
  color: #fff;
  font-size: 14px;
}

.chat-user-status {
  font-size: 11px;
  color: var(--wa-green);
}

.chat-messages-area {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  position: relative;
  word-break: break-word;
}

.chat-bubble.incoming {
  align-self: flex-start;
  background: #202c33;
  color: #fff;
  border-top-left-radius: 2px;
}

.chat-bubble.outgoing {
  align-self: flex-end;
  background: #005c4b;
  color: #fff;
  border-top-right-radius: 2px;
}

.chat-bubble-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
}

.tick-icon {
  font-size: 12px;
}

.tick-icon.sent { color: #8696a0; }
.tick-icon.delivered { color: #8696a0; }
.tick-icon.read { color: #53bdeb; }

.media-card-img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 6px;
}

.media-card-video, .media-card-audio {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 6px;
}

.chat-input-bar {
  padding: 12px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-input {
  flex: 1;
  background: #2a3942;
  border: none;
  color: #fff;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 13.5px;
  outline: none;
}

.chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--wa-teal);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* ----------------------------------------------------
   FORM CONTROLS
   ---------------------------------------------------- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--wa-green);
}

.btn-primary {
  background: linear-gradient(135deg, var(--wa-green), var(--wa-teal));
  color: #0b141a;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
  transition: opacity 0.2s;
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

/* ----------------------------------------------------
   MOBILE BOTTOM TOUCH DOCK NAVIGATION
   ---------------------------------------------------- */
.mobile-bottom-dock {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 60px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  z-index: 900;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  backdrop-filter: blur(12px);
}

.dock-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  padding: 6px 0;
}

.dock-btn.active, .dock-btn:hover {
  color: var(--wa-green);
}

.dock-btn i {
  font-size: 18px;
}

.icon-rel {
  position: relative;
}

.dock-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 10px;
}

/* ----------------------------------------------------
   PACKAGES & PRICING
   ---------------------------------------------------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.price-card.popular {
  border-color: var(--wa-green);
  box-shadow: 0 0 20px rgba(37, 211, 102, 0.15);
}

.price-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--wa-green);
  color: #0b141a;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
}

.price-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.price-amount {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  margin: 12px 0 4px;
}

.price-pkr {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ----------------------------------------------------
   NOTIFICATION DROPDOWN & TOASTS
   ---------------------------------------------------- */
.notif-dropdown {
  position: absolute;
  top: 45px;
  right: 0;
  width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow: hidden;
}

.notif-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-header h4 {
  font-size: 13px;
  color: #fff;
}

.mark-all-read {
  font-size: 11px;
  color: var(--wa-green);
  cursor: pointer;
}

.notif-list {
  max-height: 300px;
  overflow-y: auto;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

.notif-item.unread {
  background: rgba(37, 211, 102, 0.05);
}

.notif-item-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.notif-item-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.toast-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #202c33;
  color: #fff;
  border: 1px solid var(--wa-green);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.3s ease;
}

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

/* ----------------------------------------------------
   RESPONSIVE MEDIA QUERIES (320px - 768px MOBILE)
   ---------------------------------------------------- */
@media (max-width: 768px) {
  .inbox-container {
    grid-template-columns: 1fr;
  }

  .inbox-chat-view.mobile-hidden {
    display: none;
  }

  .inbox-contacts-view.mobile-hidden {
    display: none;
  }

  .back-to-contacts-btn {
    display: block;
  }

  .logout-text {
    display: none;
  }

  .user-info-text {
    display: none;
  }
}
