/* TaskPe - WhatsApp Task Earning Platform CSS */
:root {
  --wa-green: #25D366;
  --wa-dark-green: #128C7E;
  --wa-teal: #075E54;
  --wa-light-green: #DCF8C6;
  --primary: #10B981;
  --primary-dark: #059669;
  --dark-bg: #0B1120;
  --card-bg: #1E293B;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Custom Glassmorphism */
.glass-nav {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.glass-card:hover {
  border-color: rgba(37, 211, 102, 0.3);
}

/* WhatsApp Glowing Accent */
.glow-wa {
  box-shadow: 0 0 25px rgba(37, 211, 102, 0.25);
}

.glow-wa-sm {
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.2);
}

/* WhatsApp Chat Bubble Mock */
.wa-chat-bubble {
  background-color: #075E54;
  color: #fff;
  border-radius: 12px 12px 12px 0px;
  position: relative;
}

.wa-chat-bubble-received {
  background-color: #202c33;
  color: #e9edef;
  border-radius: 12px 12px 0px 12px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #25D366;
}

/* Pulse animation for live indicators */
@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0.4; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.live-dot {
  animation: pulse-ring 2s infinite ease-in-out;
}

/* Modal Transitions */
.modal-backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

/* Gradient text */
.text-gradient-wa {
  background: linear-gradient(135deg, #25D366 0%, #34D399 50%, #6EE7B7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-gold {
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Android-first layout: the phone is the primary canvas. */
:root { --bottom-nav-height: 72px; }
html, body { max-width: 100%; overflow-x: hidden; }
body.modal-open { overflow: hidden; }
body { padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
.mobile-nav-btn {
  min-height: 64px; padding: 8px 4px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; color: #94a3b8;
  font-size: 10px; font-weight: 700; transition: color .16s ease, background .16s ease;
}
.mobile-nav-btn i { font-size: 18px; }
.mobile-nav-btn.is-active { color: #34d399; background: rgba(16, 185, 129, .10); }

@media (max-width: 767px) {
  body { font-size: 15px; }
  main > section { padding-top: 1.25rem !important; padding-bottom: 1.75rem !important; }
  .glass-card { backdrop-filter: none; }
  .glass-card:hover { border-color: rgba(255,255,255,.07); }
  .glass-nav { position: sticky; top: 0; }
  header .max-w-7xl { padding-left: 1rem; padding-right: 1rem; }
  header .h-16 { height: 3.75rem; }
  header .w-10 { width: 2.25rem; height: 2.25rem; }
  header .text-xl { font-size: 1.1rem; }
  #auth-buttons-logged-out button { min-height: 44px; padding-left: .75rem; padding-right: .75rem; }
  #auth-buttons-logged-in { gap: .5rem; }
  #auth-buttons-logged-in > div:first-child { display: none; }
  #user-dropdown-menu { position: fixed; right: 1rem; top: 4.5rem; width: min(20rem, calc(100vw - 2rem)); }
  aside[aria-label="Demo environment switcher"] { padding: .5rem .75rem; align-items: stretch; }
  aside[aria-label="Demo environment switcher"] > div:last-child { width: 100%; display: grid; grid-template-columns: 1fr 1fr 44px; gap: .4rem; }
  aside[aria-label="Demo environment switcher"] button { min-height: 42px; justify-content: center; font-size: 10px; padding: .35rem; }
  .marquee-wrapper { min-width: 0; }
  #view-home { padding-top: 2rem !important; }
  #view-home h1 { font-size: clamp(2rem, 10vw, 2.65rem); line-height: 1.12; }
  #view-home .max-w-6xl > .flex.flex-wrap { display: grid; grid-template-columns: 1fr; gap: .75rem; margin-bottom: 2.5rem; }
  #view-home .max-w-6xl > .flex.flex-wrap > button { width: 100%; min-height: 52px; justify-content: center; }
  #earner-stats-strip { gap: .75rem; margin-bottom: 1.25rem; }
  #earner-stats-strip .glass-card { padding: 1rem; }
  #tasks-grid { grid-template-columns: minmax(0, 1fr); gap: .9rem; }
  #tasks-grid .glass-card { padding: 1rem; }
  .filter-btn { min-height: 44px; flex: 0 0 auto; padding: .5rem .85rem !important; }
  #view-tasks > div:has(.filter-btn) { overflow-x: auto; scrollbar-width: none; }
  #view-tasks > div:has(.filter-btn) > div:last-child { width: max-content; min-width: 100%; }
  #view-task-detail .glass-card { padding: 1rem; border-radius: 1.25rem; }
  #view-task-detail h1 { font-size: 1.45rem; line-height: 1.25; }
  #task-timer-display { position: sticky; top: 4.25rem; z-index: 10; font-size: 1rem; }
  #detail-numbers-list { max-height: none; grid-template-columns: minmax(0, 1fr); }
  #detail-numbers-list > div { padding: .75rem; flex-wrap: wrap; row-gap: .5rem; }
  #detail-numbers-list > div > div:last-child { margin-left: auto; }
  #detail-numbers-list a, #detail-numbers-list button { min-height: 44px; }
  #proof-dropzone { min-height: 170px; padding: 1.25rem; display: flex; align-items: center; justify-content: center; }
  #submit-proof-btn { min-height: 52px; position: sticky; bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + .5rem); z-index: 15; }
  #view-wallet .glass-card { padding: 1rem; }
  #view-wallet .text-4xl { font-size: 2.25rem; }
  #view-wallet .overflow-x-auto { overflow: visible; }
  #view-wallet table thead { display: none; }
  #view-wallet table, #view-wallet tbody, #view-wallet tr, #view-wallet td { display: block; width: 100%; }
  #view-wallet tr { padding: .75rem 0; border-bottom: 1px solid rgba(51,65,85,.6); }
  #view-wallet td { padding: .18rem 0 !important; text-align: left !important; }
  #view-wallet td:last-child { font-weight: 700; color: #34d399; }
  #view-admin { padding-left: .75rem !important; padding-right: .75rem !important; }
  #view-admin .overflow-x-auto { overflow: visible; }
  #view-admin table thead { display: none; }
  #view-admin table, #view-admin tbody, #view-admin tr, #view-admin td { display: block; width: 100%; }
  #view-admin tr { margin-bottom: .75rem; padding: .8rem; border: 1px solid #334155; border-radius: .9rem; background: rgba(15,23,42,.65); }
  #view-admin td { padding: .25rem 0 !important; text-align: left !important; }
  #view-admin td:last-child { text-align: left !important; }
  #view-admin .admin-tab { min-height: 48px; padding: .5rem .75rem; white-space: nowrap; }
  #view-admin > div:has(.admin-tab) { overflow-x: auto; }
  [id^="modal-"] { align-items: flex-end !important; padding: 0 !important; }
  [id^="modal-"] > .glass-card { width: 100% !important; max-width: none !important; max-height: min(92dvh, 760px) !important; border-radius: 1.5rem 1.5rem 0 0 !important; overflow-y: auto !important; padding: 1.25rem !important; }
  [id^="modal-"] button { min-height: 44px; }
  input, select, textarea { min-height: 48px !important; font-size: 16px !important; }
  textarea { min-height: 96px !important; }
}

@media (min-width: 768px) { body { padding-bottom: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
