/* =====================================================
   MELEĞIM — APP DASHBOARD
   UI/UX Pro Max · Mobile-First · Restrained & Premium
   ===================================================== */

/* ── TOKENS ──────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:        #F9F4F6;   /* Warm off-white, not stark */
  --bg-card:   #FFFFFF;
  --bg-card-alt: #F4F1F5; /* Slightly warmer card */

  /* Text */
  --txt:       #1A1018;   /* Near-black with warmth */
  --txt-sub:   #8A7F88;   /* Muted mauve-grey */
  --txt-hint:  #C4B8C2;

  /* Accent — one color, used sparingly */
  --accent:    #C8375A;   /* Deep rose, not neon */
  --accent-bg: rgba(200, 55, 90, 0.08);
  --accent-glow: rgba(200, 55, 90, 0.20);

  /* Borders */
  --border:    rgba(26, 16, 24, 0.06);
  --border-md: rgba(26, 16, 24, 0.10);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(26,16,24,0.05);
  --shadow-md: 0 8px 24px rgba(26,16,24,0.08);
  --shadow-lg: 0 16px 48px rgba(26,16,24,0.10);

  /* Radii */
  --r-sm:  14px;
  --r-md:  22px;
  --r-lg:  30px;
  --r-xl:  40px;
  --r-full: 9999px;

  /* Transitions */
  --ease:  cubic-bezier(0.34, 1.56, 0.64, 1); /* Springy */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark theme — deep velvet, not plain black */
body.dark {
  --bg:        #110A0D;
  --bg-card:   #1C1118;
  --bg-card-alt: #231720;
  --txt:       #F5EEF3;
  --txt-sub:   #7A6E78;
  --txt-hint:  #4A3E48;
  --border:    rgba(245,238,243,0.05);
  --border-md: rgba(245,238,243,0.09);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.20);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.30);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.40);
}

/* ── RESET ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--bg);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
  transition: background 0.4s var(--ease-out), color 0.4s var(--ease-out);
}

a { text-decoration: none; color: inherit; }
button { background: none; border: none; cursor: pointer; font-family: inherit; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── TOPBAR ──────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 12px) 24px 14px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
  transition: background 0.35s var(--ease-out), backdrop-filter 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.topbar--scrolled {
  background: rgba(249, 244, 246, 0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border);
}

body.dark .topbar--scrolled {
  background: rgba(17, 10, 13, 0.75);
}

.topbar-sub {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--txt-sub);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 20px;
  font-weight: 600;
  color: var(--txt);
  letter-spacing: -0.3px;
}

.greeting-icon {
  width: 17px;
  height: 17px;
  color: var(--accent);
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--r-full);
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--txt-sub);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease-out);
}
.topbar-btn:active { transform: scale(0.88); box-shadow: none; }
.topbar-btn i, .topbar-btn svg { width: 16px; height: 16px; }

.topbar-avatar {
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.topbar-avatar i, .topbar-avatar svg { width: 18px; height: 18px; }

/* ── MAIN ────────────────────────────────────────────── */
.main {
  padding: calc(env(safe-area-inset-top, 0px) + 90px) 20px calc(env(safe-area-inset-bottom, 0px) + 110px);
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ── SECTION HEADER ──────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--txt);
}

.section-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}

/* ── PILLS (Quick Actions) ───────────────────────────── */
.pills-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.pills-scroll::-webkit-scrollbar { display: none; }

.pill {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  border-radius: var(--r-full);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--txt);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease-out), background 0.18s;
}

.pill i, .pill svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }
.pill:active { transform: scale(0.94); box-shadow: none; }

/* ── HERO SWIPER ─────────────────────────────────────── */
.hero-swiper {
  width: 100%;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.swiper-slide { border-radius: var(--r-xl); overflow: hidden; }

.hero-slide {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--bg-card-alt);
}

.hero-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--r-xl);
}

.hero-fade {
  position: absolute;
  inset: 0;
  border-radius: var(--r-xl);
  background: linear-gradient(to top, rgba(17,10,13,0.55) 0%, transparent 50%);
}

.hero-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--txt-hint);
}
.hero-empty i, .hero-empty svg { width: 40px; height: 40px; }

