/* ==========================================================================
   ibonav.aero Developer Portal — portal stili
   Sidebar bölümü Ibosoft-AIS-Website style.css'ten alınmıştır (aynı görünüm/sınıflar);
   portal'a özgü kurallar dosyanın sonunda.
   Poppins-Regular @font-face: components/head.php (CDN adresi URL_IBOSOFT_CDN env'inden)
   ========================================================================== */

:root {
  --portal-bg: #2a324b;
  --portal-sidebar: #0e2238;
  --portal-accent: #3b7ddd;
  --portal-link: #6ea8fe;
  --portal-text: #e3e7ef;
  --portal-muted: #9aa4b8;
  --portal-border: rgba(255, 255, 255, 0.12);
  --portal-card: #222a40;
  --portal-code-bg: #1b2236;
}

::after,
::before {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

a {
  text-decoration: none;
}

html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: "Poppins-Regular", sans-serif;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  color: var(--portal-text);
}

.main {
  height: 100vh;
  height: 100dvh;
  flex: 1;
  min-width: 0;
  min-height: 0;
  transition: margin-left 0.25s ease-in-out;
  background-color: var(--portal-bg);
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
}

@media (max-width: 989px) {
  .main {
    margin-left: 70px;
  }
}

/* Sidebar */
.wrapper {
  display: flex;
  align-items: stretch;
  flex: 1;
  /* Remove fixed height calculations to allow dynamic sizing */
  min-height: 0;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

#sidebar {
  width: 70px;
  min-width: 70px;
  z-index: 1000;
  transition: width 0.25s ease-in-out, min-width 0.25s ease-in-out; /* sadece expand/collapse genişliği; height animasyonu yok */
  background-color: #0e2238;
  display: flex !important;
  flex-direction: column;
  position: relative;
  flex-shrink: 0;
  height: 100vh;
  height: 100dvh;
}

#sidebar.expand {
  width: 260px;
  min-width: 260px;
}

/* Header sabit kalsın (scroll'da kaybolmasın) */
#TitleSide {
  flex: 0 0 auto;
}

/* Overlay element for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; /* Navbar kaldırıldı */
  left: 70px; /* JavaScript ile dinamik ayarlanacak */
  width: calc(100% - 70px); /* JavaScript ile dinamik ayarlanacak */
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transition: left 0.25s ease-in-out, width 0.25s ease-in-out, opacity 0.25s ease-in-out;
  opacity: 0;
}

.sidebar-overlay.active {
  display: block;
  pointer-events: auto;
  opacity: 1;
}

/* Mobil cihazlarda sidebar expand olunca overlay olarak açılsın */
@media (max-width: 989px) {
  #sidebar {
    position: absolute !important; /* Mobilde her zaman absolute, içeriği itmesin */
    left: 0 !important;
    top: 0 !important;
    height: 100% !important;
    z-index: 2000 !important; /* Mobilde sidebar her zaman overlay'in üstünde */
  }
  
}

.toggle-btn {
  background-color: transparent;
  cursor: pointer;
  border: 0;
  padding: 1rem 1.5rem;
}

.toggle-btn i {
  font-size: 1.5rem;
  color: #fff;
}

.sidebar-logo {
  margin: auto 0;
}

.sidebar-logo a {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 600;
}

#sidebar:not(.expand) .sidebar-logo,
#sidebar:not(.expand) a.sidebar-link span {
  display: none;
}

.sidebar-nav {
  padding: 0.5rem 0;
  flex: 1 1 auto;
  min-height: 0; /* flex item scroll edebilsin */
  overflow-y: auto; /* sadece nav scroll eder; header + footer sabit kalır */
  overflow-x: hidden; /* daralmış modda yatay scrollbar çıkmasın (açıkça set → auto'ya zorlanmaz) */
  /* İnce/kibar özel scrollbar (Firefox) */
  scrollbar-width: thin;
  scrollbar-color: #2a3744 transparent;
  /* Kenar-farkında scroll gölgesi (dokunmatikte scrollbar gizlense de scroll ipucu verir) */
  background:
    linear-gradient(#0e2238 30%, rgba(14, 34, 56, 0)) center top,
    linear-gradient(rgba(14, 34, 56, 0), #0e2238 70%) center bottom,
    radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)) center top,
    radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)) center bottom;
  background-repeat: no-repeat;
  background-size: 100% 28px, 100% 28px, 100% 14px, 100% 14px;
  background-attachment: local, local, scroll, scroll;
}

