@font-face {
  font-family: "Poppins-Regular";
  font-style: normal;
  font-weight: 400;
  src: url("https://cdn.ibosoft.net.tr/fonts/google-fonts/Poppins/Poppins-Regular.ttf")
    format("truetype");
}

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

a {
  text-decoration: none;
}

li {
  list-style: none;
}

h1 {
  font-weight: 600;
  font-size: 1.5rem;
}

/* Ensure body uses flexbox to push footer to bottom */
html,
body {
  overflow-x: hidden; /* Prevent horizontal scrolling */
  max-width: 100vw;
}

body {
  font-family: "Poppins-Regular", sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main {
  min-height: 94vh;
  flex: 1;
  transition: all 0.25s ease-in-out;
  background-color: #2a324b;
}

/* Modern responsive iframe layout for aircraft tracking */
.iframe-main {
  flex: 1 !important;
  min-height: 0 !important; /* Important for flexbox to respect container height */
  height: calc(100vh - 120px) !important; /* Explicit height calculation */
  background-color: #2a324b;
  transition: all 0.25s ease-in-out;
  overflow: hidden !important;
  max-width: 100% !important;
  /* Eliminate any padding/margin that could cause gaps */
  padding: 0 !important;
  margin: 0 !important;
  /* Ensure it fills the wrapper completely */
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
}

.responsive-iframe-container {
  width: 100% !important;
  height: 100% !important;
  position: relative !important;
  overflow: hidden !important;
  /* Remove fixed height calculations and let flexbox handle it */
  flex: 1 !important;
  /* Prevent iframe content from causing page scrollbars */
  contain: layout style size;
  /* Eliminate any spacing gaps */
  padding: 0 !important;
  margin: 0 !important;
  line-height: 0;
  /* Explicit minimum height for live server compatibility */
  min-height: 400px;
}

.responsive-iframe-container.loading {
  background: url("./media/loading.gif") center center no-repeat;
  background-size: 100px 100px;
  background-color: #2a324b;
}

.responsive-iframe-container iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  display: block !important;
  /* Remove fixed height restrictions to allow dynamic filling */
  min-height: 100% !important;
  /* Eliminate gaps around iframe */
  margin: 0 !important;
  padding: 0 !important;
  /* Ensure iframe fills container completely */
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
}

/* Additional iframe compatibility rules for live server */
.iframe-main iframe,
.responsive-iframe-container iframe {
  box-sizing: border-box !important;
  object-fit: contain;
  transform: translateZ(0); /* Force GPU acceleration */
}

/* Ensure iframe container takes full available space */
main.iframe-main {
  height: auto !important;
  min-height: calc(100vh - 160px) !important;
}

/* Media query fallbacks for older browsers */
@media screen and (min-width: 1px) {
  .responsive-iframe-container {
    height: calc(100vh - 200px) !important;
    min-height: 500px !important;
  }

  .iframe-main {
    min-height: calc(100vh - 160px) !important;
  }
}

.error-message {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #fff;
  text-align: center;
  padding: 50px;
  background-color: #2a324b;
}

/* Navbar */

.dropdown-submenu {
  position: relative;
}

.dropdown-submenu .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
  padding-left: 0.5rem; /* 2. alt kategori */
}

/* 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;
}

#sidebar {
  width: 70px;
  min-width: 70px;
  z-index: 1000;
  transition: all 0.25s ease-in-out;
  background-color: #0e2238;
  display: flex;
  flex-direction: column;
}

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

.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: 2rem 0;
  flex: 1 1 auto;
}

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;
}

#sidebar:not(.expand) .sidebar-item .sidebar-dropdown {
  position: absolute;
  top: 0;
  left: 70px;
  background-color: #0e2238;
  padding: 0;
  min-width: 15rem;
  display: none;
}

#sidebar:not(.expand) .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;
}

#SideBut {
  background-color: #0e2238;
  border-radius: 25%;
  position: relative;
  overflow: hidden;
  transition: padding 0.3s ease;
  width: 40px;
  height: 40px;
}

#SideBut.clicked::before {
  /* Expand the fade effect to the right when the button is clicked */
  width: 100%;
}

#SideBut::before {
  content: "";
  position: absolute;
  top: 0;
  right: 20px;
  bottom: 0;
  transition: width 0.3s ease;
}

#SideBut.clicked {
  /* Add padding to the left when the button is clicked */
  padding-left: 20px !important;
  width: 50px !important;
}

/* 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;
}

/* 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;
}

/* Responsive adjustments for iframe layout */
@media (min-width: 991.98px) {
  #SideBut {
    display: none;
  }
}

@media (max-width: 991.98px) {
  #sidebar {
    display: none;
  }
  #sidebar2 {
    display: flex;
  }
  #metars {
    flex-direction: column !important;
  }
  .toggle-btn {
    display: none;
  }
  #TitleSide {
    display: none !important;
  }

  /* Ensure iframe takes full width on mobile */
  .wrapper {
    /* Remove fixed height calculation for mobile */
    min-height: 0;
  }

  .iframe-main {
    width: 100%;
    /* Remove fixed height to allow dynamic sizing */
    min-height: 0;
  }
}

/* Diğer kısımlar */

@media (max-width: 991.98px) {
  #metars {
    flex-direction: column !important;
  }
}

@media (max-width: 460px) {
  #HavaBuyuk {
    width: 19rem !important;
  }
}

@media (max-width: 350px) {
  #HavaBuyuk {
    width: 17rem !important;
  }
}

@media (max-width: 385px) {
  #metartaf-hfWuOHTH {
    margin-right: 60px !important;
    width: 270px !important;
  }
}

@media (max-width: 340px) {
  .BlockAudio {
    width: 250px !important;
  }
  [id^="myPeakMeter"] {
    width: 250px !important;
  }
}

/* Footer positioning to prevent content overlap */
footer {
  margin-top: auto;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  background-color: var(--bs-body-bg, #212529);
  /* Ensure footer has no unwanted spacing */
  margin-bottom: 0;
  padding-bottom: 0;
}
