/**
 * 1Dollar.ma — minimal CSS alongside Tailwind CDN.
 * JS-driven states and a few components not covered by utilities.
 */

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* User dropdown: toggled via [data-user-menu].is-open */
[data-user-menu]:not(.is-open) [data-user-menu-panel] {
  display: none;
}

[data-user-menu].is-open [data-user-menu-panel] {
  display: block;
}

/* Mobile nav drawer */
.mobile-nav-panel.is-open {
  display: block !important;
}

/* Home carousel slides */
.home-banner .discover-banner__track {
  position: relative;
  height: 200px;
  overflow: hidden;
  border-radius: 1rem;
}

@media (min-width: 640px) {
  .home-banner .discover-banner__track {
    height: 230px;
  }
}

@media (min-width: 1024px) {
  .home-banner .discover-banner__track {
    height: 250px;
  }
}

.discover-slide {
  display: none;
  position: relative;
  height: 100%;
}

.discover-slide.is-active {
  display: block;
}

.discover-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1rem;
}

.discover-slide__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.75) 100%);
  color: #fff;
}

.discover-slide__overlay h2 {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.discover-slide__overlay p {
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.95;
}

.discover-banner__dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.discover-banner__dots button {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  border: 0;
  background: #cbd5e1;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.discover-banner__dots button.is-active {
  background: #4f46e5;
  transform: scale(1.15);
}

.home-hero-compact {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

@media (min-width: 640px) {
  .home-hero-compact {
    padding-top: 1.4rem !important;
    padding-bottom: 1.4rem !important;
  }
}

.home-niche-strip {
  scrollbar-width: thin;
  scrollbar-color: #c7d2fe transparent;
}

.home-niche-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.home-niche-grid .niche-pill {
  max-width: 100%;
}

.stats-showcase {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 920px) {
  .stats-showcase {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }
}

.stats-showcase__card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgb(203 213 225 / 0.75);
  background:
    radial-gradient(circle at 100% 0%, rgb(255 255 255 / 0.95), rgb(255 255 255 / 0)),
    linear-gradient(140deg, #ffffff 0%, #f8fafc 58%, #eef2ff 100%);
  padding: 1rem 1rem 0.95rem;
  box-shadow:
    0 10px 28px rgb(15 23 42 / 0.08),
    inset 0 1px 0 rgb(255 255 255 / 0.95);
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.55s ease, opacity 0.55s ease, border-color 0.2s ease;
}

.stats-showcase.is-animated .stats-showcase__card {
  transform: translateY(0);
  opacity: 1;
}

.stats-showcase.is-animated .stats-showcase__card:nth-child(2) { transition-delay: 0.08s; }
.stats-showcase.is-animated .stats-showcase__card:nth-child(3) { transition-delay: 0.16s; }
.stats-showcase.is-animated .stats-showcase__card:nth-child(4) { transition-delay: 0.24s; }

.stats-showcase__card::before {
  content: "";
  position: absolute;
  inset: -60% auto -50% -55%;
  width: 80%;
  background: linear-gradient(
    118deg,
    transparent 20%,
    rgb(255 255 255 / 0.65) 48%,
    transparent 72%
  );
  transform: translateX(-58%);
  animation: stats-shine 5.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.stats-showcase__card::after {
  content: "";
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--stat-accent, #4f46e5);
  box-shadow: 0 0 0 0 rgb(79 70 229 / 0.42);
  animation: stats-pulse 2.4s ease-out infinite;
  pointer-events: none;
  z-index: 1;
}

.stats-showcase__chip {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgb(203 213 225 / 0.8);
  background: rgb(255 255 255 / 0.85);
  padding: 0.3rem 0.55rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #475569;
}

.stats-showcase__value {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: 0.7rem;
  font-size: clamp(1.55rem, 2.6vw, 2.25rem);
  line-height: 1;
  font-weight: 800;
  color: var(--stat-accent, #4f46e5);
}

.stats-showcase__label {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: 0.52rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
}

.stats-showcase__line {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: 0.72rem;
  height: 0.18rem;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--stat-accent, #4f46e5), rgb(255 255 255 / 0));
}

@keyframes stats-shine {
  0% { transform: translateX(-58%); opacity: 0.2; }
  45% { opacity: 0.9; }
  100% { transform: translateX(132%); opacity: 0.15; }
}

@keyframes stats-pulse {
  0% { box-shadow: 0 0 0 0 rgb(79 70 229 / 0.42); }
  70% { box-shadow: 0 0 0 11px rgb(79 70 229 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(79 70 229 / 0); }
}

@media (prefers-reduced-motion: reduce) {
  .stats-showcase__card,
  .stats-showcase__card::before,
  .stats-showcase__card::after {
    animation: none !important;
    transition: none !important;
  }
}

.home-niche-strip::-webkit-scrollbar {
  height: 8px;
}

.home-niche-strip::-webkit-scrollbar-thumb {
  background: #c7d2fe;
  border-radius: 999px;
}

/* Register: account type cards */
.account-card.active {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35), 0 8px 24px rgba(79, 70, 229, 0.12);
  background: linear-gradient(135deg, #fff 0%, #eef2ff 100%);
}

/* Dark auth layout (register) */
.auth-dark .account-card.active,
section.mx-auto .account-card.active {
  border-color: rgba(129, 140, 248, 0.9) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%) !important;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35), 0 12px 32px rgba(15, 23, 42, 0.35);
}

/* Keep niche options readable inside OS dropdown list on dark auth forms. */
.register-niche-select option {
  color: #0f172a;
  background-color: #ffffff;
}

/* Emoji toolbar (dashboard, chat, community) */
.emoji-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.625rem;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240 / 0.95);
  background: linear-gradient(to bottom, rgb(248 250 252), rgb(241 245 249 / 0.6));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.8);
}