/* İnce/kibar özel scrollbar (WebKit/Chromium) */
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: #2a3744;
  border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #3b7ddd;
}

a.sidebar-link {
  padding: 0.625rem 1.625rem;
  color: #fff;
  display: block;
  font-size: 0.9rem;
  white-space: nowrap;
  border-left: 3px solid transparent;
}

.sidebar-link i {
  font-size: 1.1rem;
  margin-right: 0.75rem;
}

a.sidebar-link:hover {
  background-color: rgba(255, 255, 255, 0.075);
  border-left: 3px solid #3b7ddd;
}

.sidebar-item {
  position: relative;
}

/* Daralmış (70px) modda flyout SADECE footer (account/info) için — nav artık scroll
   ettiği için nav flyout'ları kırpılır, o yüzden nav'da flyout kaldırıldı. */
#sidebar:not(.expand) .sidebar-footer .sidebar-item .sidebar-dropdown {
  position: absolute;
  top: 0;
  left: 70px;
  background-color: #0e2238;
  padding: 0;
  min-width: 15rem;
  display: none;
}

#sidebar:not(.expand) .sidebar-footer .sidebar-item:hover .has-dropdown + .sidebar-dropdown {
  display: block;
  max-height: auto;
  width: auto;
  opacity: 1;
}

#sidebar.expand .sidebar-link[data-bs-toggle="collapse"]::after {
  border: solid;
  border-width: 0 0.075rem 0.075rem 0;
  content: "";
  display: inline-block;
  padding: 2px;
  position: absolute;
  right: 1.5rem;
  top: 1.4rem;
  transform: rotate(-135deg);
  transition: all 0.2s ease-out;
}

#sidebar.expand .sidebar-link[data-bs-toggle="collapse"].collapsed::after {
  transform: rotate(45deg);
  transition: all 0.2s ease-out;
}



/* Sidebar alt menü elemanlarının kalınlığını ve yazı ve simge boyutunu azalt */
.sidebar-dropdown .sidebar-item .sidebar-link {
  padding: 0.3rem 1.625rem; /* Yüksekliği azaltmak için padding değerini ayarla */
  font-size: 0.8rem; /* Yazı boyutunu azalt */
}
.sidebar-dropdown .sidebar-item .sidebar-link i {
  font-size: 0.8rem; /* Simge boyutunu azalt */
}

/* Metinlerin taşmasını önleyin */
#sidebar.expand .sidebar-link {
  white-space: nowrap; /* Tek satırda tutar */
  overflow: hidden; /* Taşan metni gizler */
  text-overflow: ellipsis; /* Taşan metni üç nokta ile gösterir */
}

/* Sidebar başlıklarını ortala */
.sidebar-header {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

/* Daralmış (70px) modda nav'da scrollbar çıkınca (6px) başlıklara kalan genişlik
   azalıyor ve "Charts"/"Ibosoft" ellipsis'e düşüyordu; yatay padding'i kısarak
   kaybolan genişliği geri veriyoruz. Geniş mod etkilenmez. */
#sidebar:not(.expand) .sidebar-header {
  padding-left: 0.1rem;
  padding-right: 0.1rem;
}

/* Bölüm başlıkları: geniş modda tam metin, daralmış (70px) modda kısa metin */
.sidebar-header .hdr-short {
  display: none;
}
#sidebar:not(.expand) .sidebar-header .hdr-full {
  display: none;
}
#sidebar:not(.expand) .sidebar-header .hdr-short {
  display: inline;
}

.sidebar-divider {
  margin: 0.35rem 1rem 0.6rem 1rem;
}

/* Sidebar alt menü başlıkları */
.sidebar-subheader {
  font-size: 0.75rem;
  padding: 0.12rem 1.625rem 0.09rem 1.625rem;
  margin: 0;
  text-align: center;
  text-decoration: underline;
}


/* === Sidebar footer (account + links + copyright) === */
.sidebar-footer {
  flex: 0 0 auto; /* scroll dışında, sidebar'ın altına sabit (nav flex:1 zaten aşağı iter) */
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer-nav {
  padding: 0.25rem 0;
  margin: 0;
}

/* Footer'daki dropdown'lar bottom'da oldukları için yukarı doğru açılsın (dropup) */
#sidebar.expand .sidebar-footer .sidebar-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background-color: #0e2238;
  z-index: 1001;
}

