/* ===================================
   LAYOUT.CSS — Header, Footer, Grid
   almakistiyorum.net v2
=================================== */

/* ── CONTAINER ── */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 720px; }
.container-md { max-width: 900px; }

/* ── GRID ── */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ── FLEX UTILS ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.gap-5 { gap: 20px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

/* ── SECTION ── */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-lg { padding: 112px 0; }
.section__header { margin-bottom: 48px; }
.section__header--center { text-align: center; }
.section__tag { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary); margin-bottom: 12px; display: block; }
.section__title { margin-bottom: 12px; }
.section__sub { font-size: 17px; color: var(--gray-500); max-width: 560px; line-height: 1.7; }
.section__header--center .section__sub { margin: 0 auto; }

/* ── HEADER ── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  height: var(--header-h); display: flex; align-items: center;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
.header.scrolled { box-shadow: 0 1px 8px rgba(0,0,0,0.06); background: rgba(255,255,255,0.92); }
.header__inner { display: flex; align-items: center; gap: 28px; width: 100%; }

/* ── Header Brand (icon + wordmark) ── */
.header__logo {
  display: flex; align-items: center; gap: 4px;
  flex-shrink: 0; min-width: 0;
  text-decoration: none;
}
.header__logo:hover .header__logo-icon { transform: scale(1.04); }
.header__logo:hover .header__logo-text { opacity: 0.8; }
.header__logo-icon {
  height: 80px; width: auto; flex-shrink: 0;
  display: block; object-fit: contain;
  transition: transform var(--t-fast);
}
.header__logo-text {
  font-family: var(--font-display); font-size: 17px; font-weight: 700;
  color: #263238; letter-spacing: -0.3px; white-space: nowrap;
  line-height: 1; transition: opacity var(--t-fast);
}
.header__logo-text .logo-ist { color: #FF6F00; font-weight: 600; }
.header__logo-text .logo-net { color: #9E9E9E; font-weight: 300; font-size: 0.82em; }
/* Legacy single-image logo (fallback) */
.header__logo-img { display: none; }
.header__search { flex: 1; max-width: 400px; position: relative; }
.header__search input {
  width: 100%; height: 40px; padding: 0 14px 0 38px;
  border-radius: var(--r-lg); border: 1px solid #e6e6e6;
  background: var(--gray-50); font-size: 13.5px; color: var(--dark-2);
  outline: none; transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
}
.header__search input:focus {
  border-color: var(--primary); background: var(--white);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.08), var(--shadow-sm);
}
.header__search input::placeholder { color: var(--gray-400); }
.header__search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); width: 15px; height: 15px; pointer-events: none; }
.header__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.header__nav-link { font-size: 13.5px; font-weight: 500; color: var(--gray-600); padding: 7px 14px; border-radius: var(--r-lg); transition: all 0.2s ease; }
.header__nav-link:hover { color: var(--dark-2); background: var(--gray-100); }
.header__icon-btn {
  width: 36px; height: 36px; border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center;
  background: var(--gray-50); color: var(--gray-500); position: relative; transition: all 0.2s ease; cursor: pointer;
  border: 1px solid transparent;
}
.header__icon-btn:hover { background: var(--gray-100); color: var(--dark-2); border-color: #e6e6e6; }
.header__badge, .unread-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--primary); border-radius: 10px; font-size: 9px; font-weight: 700;
  color: white; display: none; align-items: center; justify-content: center;
  border: 2px solid var(--white); line-height: 1;
}
.unread-badge.visible { display: flex; }

/* Mobile header toggle */
.header__mobile-menu { display: none; }
.hamburger { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-lg); background: var(--gray-50); color: var(--gray-600); cursor: pointer; transition: all 0.2s ease; border: 1px solid transparent; }
.hamburger:hover { background: var(--gray-100); border-color: #e6e6e6; }

/* ── MOBILE NAV (Side Drawer) ── */
.mobile-nav {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0);
  visibility: hidden;
  transition: background 0.3s ease, visibility 0.3s ease;
}
.mobile-nav.open {
  background: rgba(0,0,0,0.45);
  visibility: visible;
}
.mobile-nav__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 320px; max-width: 85vw;
  background: var(--white);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}