.emoji-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  min-height: 2.35rem;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.625rem;
  background: #fff;
  padding: 0.2rem;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.12s ease, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.emoji-toolbar button:hover {
  background: #fff;
  border-color: #a5b4fc;
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.06);
  transform: scale(1.06);
}

.emoji-toolbar button:active {
  transform: scale(0.98);
}

/* Status chips (learning + admin) */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.status-pending { color: #a16207; background: #fffbeb; border-color: #fde68a; }
.status-approved { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.status-rejected { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.status-info_requested { color: #b45309; background: #fffbeb; border-color: #fcd34d; }
.status-suspended { color: #991b1b; background: #fef2f2; border-color: #fca5a5; }

.status-learning-not_started {
  border-color: #cbd5e1;
  color: #475569;
  background: #f1f5f9;
}

.status-learning-in_progress {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}

.status-learning-completed {
  border-color: #6ee7b7;
  color: #047857;
  background: #ecfdf5;
}

/* Admin chart columns */
.admin-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 160px;
  padding-top: 0.5rem;
}

.admin-chart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: #64748b;
}

.admin-chart__bar {
  width: 100%;
  max-width: 2.5rem;
  border-radius: 0.35rem 0.35rem 0 0;
  background: linear-gradient(180deg, #6366f1, #8b5cf6);
  min-height: 8px;
  align-self: flex-end;
}

/* Password field + toggle */
.password-field input {
  padding-right: 5rem;
}

/* Video embed */
.video-frame {
  width: 100%;
  border: 0;
  border-radius: 0.75rem;
  min-height: 240px;
  background: #0f172a;
}

/* -------------------------------------------------------------------------
   Legacy utility classes — same visual language as Tailwind `Tw` bundles.
   Pages not yet migrated to inline Tailwind still render consistently.
   ------------------------------------------------------------------------- */

.card {
  border-radius: 1rem;
  border: 1px solid rgb(226 232 240 / 0.85);
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.75rem;
  font-weight: 500;
  color: #334155;
}

.soft-card,
.lesson-card {
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240);
  background: rgb(248 250 252 / 0.9);
  padding: 0.75rem 1rem;
}

.muted,
.helper-text {
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.5;
}

.helper-text {
  font-size: 0.75rem;
  margin-top: 0.35rem;
}

.pill,
.accent-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid rgb(199 210 254 / 0.6);
}

.accent-pill {
  background: #f5f3ff;
  color: #5b21b6;
  border-color: rgb(196 181 253 / 0.5);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 999px;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-outline {
  border: 1px solid rgb(203 213 225);
  background: #fff;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.btn-outline:hover {
  border-color: #a5b4fc;
  background: #f8fafc;
  color: #312e81;
}

.btn-warm {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

.btn-block {
  display: flex;
  width: 100%;
  text-align: center;
}

.btn-small {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.section-gap {
  margin-top: 1.5rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.25rem;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="url"],
form input[type="file"],
form select,
form textarea {
  width: 100%;
  margin-top: 0.35rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
}

form textarea {
  min-height: 100px;
  resize: vertical;
}

.list {
  margin: 0;
  padding-left: 1.25rem;
  color: #475569;
  font-size: 0.9rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Classroom layout */
.classroom-shell {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
}

@media (max-width: 1024px) {
  .classroom-shell {
    grid-template-columns: 1fr;
  }
}

.classroom-sidebar h1 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}

.classroom-sidebar h3 {
  font-size: 0.95rem;
  margin: 1rem 0 0.5rem;
}

.classroom-course-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.classroom-course-list a {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  text-decoration: none;
  color: #334155;
  font-size: 0.875rem;
  transition: border-color 0.15s, background 0.15s;
}

.classroom-course-list a:hover {
  border-color: #c7d2fe;
  background: #f8fafc;
}

.classroom-course-list a.is-active {
  border-color: #6366f1;
  background: #eef2ff;
  color: #312e81;
  font-weight: 600;
}

.classroom-lesson-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.progress-badge {
  text-align: right;
}

.progress-badge strong {
  display: block;
  font-size: 1.5rem;
  color: #4f46e5;
}

.classroom-lessons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.classroom-lessons a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: #334155;
  font-size: 0.85rem;
}

.classroom-lessons a.is-active {
  border-color: #6366f1;
  background: #eef2ff;
}

.classroom-meta-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 0.75rem;
}

.classroom-meta-grid div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.85rem;
}

/* Misc layout helpers */
.table-wrap table {
  width: 100%;
}

.hero-copy h1 {
  font-size: 1.75rem;
  margin: 0.75rem 0;
}

.auth-wrap,
.auth-pro-layout {
  max-width: 560px;
  margin: 0 auto;
}

.register-pro-shell {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

@media (max-width: 960px) {
  .register-pro-shell {
    grid-template-columns: 1fr;
  }
}
