/* assets/css/app.css
   Components: header, dropdown, cards, ad grid, section bars
*/

.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243,246,251,0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar__inner{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 14px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 10px;
}
.brand__mark{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(255,138,31,0.55);
  color: var(--primary);
  background: var(--surface);
}
.brand__name{ font-weight: 600; color: var(--text); }

.nav{ display:flex; align-items:center; gap: 14px; }
.nav__link{ color: var(--text); font-weight: 500; font-size: 14px; }
.nav__link:hover{ text-decoration: none; color: var(--primary); }

.actions{ display:flex; align-items:center; gap: 10px; }

/* ===== DROPDOWN (KAPANMA SORUNU ÇÖZÜLDÜ) ===== */
.dropdown{
  position: relative;
}

/* Hover köprüsü:
   Buton ile panel arasında margin-top boşluğu var (10px).
   Panel overflow:auto olduğu için panel::before ile köprü çalışmaz (kırpılır).
   Bu yüzden köprüyü parent üzerinde yapıyoruz. */
.dropdown::after{
  content: "";
  position: absolute;
  left: -18px;
  right: -18px;
  top: 100%;
  height: 12px;            /* 10px boşluğu + tolerans */
  background: transparent;
}

.dropdown__btn{
  border: 1px solid rgba(255,138,31,0.55);
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
}

.dropdown__panel{
  position: absolute;
  top: 100%;
  margin-top: 10px;
  left: 0;
  z-index: 200;
  min-width: 220px;
  max-height: 360px;
  overflow:auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;
  display:none;
}

.dropdown__panel--right{ right: 0; left: auto; }

/* Hover + klavye/focus ile de açık kalsın */
.dropdown:hover .dropdown__panel,
.dropdown:focus-within .dropdown__panel{ display:block; }

.dropdown__link{
  display:block;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
}
.dropdown__link:hover{
  text-decoration:none;
  background: rgba(31,111,235,0.06);
  color: var(--primary);
}
.dropdown__sep{
  height: 1px;
  background: var(--border);
  margin: 8px 8px;
  border-radius: 99px;
}
/* ===== KATEGORİLER: MEGA MENÜ ===== */

/* Mega panel genel ayar */
.dropdown__panel--mega{
  max-height: 70vh;              /* 360px limitini aşsın */
  overflow: auto;
  padding: 12px;                 /* standart panel 8px -> mega daha ferah */
}

/* PC üst bar: mega panel genişliği */
.topbar .dropdown--mega > .dropdown__panel--mega{
  width: min(980px, calc(100vw - 40px));
}

/* Mega grid (kategori listesi) */
.mega{ width: 100%; }
.mega__grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}

.mega__link{
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  line-height: 1.2;
  color: var(--text);
  font-family: inherit, "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji";
}

.mega__link:hover{
  text-decoration: none;
  background: rgba(31,111,235,0.06);
  color: var(--primary);
}

.mega__name{
  display: block;
  font-weight: 600;
  font-family: inherit, "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji";
}

/* Orta ekran: 3 kolon */
@media (max-width: 1100px){
  .mega__grid{ grid-template-columns: repeat(3, minmax(160px, 1fr)); }
}