/* Daralmış (70px) modda footer flyout'u alta hizalı sağa açılsın */
#sidebar:not(.expand) .sidebar-footer .sidebar-item .sidebar-dropdown {
  top: auto;
  bottom: 0;
}

.sidebar-copyright {
  text-align: center;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.4);
  padding: 0.5rem 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Daralmış (70px) modda "© Ibosoft" görünür kalsın; yıl sığmadığı için gizlenir */
#sidebar:not(.expand) .sidebar-copyright {
  padding: 0.5rem 0.2rem;
}
#sidebar:not(.expand) .copyright-year {
  display: none;
}

/* ==========================================================================
   Portal'a özgü — sidebar ekleri
   ========================================================================== */

.sidebar-nav li,
.sidebar-footer li {
  list-style: none;
}

a.sidebar-link.active {
  background-color: rgba(59, 125, 221, 0.18);
  border-left: 3px solid var(--portal-accent);
}

a.sidebar-link.section-active > span {
  color: #fff;
  font-weight: 600;
}

/* Bölüm içi alt başlık (docs-config 'group') */
.sidebar-group {
  list-style: none;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--portal-muted);
  padding: 0.55rem 1.625rem 0.15rem 2.6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Alt sayfalar ikon taşımaz — ikon boşluğu kadar içeriden başlar */
.sidebar-nav .sidebar-dropdown .sidebar-item .sidebar-link {
  padding-left: 2.6rem;
}

/* ==========================================================================
   Doküman düzeni
   ========================================================================== */

.doc-layout {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 2.5rem 3rem;
}

.doc {
  flex: 1;
  min-width: 0;
  max-width: 920px;
}

.doc-breadcrumb {
  font-size: 0.8rem;
  color: var(--portal-muted);
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.doc-breadcrumb a {
  color: var(--portal-muted);
}

.doc-breadcrumb a:hover {
  color: #fff;
}

.doc-breadcrumb i {
  font-size: 0.6rem;
  opacity: 0.6;
}

.doc-toc {
  position: sticky;
  top: 2rem;
  width: 230px;
  flex: 0 0 230px;
  max-height: calc(100dvh - 4rem);
  overflow-y: auto;
  font-size: 0.8rem;
  border-left: 1px solid var(--portal-border);
  padding-left: 1rem;
}

.doc-toc-title {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--portal-muted);
  margin-bottom: 0.5rem;
}

.doc-toc ul {
  padding: 0;
  margin: 0;
}

.doc-toc li {
  list-style: none;
  margin: 0.25rem 0;
}

.doc-toc li.toc-l3 {
  padding-left: 0.85rem;
}

.doc-toc a {
  color: var(--portal-muted);
  display: block;
  line-height: 1.35;
}

.doc-toc a:hover,
.doc-toc a.active {
  color: #fff;
}

@media (max-width: 1199px) {
  .doc-toc {
    display: none;
  }
}

@media (max-width: 767px) {
  .doc-layout {
    padding: 1.25rem 1rem 2rem;
  }
}

/* ==========================================================================
   Doküman tipografisi (markdown çıktısı)
   ========================================================================== */

.doc-body {
  line-height: 1.7;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.doc-body h1,
.doc-body h2,
.doc-body h3,
.doc-body h4 {
  color: #fff;
  font-weight: 600;
  scroll-margin-top: 1.5rem;
  position: relative;
}

.doc-body h1 {
  font-size: 1.85rem;
  margin: 0 0 1.25rem;
}

.doc-body h2 {
  font-size: 1.4rem;
  margin: 2.25rem 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--portal-border);
}

.doc-body h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.7rem;
}

.doc-body h4 {
  font-size: 1rem;
  margin: 1.4rem 0 0.6rem;
}

.doc-body .heading-anchor {
  margin-left: 0.4rem;
  color: var(--portal-muted);
  opacity: 0;
  transition: opacity 0.15s;
  font-weight: 400;
}

.doc-body h1:hover .heading-anchor,
.doc-body h2:hover .heading-anchor,
.doc-body h3:hover .heading-anchor,
.doc-body h4:hover .heading-anchor {
  opacity: 1;
}

