/* layout.css — üst çubuk, alt menü, sayfa iskeleti (v2: cam efektli üst çubuk, telefonda yüzen alt menü) */
@keyframes page-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.app-header {
  position: sticky; top: 0; z-index: var(--z-header);
  border-bottom: 1px solid var(--glass-border);
  padding-top: var(--safe-top);
}
/* Cam efekti ayrı bir katmanda: header'ın kendisine backdrop-filter verilirse içindeki sabit (fixed) alt menü header'a hapsolur */
.app-header::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--surface); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .app-header::before { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
}
/* alt çizgide ince kırmızı parıltı */
.app-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(232, 0, 0, 0.6) 50%, transparent 100%); opacity: .55;
}
.app-header__inner {
  max-width: var(--content-w-wide); margin: 0 auto; padding: 0 20px;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
}
.app-brand { display: flex; align-items: center; flex: none; margin-right: auto; }
.app-brand img { display: block; height: 44px; width: auto; }

.app-nav { display: flex; align-items: center; gap: var(--sp-1); }
.app-nav__item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  min-height: 42px; padding: 0 16px;
  border-radius: 999px; text-decoration: none;
  color: var(--text-dim); font-size: var(--fs-sm); font-weight: 600;
  transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.app-nav__item i { font-size: .95rem; width: 1.1em; text-align: center; transition: color .2s; }
.app-nav__item[aria-current="page"] {
  color: #fff;
  background: linear-gradient(180deg, rgba(232, 0, 0, 0.30), rgba(232, 0, 0, 0.14));
  box-shadow: inset 0 0 0 1px rgba(255, 90, 90, 0.35), 0 6px 18px -8px rgba(232, 0, 0, 0.6);
}
.app-nav__item[aria-current="page"] i { color: var(--primary-text); }
.app-nav__item--exit { color: var(--danger-text); margin-left: var(--sp-3); }
@media (hover: hover) {
  .app-nav__item:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
  .app-nav__item[aria-current="page"]:hover { color: #fff; }
  .app-nav__item--exit:hover { color: var(--danger-text); background: var(--danger-soft); }
}

.container { max-width: var(--content-w); margin: 36px auto; padding: 0 20px; animation: page-rise .4s var(--ease) backwards; }
.container--wide { max-width: var(--content-w-wide); }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.page-title h1 { margin: 0; }

/* Marka rozeti: masaüstünde köşede, telefonda içeriğin sonunda */
.pm-logo-rozet {
  position: fixed; right: 16px; bottom: 12px; height: 32px; width: auto;
  filter: brightness(0) invert(1); opacity: .55; pointer-events: none; z-index: 1;
}
.app-foot { display: flex; justify-content: center; padding: var(--sp-5) 0 var(--sp-3); }

@media (max-width: 768px) {
  :root { --header-h: 58px; }
  .app-header__inner { justify-content: center; position: relative; }
  .app-brand { margin-right: 0; }
  .theme-toggle { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); margin: 0; width: 38px; height: 38px; }
  .app-brand img { height: 38px; }
  .container { margin: 20px auto; }

  /* Alt menü: ekranın altında yüzen, camsı hap şeklinde çubuk */
  .app-nav {
    position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-bottom)); z-index: var(--z-nav);
    height: var(--nav-h); padding: 6px; gap: 2px; align-items: stretch;
    background: var(--surface-3);
    border: 1px solid var(--glass-border); border-radius: 22px; box-shadow: var(--shadow-nav);
    transition: transform .25s var(--ease);
  }
  @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .app-nav { background: rgba(24, 24, 27, 0.78); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
  }
  .app-nav__item {
    flex: 1 1 0; min-width: 0;
    flex-direction: column; justify-content: center; gap: 3px;
    min-height: 0; padding: 0; border-radius: 16px;
    font-size: .6875rem; font-weight: 500; letter-spacing: -0.01em; text-align: center; line-height: 1.15;
  }
  .app-nav__item i { font-size: 1.2rem; }
  .app-nav__item[aria-current="page"] {
    color: var(--primary-text); font-weight: 700; box-shadow: none;
    background: var(--primary-soft);
  }
  .app-nav__item--exit { margin-left: 0; flex: 0 0 48px; }
  .app-nav__label--wide { display: none; }

  /* Klavye açıkken alt menü formun üstüne binmesin */
  .kb-open .app-nav { transform: translateY(calc(100% + 40px)); }

  body { padding-bottom: calc(170px + var(--safe-bottom)); }
  body:has(.app-foot) { padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 30px); } /* rozet akışta olan yeni sayfalar */
  .pm-logo-rozet { position: absolute; left: 50%; right: auto; bottom: calc(100px + var(--safe-bottom)); transform: translateX(-50%); height: 30px; opacity: .6; }
  .app-foot .pm-logo-rozet { position: static; transform: none; height: 30px; }
}
