/* includes/home.css (FULL - ADAPTED) */

:root {
  --bg-color: #050607;
  --card-color: #181c1b;
  --card-color-soft: #22272a;
  --accent: #9BE368;
  --accent-soft: #283626;
  --text-main: #f6f7f2;
  --text-muted: #b3b6ac;
  --pill-bg: #212624;
  --pill-border: #3a413e;
  --bottom-bar: #111415;
  --badge-bg: #f8e99b;
  --badge-text: #0f1a0f;

  /* promo fallbacks (DB overrides via inline CSS vars) */
  --promo-bg: #2b2f45;
  --promo-title-color: #f2f4f7;
  --promo-accent-color: #cfe7b9;
  --promo-footnote-color: rgba(242,244,247,0.75);
  --mini-player-h: 76px; /* mini player yüksekliğin (gerekirse 70-90 oynat) */
  --bottom-nav-h: 110px; /* sende app-shell padding-bottom zaten 110 */
}

/* =========================
   GOTHAM (LOCAL FONT FILES)
   ========================= */
@font-face {
  font-family: "Gotham";
  src:
    url("../fonts/Gotham-Book.woff2") format("woff2"),
    url("../fonts/Gotham-Book.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gotham";
  src:
    url("../fonts/Gotham-Medium.woff2") format("woff2"),
    url("../fonts/Gotham-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gotham";
  src:
    url("../fonts/Gotham-Bold.woff2") format("woff2"),
    url("../fonts/Gotham-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gotham";
  src:
    url("../fonts/Gotham-Black.woff2") format("woff2"),
    url("../fonts/Gotham-Black.woff") format("woff");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Gotham", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  display: flex;
  justify-content: center;
}

.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1a2520 0, #050607 45%);
  padding: 16px 16px 110px 16px; /* clear bottom nav */
  position: relative;
  padding-bottom: var(--bottom-nav-h);
}

/* HEADER */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 23px;
}

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

.greeting-wrapper {
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}

.greeting {
  font-size: 26px;
  font-weight: 700;
  position: relative;
  z-index: 2;
}

.curve {
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  pointer-events: none;
}

.header-right {
  width: 32px;
  height: 32px;
}

/* YAZAR BALONCUKLARI */
.stories {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 8px;
}
.stories::-webkit-scrollbar { display: none; }

.author-bubble {
  flex: 0 0 auto;
  width: 64px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
  text-align: center;
  cursor: pointer;
}

.author-avatar-wrapper { display: inline-block; margin-bottom: 7px; }

.author-avatar-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #2a2f2b;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.author-avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.author-bubble.highlight .author-avatar-ring {
  box-shadow: 0 0 0 3px var(--accent);
  background: #303a30;
  margin-top: 3px;
  margin-left: 3px;
}

.author-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.author-bubble.add-bubble .author-avatar-ring {
  background: #1a1f1b;
  border: 2px dashed var(--accent);
  color: var(--accent);
  font-size: 28px;
  font-weight: 600;
}
.author-bubble.add-bubble .author-avatar-ring span { transform: translateY(-2px); }

/* HIZLI ERİŞİM BUTONLARI */
.filters {
  display: flex;
  gap: 12px;
  margin: 4px 0 16px;
  overflow-x: auto;
}
.filters::-webkit-scrollbar { display: none; }

.pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background-color: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}
.pill:active { transform: scale(0.96); }

.pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.pill-icon img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  display: block;
}
.pill-label { white-space: nowrap; }

.pill.active {
  background-color: #dfeec9;
  border-color: #dfeec9;
  color: #111;
}

/* =========================
   PROMO CARD (SINGLE COLLAGE IMAGE)
   ========================= */

.promo-card{
  background: var(--promo-bg);
  border-radius: 8px;
  padding: 22px;
  display: grid;
  grid-template-columns: 3.3fr 1fr;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 24px;
  overflow: hidden;
  position: relative;
}

/* If promo card is a link */
.promo-card--link{
  text-decoration: none;
  color: inherit;
  display: grid;
}
.promo-card--link:active{
  transform: scale(0.99);
  transition: transform 0.08s ease;
}

.promo-text{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
  position: relative;
  z-index: 2;
}

.promo-title{
  font-size: 20px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--promo-title-color);
  max-width: 220px;
}

.promo-price{
  font-size: 36px;
  line-height: 1;
  font-weight: 800;
  color: var(--promo-accent-color);
  margin-bottom: 45px;
}

.promo-footnote{
  font-size: 12px;
  color: var(--promo-footnote-color);
  margin-top: 10px;
}

/* Right-side collage container */
.promo-covers{
  position: relative;
  min-height: 170px;
  z-index: 1;
  pointer-events: none; /* allow full card click */
}