.mobile-nav.open .mobile-nav__panel {
  transform: translateX(0);
}
.mobile-nav__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.mobile-nav__body { padding: 12px 16px; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mobile-nav__link {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 12px; font-size: 15px; font-weight: 500;
  color: var(--dark-2); transition: background var(--t-fast), color var(--t-fast);
  border-bottom: 1px solid var(--border); border-radius: 0;
}
.mobile-nav__link:last-child { border-bottom: none; }
.mobile-nav__link:hover { background: var(--gray-50); color: var(--primary); }
.mobile-nav__link.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.mobile-nav__link svg { width: 20px; height: 20px; flex-shrink: 0; }
.mobile-nav__footer {
  padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; flex-shrink: 0;
}
.mobile-nav__footer .btn { flex: 1; }

/* ── MOBILE NAV (Bottom Tab Bar) ── */
.mobile-nav-bar {
  position: fixed; bottom: 0; left: 0; right: 0; width: 100%;
  display: none; align-items: center; justify-content: space-around;
  background: #ffffff; border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  z-index: 1000; height: 64px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mobile-nav-bar__item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; font-size: 11px; font-weight: 600;
  color: var(--gray-400); text-decoration: none;
  padding: 6px 0; transition: color var(--t-fast);
}
.mobile-nav-bar__item.active { color: var(--primary); }
.mobile-nav-bar__item svg { width: 22px; height: 22px; }
.mobile-nav-bar__item span { line-height: 1; }

/* ── MOBILE BOTTOM NAV ── */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; width: 100%; z-index: 999;
  background: var(--white); border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  height: 64px; padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav__inner {
  display: grid; grid-template-columns: repeat(5, 1fr);
  align-items: center; height: 100%; width: 100%; padding: 0;
}
.bottom-nav__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 6px 0; color: var(--gray-400); transition: color var(--t-fast);
  cursor: pointer; position: relative; text-decoration: none; min-width: 0;
}
.bottom-nav__item.active { color: var(--primary); }
.bottom-nav__item svg { width: 22px; height: 22px; }
.bottom-nav__item span { font-size: 10px; font-weight: 600; line-height: 1; white-space: nowrap; text-align: center; }
.bottom-nav__center { position: relative; top: -10px; }
.bottom-nav__center .btn {
  width: 48px; height: 48px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(255,107,53,0.35);
}

