/* ============================================================
   SAMAEVENT – Layout : Header + Bottom Nav + Pages
   ============================================================ */

/* ─────────────────────────────────────────
   HEADER COMPACT (sticky top)
   ───────────────────────────────────────── */
.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-content);
  height: var(--header-h);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  padding: 0 var(--page-pad);
  z-index: var(--z-sticky);
  transition: box-shadow var(--duration-base);
  gap: var(--space-3);
}

.app-header.scrolled {
  box-shadow: var(--shadow-md);
  border-bottom-color: transparent;
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  text-decoration: none;
}
.header-logo__mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(224,98,42,.3);
}
.header-logo__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  color: var(--color-text);
  letter-spacing: -0.5px;
}
.header-logo__name span { color: var(--color-primary); }

/* Header right actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.header-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--duration-fast);
  color: var(--color-text-2);
  font-size: 20px;
  position: relative;
  text-decoration: none;
}
.header-btn:hover  { background: var(--color-bg-2); }
.header-btn:active { background: var(--color-border); }

/* Notification badge on header btn */
.header-btn__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  background: var(--color-error);
  color: white;
  font-size: 10px;
  font-weight: var(--weight-bold);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--color-surface);
}

/* Header with back button (inner pages) */
.app-header--inner {
  justify-content: flex-start;
}
.header-back {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--color-text);
  cursor: pointer;
  margin-right: var(--space-2);
  transition: background var(--duration-fast);
}
.header-back:active { background: var(--color-bg-2); }

.header-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Transparent header variant (for hero pages) */
.app-header--transparent {
  background: transparent;
  border-bottom-color: transparent;
}
.app-header--transparent .header-logo__name,
.app-header--transparent .header-btn { color: white; }
.app-header--transparent .header-logo__name span { color: var(--color-accent); }
.app-header--transparent.scrolled {
  background: var(--color-surface);
  border-bottom-color: var(--color-border-light);
}
.app-header--transparent.scrolled .header-logo__name { color: var(--color-text); }
.app-header--transparent.scrolled .header-logo__name span { color: var(--color-primary); }
.app-header--transparent.scrolled .header-btn { color: var(--color-text-2); }

/* ─────────────────────────────────────────
   BOTTOM NAVIGATION (fixed)
   ───────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-content);
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  z-index: var(--z-sticky);
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -4px 20px rgba(28,20,16,.06);
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  transition: color var(--duration-fast);
  color: var(--color-text-3);
  -webkit-user-select: none;
  user-select: none;
}

.bottom-nav__item:active { opacity: 0.7; }

.bottom-nav__icon {
  font-size: 22px;
  line-height: 1;
  position: relative;
  transition: transform var(--duration-fast) var(--ease-out);
}
.bottom-nav__item.active .bottom-nav__icon { transform: scale(1.15); }

.bottom-nav__label {
  font-size: 10px;
  font-weight: var(--weight-semi);
  letter-spacing: 0.2px;
  line-height: 1;
  transition: color var(--duration-fast);
}

.bottom-nav__badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  background: var(--color-error);
  color: white;
  font-size: 9px;
  font-weight: var(--weight-bold);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--color-surface);
}

/* Active state */
.bottom-nav__item.active {
  color: var(--color-primary);
}

/* Center action button (Publier) */
.bottom-nav__item--center .bottom-nav__icon-wrap {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  box-shadow: 0 4px 16px rgba(224,98,42,.4);
  margin-top: -12px;
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast);
}
.bottom-nav__item--center:active .bottom-nav__icon-wrap {
  transform: scale(0.9);
}
.bottom-nav__item--center .bottom-nav__icon {
  transform: none !important;
  font-size: inherit;
}
.bottom-nav__item--center .bottom-nav__label {
  color: var(--color-text-3);
  margin-top: 2px;
}

/* ─────────────────────────────────────────
   HOME HERO BANNER
   ───────────────────────────────────────── */
.hero-banner {
  position: relative;
  min-height: 240px;
  background: linear-gradient(160deg, var(--color-secondary-dark) 0%, var(--color-secondary) 60%, var(--color-primary) 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-6) var(--page-pad);
  margin-top: calc(-1 * var(--header-h));
  padding-top: calc(var(--header-h) + var(--space-6));
}

.hero-banner__pattern {
  position: absolute;
  inset: 0;
  opacity: .06;
  background-image:
    radial-gradient(circle at 20% 50%, white 2px, transparent 2px),
    radial-gradient(circle at 80% 20%, white 1px, transparent 1px),
    radial-gradient(circle at 60% 80%, white 3px, transparent 3px);
  background-size: 60px 60px, 40px 40px, 80px 80px;
}

.hero-banner__tagline {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  color: rgba(255,255,255,.7);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.hero-banner__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  color: white;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-5);
}
.hero-banner__title em {
  font-style: normal;
  color: var(--color-accent);
}

.hero-search-wrap {
  position: relative;
  z-index: 2;
}

