/* ============================================================
   İKRA GRAFİK WEB — Responsive Layout
   Mobile-first: phone < 640px | tablet 640-1024 | desktop > 1024
   ============================================================ */

/* ── App Shell ── */
#app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}
#app-content-area {
  flex: 1;
  overflow: hidden;
  display: flex;
}
#tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 70px);
}
#tab-content > * { max-width: var(--content-max); margin-left: auto; margin-right: auto; }

/* ── Mobile (< 640px) — Bottom Nav, no sidebar ── */
.bottom-nav  { display: flex; }
.side-nav    { display: none; }
.header-title small { display: none; }
.cat-desc { max-width: 160px; }
.hero-title { font-size: 18px; }
.hero-actions { flex-direction: column; }

/* ── Tablet (≥ 640px) ── */
@media (min-width: 640px) {
  #tab-content { padding: 20px; padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 70px); }
  #tab-content > * { max-width: 680px; }
  .hero-title { font-size: 22px; }
  .hero-actions { flex-direction: row; }
  .cat-desc { max-width: none; }
  .header-title { font-size: 14px; }
  .header-title small { display: block; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Desktop (≥ 1024px) — Side nav, no bottom nav ── */
@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  .side-nav   { display: flex; }
  .ira-fab    { bottom: 24px; }

  #app-content-area { flex-direction: row; }
  #tab-content {
    padding: 28px 32px;
    padding-bottom: 28px;
  }
  #tab-content > * { max-width: 760px; }

  .hero-title { font-size: 26px; }
  .modal-overlay { align-items: center; }
  .modal {
    border-radius: var(--radius-xl);
    margin: 24px;
    max-height: 90dvh;
    max-width: 580px;
    width: 100%;
  }
  .modal-overlay.center .modal { border-radius: var(--radius-xl); }

  /* On desktop, chat takes a panel layout */
  .chat-container { max-height: calc(100dvh - var(--nav-height) - 56px); }
}

/* ── Large desktop (≥ 1280px) ── */
@media (min-width: 1280px) {
  #tab-content > * { max-width: 860px; }
  .hero-title { font-size: 28px; }
}

/* ── Auth page responsive ── */
#auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
#auth-page .auth-header {
  background: var(--brand-navy);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
#auth-page .auth-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 16px 40px;
  overflow-y: auto;
}
#auth-page .auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--app-white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--app-card-border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  flex-shrink: 0;
}
#auth-page .auth-location {
  width: 100%;
  flex-shrink: 0;
}
@media (min-width: 640px) {
  #auth-page .auth-body { align-items: center; padding: 40px 20px; }
  #auth-page .auth-card { max-width: 440px; }
}

/* ── Tab switcher (auth) ── */
.tab-switcher {
  display: flex;
  background: var(--app-bg);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 2px;
}
.tab-switch-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}
.tab-switch-btn.active { background: var(--app-white); color: var(--text-black); box-shadow: var(--shadow-sm); }

/* ── Form sections ── */
.form-section { display: flex; flex-direction: column; gap: 10px; }
.form-section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.form-section-title::after { content: ''; flex: 1; height: 1px; background: var(--app-card-border); }

/* ── Offers filter ── */
.offers-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.offers-filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1.5px solid var(--app-card-border);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--app-white);
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--brand-orange); color: var(--brand-orange); }
.filter-chip.active { border-color: var(--brand-orange); background: var(--brand-orange); color: #fff; }

/* ── Notification dot on nav ── */
@media (min-width: 1024px) {
  .ira-fab { right: 24px; bottom: 24px; }
}

/* ── Columns on larger screens for profile ── */
@media (min-width: 768px) {
  .profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .profile-grid .col-full { grid-column: 1 / -1; }
}

/* ── Create Request page (own page, header stays on top) ── */
.request-overlay {
  position: relative;
  flex: 1;
  min-height: 0;
  z-index: 1;
  background: var(--app-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.request-header {
  background: var(--app-white);
  border-bottom: 1px solid var(--app-card-border);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.request-header h2 { font-size: 16px; font-weight: 800; flex: 1; }
.request-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.request-body > * {
  width: 100%;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 0;
}
.request-footer {
  background: var(--app-white);
  border-top: 1px solid var(--app-card-border);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
}
@media (min-width: 1024px) {
  .request-body { padding: 28px 32px; }
}

/* ── Success screen ── */
.success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 24px;
  text-align: center;
  min-height: 400px;
}
.success-icon { font-size: 64px; animation: bounceIn 0.5s ease both; }
.success-title { font-size: 20px; font-weight: 900; color: var(--text-black); }
.success-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.5; max-width: 320px; }