/* ── FOOTER ── */
.footer { background: var(--dark-2); color: var(--white); padding: 64px 0 0; }
.footer__top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer__brand {}
.footer__logo { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.footer__logo-icon {
  height: 40px; width: auto; flex-shrink: 0;
  display: block; object-fit: contain;
}
.footer__logo-text {
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  color: var(--white); letter-spacing: -0.3px; white-space: nowrap;
}
.footer__logo-text .logo-ist { color: #FF6F00; font-weight: 500; }
.footer__logo-text .logo-net { color: rgba(255,255,255,0.5); font-weight: 300; }
/* Legacy */
.footer__logo-img { display: none; }
.footer__logo-mark { display: none; }
.footer__brand p { font-size: 14px; color: rgba(255,255,255,0.55); line-height: 1.7; max-width: 260px; }
.footer__col-title { font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 16px; }
.footer__links { display: flex; flex-direction: column; gap: 10px; }
.footer__links a { font-size: 14px; color: rgba(255,255,255,0.7); transition: color var(--t-fast); }
.footer__links a:hover { color: var(--white); }
.footer__bottom { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; }
.footer__bottom p { font-size: 13px; color: rgba(255,255,255,0.4); }
.footer__bottom-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__bottom-links a { font-size: 13px; color: rgba(255,255,255,0.4); transition: color var(--t-fast); }
.footer__bottom-links a:hover { color: rgba(255,255,255,0.7); }

/* ── PAGE HEADER ── */
.page-header { padding: 32px 0; border-bottom: 1px solid var(--border); background: var(--surface); }
.page-header__title { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.page-header__sub { font-size: 14px; color: var(--gray-500); }

/* ── BREADCRUMB ── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-400); }
.breadcrumb a { color: var(--gray-500); transition: color var(--t-fast); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb__sep { color: var(--gray-300); }
.breadcrumb__current { color: var(--dark-2); font-weight: 500; }

/* ── SIDEBAR LAYOUT ── */
.sidebar-layout { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--header-h) + 24px); }
.sidebar__menu { display: flex; flex-direction: column; gap: 2px; }
.sidebar__item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--r-md); font-size: 14px; font-weight: 500; color: var(--gray-600); cursor: pointer; transition: all var(--t-fast); text-decoration: none; }
.sidebar__item:hover { background: var(--gray-100); color: var(--dark-2); }
.sidebar__item.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.sidebar__item svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar__sep { height: 1px; background: var(--border); margin: 8px 0; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer__top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .sidebar-layout { grid-template-columns: 220px 1fr; gap: 24px; }
}
@media (max-width: 768px) {
  .section { padding: 56px 0; }
  .section-lg { padding: 72px 0; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .header__logo-icon { height: 52px; width: auto; }
  .header__logo-text { font-size: 15px; }
  .header__inner { gap: 12px; }
  .header__search { display: none; }
  .header__nav-link:not([data-auth]) { display: none; }
  .header__nav-link[data-auth="logged-out"] { font-size: 12px; padding: 6px 10px; }
  .header__mobile-menu { display: block; }
  .bottom-nav { display: block; position: fixed; bottom: 0; left: 0; right: 0; width: 100%; z-index: 999; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .sidebar-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .footer__top { grid-template-columns: 1fr; gap: 28px; }
  .footer__brand p { max-width: 100%; }
  .footer__bottom { flex-direction: column; gap: 12px; text-align: center; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* Header compact */
  .header__inner { flex-wrap: nowrap; gap: 6px; }
  .header__logo { flex: 1 1 0; min-width: 0; }
  .header__logo-icon { height: 36px; }
  .header__logo-text { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
  .header__logo-text .logo-net { display: none; }
  .header__actions { gap: 4px; flex-shrink: 0; }
  .header__actions .btn { font-size: 11px; padding: 6px 8px; white-space: nowrap; }
  .header__actions .btn svg { width: 12px; height: 12px; }
  .header__actions .btn-dark[data-auth="logged-out"] { display: none; }
  .header__nav-link[data-auth="logged-out"] { font-size: 11px; padding: 5px 6px; }
  .hamburger { width: 32px; height: 32px; }
  .header__icon-btn { width: 32px; height: 32px; }
  .header__icon-btn svg { width: 16px; height: 16px; }

  /* Bottom nav — 480px tweaks */
  .bottom-nav__item svg { width: 20px; height: 20px; }
  .bottom-nav__item span { font-size: 9px; }
  .bottom-nav__center { top: -8px; }
  .bottom-nav__center .btn { width: 44px; height: 44px; }
  .bottom-nav__center .btn svg { width: 20px; height: 20px; }
}

/* Ultra-narrow screens */
@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .header__inner { gap: 4px; }
  .header__logo-icon { height: 32px; }
  .header__logo-text { font-size: 11px; }
  .header__actions .btn { font-size: 10px; padding: 4px 6px; gap: 3px; }
  .header__actions .btn svg { width: 10px; height: 10px; }
  .header__nav-link[data-auth="logged-out"] { font-size: 10px; padding: 4px 5px; }
  .hamburger { width: 30px; height: 30px; }
  .header__icon-btn { width: 30px; height: 30px; }
  .grid-3 { grid-template-columns: 1fr; gap: 12px; }
}

/* Extremely narrow screens */
@media (max-width: 320px) {
  .header__logo-text .logo-ist { display: none; }
}