/* ─────────────────────────────────────────
   PAGE SECTIONS LAYOUT
   ───────────────────────────────────────── */
.page-section {
  padding: var(--space-6) 0 var(--space-2);
}
.page-section--flush {
  padding: 0;
}

/* ─────────────────────────────────────────
   GRID LAYOUTS
   ───────────────────────────────────────── */
.providers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  padding: 0 var(--page-pad);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  padding: 0 var(--page-pad);
}

/* ─────────────────────────────────────────
   PROFILE PAGE LAYOUT
   ───────────────────────────────────────── */
.profile-cover {
  height: 200px;
  background: var(--color-bg-2);
  overflow: hidden;
  position: relative;
}
.profile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-cover__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(28,20,16,.5) 100%);
}

.profile-info-bar {
  padding: 0 var(--page-pad);
  margin-top: calc(-1 * var(--space-8));
  position: relative;
  z-index: 2;
}

.profile-avatar-wrap {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  border: 3px solid var(--color-surface);
  overflow: hidden;
  background: var(--color-bg-2);
  box-shadow: var(--shadow-md);
}

/* ─────────────────────────────────────────
   DASHBOARD STATS CARDS
   ───────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  padding: 0 var(--page-pad);
}

.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border-light);
}
.stat-card__value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  color: var(--color-text);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card__label {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  font-weight: var(--weight-medium);
}
.stat-card__icon {
  font-size: 22px;
  margin-bottom: var(--space-2);
}

/* ─────────────────────────────────────────
   HOW IT WORKS
   ───────────────────────────────────────── */
.how-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 0 var(--page-pad);
}
.how-step {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}
.how-step__number {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  font-size: var(--text-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(224,98,42,.3);
}
.how-step__content { flex: 1; }
.how-step__title {
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin-bottom: 4px;
}
.how-step__text {
  font-size: var(--text-sm);
  color: var(--color-text-3);
  line-height: var(--leading-loose);
}

/* ─────────────────────────────────────────
   TRUST BANNER
   ───────────────────────────────────────── */
.trust-banner {
  background: linear-gradient(135deg, var(--color-secondary-dark), var(--color-secondary));
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  margin: 0 var(--page-pad);
  color: white;
  position: relative;
  overflow: hidden;
}
.trust-banner::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.trust-banner::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(245,200,66,.08);
}
.trust-banner__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  margin-bottom: var(--space-2);
  position: relative;
  z-index: 1;
}
.trust-banner__text {
  font-size: var(--text-sm);
  opacity: .8;
  line-height: var(--leading-loose);
  margin-bottom: var(--space-5);
  position: relative;
  z-index: 1;
}
.trust-banner .btn { position: relative; z-index: 1; }

/* ─────────────────────────────────────────
   FORM MULTI-STEP LAYOUT
   ───────────────────────────────────────── */
.form-step { display: none; }
.form-step.active { display: block; }

.form-step-header {
  padding: var(--space-5) var(--page-pad) var(--space-4);
}
.form-step-header__step {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: var(--weight-semi);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.form-step-header__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  color: var(--color-text);
  line-height: var(--leading-snug);
}
.form-step-header__text {
  font-size: var(--text-sm);
  color: var(--color-text-3);
  margin-top: var(--space-2);
  line-height: var(--leading-loose);
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-5) var(--page-pad);
  border-top: 1px solid var(--color-border-light);
  background: var(--color-surface);
}

/* ─────────────────────────────────────────
   ADMIN LAYOUT
   ───────────────────────────────────────── */
@media (min-width: 768px) {
  .admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
  }
  .admin-sidebar {
    background: var(--color-secondary-dark);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: var(--space-6) 0;
  }
  .admin-content {
    padding: var(--space-6) var(--space-8);
    background: var(--color-bg);
    overflow-y: auto;
  }
}

/* ─────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────── */
@media (min-width: 480px) {
  :root {
    --max-content: 480px;
  }
  .app-wrapper {
    box-shadow: 0 0 40px rgba(28,20,16,.08);
  }
}

@media (min-width: 768px) {
  /* Desktop: sidebar visible, bottom nav hidden */
  .bottom-nav { display: none; }
  .page-content {
    padding-bottom: var(--space-8);
  }

  :root {
    --max-content: 100%;
  }

  .providers-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .categories-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (min-width: 1024px) {
  .providers-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ─────────────────────────────────────────
   ANIMATIONS PAGE TRANSITIONS
   ───────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.animate-fade-in-up { animation: fadeInUp var(--duration-slow) var(--ease-out) both; }
.animate-fade-in    { animation: fadeIn    var(--duration-base) var(--ease-soft) both; }
.animate-scale-in   { animation: scaleIn   var(--duration-slow) var(--ease-out) both; }

.delay-1 { animation-delay: 80ms; }
.delay-2 { animation-delay: 160ms; }
.delay-3 { animation-delay: 240ms; }
.delay-4 { animation-delay: 320ms; }
.delay-5 { animation-delay: 400ms; }
.delay-6 { animation-delay: 480ms; }