/* Swiper pagination */
.swiper-pagination-bullet { background: rgba(255,255,255,0.5); opacity: 1; }
.swiper-pagination-bullet-active { background: #fff; }

/* ── MODULE GRID ─────────────────────────────────────── */
.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── CARDS (shared) ──────────────────────────────────── */
.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease-out);
  box-shadow: var(--shadow-sm);
  color: var(--txt);
}
.card:active { transform: scale(0.96); box-shadow: none; }

/* Large cards — span full row */
.card-lg {
  grid-column: 1 / -1;
  padding: 28px 24px;
  min-height: 130px;
  justify-content: flex-end;
  gap: 4px;
}

/* Alt-toned large card */
.card-alt { background: var(--bg-card-alt); }

.card-label {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.card-desc {
  font-size: 13px;
  color: var(--txt-sub);
  line-height: 1.5;
}

.card-arrow {
  position: absolute;
  top: 24px; right: 24px;
  width: 34px; height: 34px;
  border-radius: var(--r-full);
  background: var(--accent-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  transition: transform 0.22s var(--ease);
}
.card:hover .card-arrow { transform: translate(2px, -2px); }
.card-arrow i, .card-arrow svg { width: 16px; height: 16px; }

.card-icon-bg {
  position: absolute;
  bottom: -12px; right: -8px;
  width: 88px; height: 88px;
  color: var(--border-md);
  opacity: 0.6;
  pointer-events: none;
}
.card-icon-bg i, .card-icon-bg svg { width: 100%; height: 100%; }

/* Small cards */
.card-sm {
  padding: 20px 16px;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: 90px;
}

.card-sm-icon {
  width: 24px; height: 24px;
  color: var(--accent);
  flex-shrink: 0;
}

.card-sm-num {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1;
}

.card-sm-label {
  font-size: 11px;
  color: var(--txt-sub);
  margin-top: 2px;
}

.card-sm-btn {
  margin-left: auto;
  width: 30px; height: 30px;
  border-radius: var(--r-full);
  background: var(--accent-bg);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.18s var(--ease), background 0.18s;
}
.card-sm-btn:active { transform: scale(0.84); background: var(--accent-glow); }
.card-sm-btn i, .card-sm-btn svg { width: 14px; height: 14px; }

/* Love count pop animation */
.pop {
  animation: pop 0.35s var(--ease) forwards;
}
@keyframes pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.4); color: var(--accent); }
  100% { transform: scale(1); }
}

/* ── DOCK ────────────────────────────────────────────── */
.dock-wrap {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 90;
}

.dock {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(249, 244, 246, 0.70);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--border-md);
  border-radius: var(--r-full);
  padding: 8px 10px;
  box-shadow: var(--shadow-md), 0 1px 0 rgba(255,255,255,0.6) inset;
}

body.dark .dock {
  background: rgba(28, 17, 24, 0.70);
  box-shadow: var(--shadow-lg), 0 1px 0 rgba(255,255,255,0.04) inset;
}

.dock-item, .dock-center {
  width: 48px; height: 48px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--txt-sub);
  transition: transform 0.18s var(--ease), color 0.18s;
  position: relative;
}
.dock-item i, .dock-item svg, .dock-center i, .dock-center svg { width: 20px; height: 20px; }

.dock-item:active, .dock-center:active { transform: scale(0.84); }

.dock-item.active { color: var(--accent); }
.dock-item.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px; height: 4px;
  border-radius: var(--r-full);
  background: var(--accent);
}

/* Center action button */
.dock-center {
  width: 54px; height: 54px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-8px);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease-out);
}
.dock-center:active { transform: translateY(-8px) scale(0.88); box-shadow: 0 2px 8px var(--accent-glow); }

/* ── ENTRANCE CHOREOGRAPHY ───────────────────────────────
   Pure CSS, no JS dependency — works even before scripts load.
   Each .reveal element carries an --i order via inline style. */
.reveal {
  animation: reveal-in 0.7s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes reveal-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Slow, cinematic drift on the currently active hero photo */
.swiper-slide-active .hero-slide img {
  animation: hero-kenburns 6s var(--ease-out) forwards;
}

@keyframes hero-kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

/* Native cross-document page transitions (MPA).
   Ignored automatically by browsers that don't support it yet. */
@view-transition {
  navigation: auto;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .swiper-slide-active .hero-slide img { animation: none; transform: none; }
}