.doc-body a {
  color: var(--portal-link);
}

.doc-body a:hover {
  text-decoration: underline;
}

.doc-body ul,
.doc-body ol {
  padding-left: 1.5rem;
}

.doc-body li {
  margin: 0.2rem 0;
}

.doc-body ul > li:has(> input[type="checkbox"]) {
  list-style: none;
  margin-left: -1.25rem;
}

.doc-body li > input[type="checkbox"] {
  margin-right: 0.4rem;
}

.doc-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.doc-body hr {
  border-color: var(--portal-border);
  opacity: 1;
  margin: 2rem 0;
}

.doc-body blockquote {
  border-left: 4px solid var(--portal-accent);
  background: rgba(59, 125, 221, 0.08);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 0 4px 4px 0;
}

.doc-body blockquote > :last-child {
  margin-bottom: 0;
}

.doc-body code {
  font-size: 0.85em;
  background: var(--portal-code-bg);
  color: #f0c674;
  padding: 0.12em 0.4em;
  border-radius: 4px;
}

.doc-body pre {
  background: var(--portal-code-bg);
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  padding: 0;
  margin: 1rem 0;
  position: relative;
}

.doc-body pre code {
  display: block;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  background: transparent;
  color: var(--portal-text);
  font-size: 0.82rem;
  line-height: 1.55;
  overflow-wrap: normal;
  white-space: pre;
}

.doc-body pre code.hljs {
  background: transparent;
}

.code-copy {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  border: 1px solid var(--portal-border);
  background: var(--portal-card);
  color: var(--portal-muted);
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.doc-body pre:hover .code-copy {
  opacity: 1;
}

.code-copy:hover {
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
}

.doc-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  overflow-wrap: normal;
}

.doc-body th,
.doc-body td {
  border-bottom: 1px solid var(--portal-border);
  padding: 0.5rem 0.75rem;
  vertical-align: top;
  text-align: left;
}

.doc-body th {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.doc-body tr:last-child td {
  border-bottom: 0;
}

.doc-body tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

/* Bilgi kutuları (eksik doküman, OpenAPI durum) */
.notice-inline {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-left: 4px solid var(--portal-accent);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  margin: 1rem 0;
}

.notice-inline > i {
  font-size: 1.25rem;
  color: var(--portal-accent);
  margin-top: 0.15rem;
}

.notice-inline p {
  margin: 0.25rem 0 0;
  color: var(--portal-muted);
}

.notice-page {
  text-align: center;
  padding: 6rem 1rem;
}

.notice-page .notice-icon {
  font-size: 3rem;
  color: var(--portal-accent);
  margin-bottom: 1rem;
}

.notice-page p {
  color: var(--portal-muted);
}

/* ==========================================================================
   Ana sayfa
   ========================================================================== */

.home {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2.5rem;
}

.home-hero {
  margin-bottom: 2.5rem;
}

.home-hero h1 {
  font-size: 2.2rem;
  font-weight: 600;
  color: #fff;
}

.home-hero p {
  color: var(--portal-text);
  font-size: 1.05rem;
}

.home-notice {
  margin: 1.25rem 0 0;
  padding: 0.9rem 1.1rem;
  color: var(--portal-text);
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-left: 4px solid var(--portal-accent);
  border-radius: 6px;
}

.home-notice i {
  color: var(--portal-accent);
  margin-right: 0.25rem;
}

.home-lang-sep {
  margin: 1.75rem 0;
  border-color: var(--portal-border);
  opacity: 1;
}

.home-terms-title {
  color: var(--portal-text);
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.home-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.home-card {
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  transition: border-color 0.15s;
}

.home-card:hover {
  border-color: var(--portal-accent);
}

.home-card-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.home-card-head i {
  color: var(--portal-accent);
  font-size: 1.15rem;
  width: 1.4rem;
  text-align: center;
}

.home-card ul {
  padding: 0;
  margin: 0;
}

.home-card li {
  list-style: none;
  font-size: 0.85rem;
  margin: 0.2rem 0;
}

.home-card li a {
  color: var(--portal-muted);
}

.home-card li a:hover {
  color: #fff;
}

.home-card-more a {
  color: var(--portal-link) !important;
}

@media (max-width: 767px) {
  .home {
    padding: 2rem 1rem;
  }
}