/* Mobil drawer içinde: 2 kolon */
@media (max-width: 860px){
  .mobnav .mega__grid{ grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

/* Çok küçük ekran: 1 kolon */
@media (max-width: 420px){
  .mobnav .mega__grid{ grid-template-columns: 1fr; }
}

/* ===== /KATEGORİLER: MEGA MENÜ ===== */


/* ===== /DROPDOWN ===== */

.hero{ padding: 18px 0 6px; }

.sectionbar{
  margin-top: 18px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255,138,31,0.45);
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--surface2);
}
.sectionbar__title{
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.sectionbar__link{
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
}

/* Sponsor/Vitrin (4 slot) — sabit yükseklik, düzgün 2x2 görünüm */
.promo-grid{
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.promo-card{
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(21,34,56,0.05);
  min-height: 132px;
}

/* Vitrin görseli: orantılı (contain) + arka planda aynı görselden blur/degrade */
.promo-card__media{
  flex: 0 0 42%;
  height: 132px;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border);
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: var(--surface2);
}

/* Arkada: aynı görsel + yumuşak degrade, blur */
.promo-card__media::before{
  content:"";
  position:absolute;
  inset:-22px;
  background-image:
    var(--bg-img, none),
    radial-gradient(120% 100% at 12% 18%, rgba(31,111,235,0.18), transparent 58%),
    radial-gradient(120% 100% at 88% 82%, rgba(255,138,31,0.18), transparent 58%),
    linear-gradient(135deg, rgba(255,255,255,0.45), rgba(255,255,255,0));
  background-size: cover, auto, auto, auto;
  background-position: center, center, center, center;
  filter: blur(18px);
  transform: scale(1.10);
  opacity: .85;
}

/* İnce iç çerçeve + hafif vinyet */
.promo-card__media::after{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(120% 120% at 50% 50%, rgba(0,0,0,0.00), rgba(0,0,0,0.06));
  border: 1px solid rgba(0,0,0,0.04);
  pointer-events:none;
}

/* Resim: kırpma yok, orantılı sığdır */
.promo-card__media img{
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 12px;
}

/* Placeholder */
.promo-card__ph{
  width: 100%;
  height: 100%;
}

.promo-card__body{
  flex: 1;
  min-width: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.promo-card__title{
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.promo-card__text{
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.promo-card__actions{
  margin-top: auto;
}

.promo-card__empty{
  width: 100%;
  min-height: 132px;
  background: linear-gradient(135deg, rgba(31,111,235,0.04), rgba(255,138,31,0.04));
}

.filters{
  margin-top: 16px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
}
.filters__title{ font-size: 13px; color: var(--muted); }
.filters__right{ display:flex; align-items:center; gap: 12px; flex-wrap: wrap; }
.toggle{ display:flex; align-items:center; gap: 8px; color: var(--muted); font-size: 13px; }

.cards-grid{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.card{
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 1px 0 rgba(21,34,56,0.05);
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.card__head{ display:flex; gap: 10px; align-items: center; }
.avatar{ width: 44px; height: 44px; border-radius: 14px; overflow:hidden; border: 1px solid var(--border); background: var(--surface2); }
.avatar img{ width:100%; height:100%; object-fit: cover; }
.avatar__ph{ width:100%; height:100%; }
.card__text{ margin:0; color: var(--muted); font-size: 13px; }

/* BUTONLAR TAŞMASIN */
.card__foot{
  margin-top: auto;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.dash{
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  margin-top: 14px;
}
.dash__stack{ display:flex; flex-direction:column; gap:14px; }
.dash__kpis{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.kpi{
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
}
.kpi__label{ color: var(--muted); font-size: 12px; }
.kpi__value{ font-size: 20px; font-weight: 700; margin-top: 4px; }
@media (max-width: 900px){
  .dash{ grid-template-columns: 1fr; }
  .dash__kpis{ grid-template-columns: 1fr; }
}


.footer{
  margin-top: 26px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.55);
}
.footer__inner{
  padding: 18px 0;
  display:grid;
    grid-template-columns: 1.6fr 1.4fr 1fr 1fr;
  gap: 16px;
}
.footer__title{ font-weight: 600; margin-bottom: 8px; }
.footer__text{ color: var(--muted); font-size: 13px; }
.footer__link{ display:block; color: var(--muted); font-size: 13px; margin: 6px 0; }
.footer__link:hover{ color: var(--primary); text-decoration:none; }
/* Footer kategori listesi (çok kategori varsa düzenli dursun) */
.footer__cats{
  column-count: 2;
  column-gap: 18px;
}
.footer__cats .footer__link{
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  font-family: inherit, "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji";
}


.footer__bottom{ padding: 10px 0 18px; color: var(--muted); font-size: 13px; }

.paybox{
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 1px 0 rgba(21,34,56,0.05);
}
.paybox__row{ display:flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.paybox__row:last-child{ border-bottom:0; }
.paybox__label{ color: var(--muted); font-size: 13px; }
.paybox__value{ font-size: 13px; }

@media (max-width: 980px){
  .cards-grid{ grid-template-columns: repeat(2, 1fr); }
  .footer__inner{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px){
  .topbar__inner{ flex-wrap: wrap; }
  .actions{ width: 100%; justify-content: flex-end; }
  .promo-grid{ grid-template-columns: 1fr; }
  .cards-grid{ grid-template-columns: 1fr; }
  .footer__inner{ grid-template-columns: 1fr; }
}

/* Admin layout */
.admin{ display:grid; grid-template-columns: 240px 1fr; gap: 14px; }
.admin-nav{
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  height: fit-content;
  position: sticky;
  top: 84px;
}
.admin-nav__title{ font-weight: 600; margin-bottom: 10px; }
.admin-nav__link{
  display:block;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  border: 1px solid transparent;
  margin-bottom: 6px;
}
.admin-nav__link:hover{ text-decoration:none; background: rgba(31,111,235,0.06); color: var(--primary); }
.admin-nav__link--active{ border-color: rgba(255,138,31,0.45); background: rgba(255,138,31,0.06); }

.admin-main{
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 1px 0 rgba(21,34,56,0.05);
}

@media (max-width: 980px){
  .admin{ grid-template-columns: 1fr; }
  .admin-nav{ position: static; }
}
/* Support panel (user + admin) */
.sp-page{ margin-top:16px; }
.sp-card{ margin-top:12px; }
.sp-title{ margin:0; }
.sp-sub{ margin-top:4px; }
.sp-admin-wrap{ margin-top:10px; }
.sp-empty{ padding:10px; }
.sp-actions{ display:flex; gap:8px; align-items:center; }
.sp-wrap{ display:grid; grid-template-columns: 320px 1fr; gap: 12px; }
.sp-left{
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
}
.sp-right{
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  min-width: 0;
}
.sp-search{ display:flex; gap: 8px; margin-bottom: 10px; }
.sp-list{ display:flex; flex-direction:column; gap: 8px; max-height: 66vh; overflow:auto; padding-right: 4px; }
.sp-item{
  display:block;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.55);
  color: var(--text);
}
.sp-item:hover{ text-decoration:none; border-color: rgba(31,111,235,0.25); }
.sp-item--active{ border-color: rgba(255,138,31,0.55); background: rgba(255,138,31,0.06); }
.sp-item__top{ display:flex; justify-content:space-between; gap: 10px; align-items:center; }
.sp-item__title{ font-weight:600; font-size: 13px; }
.sp-item__meta{ margin-top:6px; color: var(--muted); font-size: 12px; }

.sp-badge{ font-size: 11px; padding: 4px 8px; border-radius: 999px; border: 1px solid rgba(31,111,235,0.25); color: var(--primary); background: rgba(31,111,235,0.06); }
.sp-badge--closed{ border-color: rgba(0,0,0,0.12); color: var(--muted); background: rgba(0,0,0,0.04); }

.sp-head{ display:flex; justify-content:space-between; gap: 12px; align-items:flex-start; margin-bottom: 10px; }
.sp-chat{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.55);
  border-radius: 14px;
  padding: 12px;
  max-height: 56vh;
  overflow:auto;
}
.sp-msg{ display:flex; margin: 8px 0; }
.sp-msg--me{ justify-content:flex-end; }
.sp-msg--you{ justify-content:flex-start; }
.sp-bubble{
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  line-height: 1.45;
}
.sp-msg--me .sp-bubble{ border-color: rgba(31,111,235,0.25); background: rgba(31,111,235,0.06); }
.sp-time{ margin-top: 6px; font-size: 11px; color: var(--muted); }

.sp-form{ margin-top: 10px; }
.sp-form__actions{ display:flex; justify-content:flex-end; margin-top: 8px; }

@media (max-width: 980px){
  .sp-wrap{ grid-template-columns: 1fr; }
  .sp-list{ max-height: 36vh; }
}

/* Channel review page */
.ch-wrap{ max-width:1120px; margin:0 auto; padding:18px 24px 0 24px; }
.ch-lead{ max-width:880px; }
.ch-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }

.ch-trend{ margin-top:18px; }
.ch-trend__head{ justify-content:space-between; align-items:flex-end; }
.ch-trend__right{ text-align:right; }
.ch-trend__chart{ margin-top:14px; color: var(--primary); max-width:100%; }
.ch-trend__chartInner{ max-width:100%; overflow:hidden; }

.ch-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top:14px; }
.ch-cardhead{ align-items:flex-start; }
.ch-avatar{ width:64px; height:64px; border-radius:18px; }
.ch-title{ font-size:16px; }
.ch-info{ min-width:0; }

.ch-posts{ margin-top:18px; }
.ch-posts__row{ margin-top:10px; display:flex; gap:14px; flex-wrap:wrap; align-items:flex-start; }
.ch-posts__chart{ flex:1; min-width:320px; color: var(--primary); }
.ch-posts__list{ flex:1; min-width:320px; }
.ch-posts__grid{ display:grid; grid-template-columns: 1fr auto; gap:6px 10px; }

/* küçük spacing yardımcıları */
.ch-mt2{ margin-top:2px; }
.ch-mt4{ margin-top:4px; }
.ch-mt6{ margin-top:6px; }
.ch-mt8{ margin-top:8px; }
.ch-mt10{ margin-top:10px; }
.ch-mt14{ margin-top:14px; }
.ch-mb8{ margin-bottom:8px; }

@media (max-width: 980px){
  .ch-grid{ grid-template-columns: 1fr; }
}
/* ===== MOBİL DRAWER MENÜ (PC'yi bozmaz) ===== */
.mobnav__toggle{ display:none; }

.mobnav{
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(86vw, 360px);
  z-index: 2002;
  background: var(--bg, #0f1115);
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
  transform: translateX(110%);
  transition: transform .22s ease;
  padding: 14px;
  overflow: auto;
}

.mobnav__backdrop{
  position: fixed;
  inset: 0;
  z-index: 2001;
  background: rgba(0,0,0,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

body.is-mobnav-open{ overflow: hidden; }
body.is-mobnav-open .mobnav{ transform: translateX(0); }
body.is-mobnav-open .mobnav__backdrop{ opacity: 1; pointer-events: auto; }

.mobnav__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-bottom:10px;
  border-bottom:1px solid rgba(255,255,255,.10);
  margin-bottom:10px;
}
.mobnav__title{ font-weight: 700; }
.mobnav__close{
  width:44px; height:44px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background: transparent;
  font-size:22px;
  line-height:1;
}

@media (min-width: 861px){
  .mobnav, .mobnav__backdrop{ display:none !important; }
}

@media (max-width: 860px){
  /* Mobilde üst bardaki nav/actions gizlenir */
  .topbar .nav,
  .topbar .actions{ display:none !important; }

  /* Sağ üst hamburger */
  .mobnav__toggle{
    display:inline-flex;
    margin-left:auto;
    width:44px; height:44px;
    align-items:center;
    justify-content:center;
    border-radius:12px;
    border:1px solid rgba(255,255,255,.12);
    background: transparent;
  }

  .mobnav__bars{
    position:relative;
    width:18px;
    height:2px;
    border-radius:2px;
    background: currentColor;
  }
  .mobnav__bars::before,
  .mobnav__bars::after{
    content:"";
    position:absolute;
    left:0;
    width:18px;
    height:2px;
    border-radius:2px;
    background: currentColor;
    transition: transform .22s ease;
  }
  .mobnav__bars::before{ top:-6px; }
  .mobnav__bars::after{ top:6px; }

  body.is-mobnav-open .mobnav__bars{ background: transparent; }
  body.is-mobnav-open .mobnav__bars::before{ transform: translateY(6px) rotate(45deg); }
  body.is-mobnav-open .mobnav__bars::after{ transform: translateY(-6px) rotate(-45deg); }

  /* Drawer içi dikey */
  .mobnav .nav{ display:flex; flex-direction:column; gap:8px; }
  .mobnav .actions{ display:flex; flex-direction:column; gap:10px; }
  .mobnav .actions .btn{ width:100%; }

  /* Mobil dropdown panel drawer içinde */
  .mobnav .dropdown__panel{ position: static; width:100%; }
}