/* Single collage image (DB’den gelen) */
.promo-covers img{
  position: absolute;
  right: -18px;
  top: -10px;

  width: 320px;
  height: 220px;

  object-fit: contain;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 360px){
  .promo-title{ font-size: 26px; }
  .promo-price{ font-size: 48px; }

  .promo-covers img{
    width: 240px;
    height: 210px;
    right: -12px;
    top: -12px;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9px;
  background-color: var(--badge-bg);
  color: var(--badge-text);
  font-weight: 600;
  margin-bottom: 6px;
}

/* BÖLÜM BAŞLIKLARI */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0 14px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.section-link {
  font-size: 12px;
  font-weight: 400;
  color: #cfe7b9;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.section-arrow-icon {
  width: 18px;
  height: 18px;
  display: block;
}

/* tint arrow */
.section-link .section-arrow-icon {
  filter: brightness(0) saturate(100%) invert(86%) sepia(15%) saturate(392%) hue-rotate(52deg) brightness(96%) contrast(92%);
}

/* =========================
   HOME SECTIONS: ONE ROW + HORIZONTAL SCROLL
   ========================= */

.home-section { margin-bottom: 18px; }

/* horizontal row container */
.book-row{
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.book-row::-webkit-scrollbar { display: none; }

/* card sizing for horizontal */
.book-card--row{
  flex: 0 0 auto;
  width: 128px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* cover sizing for row */
.book-cover--row{
  width: 100%;
  overflow: hidden;
  background-color: var(--card-color);
  position: relative; /* ✅ needed for play overlay */
}
.book-cover--row img{
  width: 100%;
  height: 184px;
  object-fit: cover;
  display: block;
}

/* ✅ PLAY overlay (mini-player trigger) */
.play-overlay{
  position: absolute;
  right: 10px;
  bottom: 10px;

  width: 42px;
  height: 42px;
  border-radius: 999px;

  border: none;
  cursor: pointer;

  background: rgba(205, 231, 190, 0.95);
  color: #111;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 14px;
  font-weight: 900;

  box-shadow: 0 10px 25px rgba(0,0,0,0.45);
  transition: transform 0.12s ease, opacity 0.15s ease;
}
.play-overlay:active{ transform: scale(0.95); }

/* text styles */
.book-title {
  font-size: 12px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.1px;
}

.book-author {
  font-size: 11px;
  color: rgba(246,247,242,0.65);
  margin-top: 2px;
}

.book-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: rgba(246,247,242,0.65);
  margin-top: 6px;
}
.book-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ✅ restore dot */
.book-meta span.meta-dot::before { content: "• "; }

/* Keep grid available */
.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.book-card { display: flex; flex-direction: column; gap: 6px; }
.book-cover { width: 100%; overflow: hidden; background-color: var(--card-color);}
.book-cover img { width: 100%; height: 184px; object-fit: cover; display: block; }

/* CONTINUE LISTENING */
.continue-card {
  background-color: var(--card-color-soft);
  border-radius: 16px;
  padding: 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.continue-cover img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
}

.continue-title { font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.continue-sub { font-size: 10px; color: var(--text-muted); }

.progress-bar {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background-color: #2b2f2a;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar-inner {
  width: 40%;
  height: 100%;
  background-color: var(--accent);
}

.continue-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.icon-button {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background-color: #2c322e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.icon-button.play {
  background-color: var(--accent);
  color: #111;
}

/* =========================
   ALT NAV (SVG mask icons)
   ========================= */

.bottom-nav{
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 92px;
  padding: 10px 26px 16px;
  background: rgba(10, 12, 12, 0.92);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 50;
}

.book-card-link{
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.book-card-link:active{
  transform: scale(0.99);
}

.nav-item{
  position: relative;
  flex: 1 1 0;
  text-align: center;
  text-decoration: none;
  color: rgba(246,247,242,0.70);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 0 8px;
  border-radius: 18px;
}

.nav-icon-mask{
  width: 27px;
  height: 23px;
  display: block;
  background-color: rgba(246,247,242,0.70);

  -webkit-mask-image: var(--icon);
  mask-image: var(--icon);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* REQUIRED: 12px */
.nav-label{
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.2px;
  line-height: 1;
}

.nav-item.active{
  color: var(--accent);
}

.nav-item.active .nav-icon-mask{
  background-color: var(--accent);
}

/* optional glow */
.nav-item.active::before{
  content: "";
  position: absolute;
  inset: -26px -22px -10px -22px;
  background: radial-gradient(circle at 50% 40%,
    rgba(155,227,104,0.28) 0%,
    rgba(155,227,104,0.12) 30%,
    rgba(155,227,104,0.00) 65%);
  filter: blur(2px);
  border-radius: 26px;
  pointer-events: none;
}

@media (min-width: 768px) {
  .app-shell {
    border-radius: 24px;
    margin: 16px auto;
    box-shadow: 0 18px 70px rgba(0,0,0,0.6);
  }
}

/* mini player görünürse extra boşluk */
.app-shell.has-mini-player{
  padding-bottom: calc(var(--bottom-nav-h) + var(--mini-player-h) + 12px);
}
