* {
  --radius: 10px;
  --trans3: all 0.3s ease;
}

@media only screen and (max-width: 768px) {
  /* .wrapper {
    padding-top: 30px;
    padding-bottom: 30px;
  } */
  .body-inner {
    display: block;
  }
  .body-inner .body-sub aside {
    height: auto;
  }
  .sidebar {
    height: 50px;
    width: 100% !important;
    padding: 15px;
    /* overflow: hidden; */
    position: fixed;
    top: 0;
    z-index: 999;
    justify-content: flex-start;
  }
  .mobile-view-buttons {
    opacity: 1;
    pointer-events: all;
  }
  .sidebar .col-main {
    display: none;
  }
  .sidebar.menu-active {
    height: 100%;
  }
  .sidebar.menu-active .col-main {
    display: flex;
    height: 100%;
    max-height: 2000px;
    overflow: auto;
  }
  .sidebar .top .logo-container .logo {
    width: 160px;
    min-height: 20px;
  }
  .sidebar .col-main {
    margin-top: 0;
    height: 0;
    overflow: hidden;
  }
  .floating-bar {
    opacity: 0;
    pointer-events: none;
    transition: var(--trans3);
    transform: translateX(100px);
    top: 125px;
    right: 0.8rem;
  }

  .floating-bar.active {
    opacity: 1;
    pointer-events: all;
    transform: translateX(0px);
  }

  .body-footer.active {
    /* opacity: 1; */
    pointer-events: all;
  }

  .body-footer.active .body-footer-container {
    transform: translateY(0px);
    opacity: 1;
  }

  .map-navigation.active .nav-container {
    transform: translateY(0px);
  }

  .legend-bar-trigger {
    display: block;
    pointer-events: all;
    cursor: pointer;
  }

  .legend-bar-trigger .legend-bar-icon {
    z-index: 80;
    pointer-events: all;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }
  /* .chart-main .floating-bar {
    transform: translateX(100px);
  } */

  .chart-main .floating-bar.active {
    transform: translateX(0px);
  }
  .sidebar .bottom .logos-footer {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar .bottom .logos-footer .footer-logo img {
    width: 100%;
    max-width: 150px;
  }
  .map-navigation {
    top: 3.5rem;
    width: calc(100% - 4vw) !important;
  }

  /* .body-footer {
    opacity: 0;
    pointer-events: none;
    transition: var(--trans3);
  } */

  /* .body-footer .body-footer-container {
    transform: translateY(300px);
    opacity: 0;
    transition: var(--trans3);
  } */

  .map-navigation .nav-container {
    transform: translateY(-200px);
    transition: var(--trans3);
  }
  .mobile-menu-button {
    display: grid;
  }
  .full-screen-view-container .toggle-button.minimize-body-footer-button,
  .full-screen-view-container .toggle-button.full-screen-button {
    display: none;
  }

  .floating-bar.hide {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(100px) !important;
  }

  .body-footer.hide {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .body-footer.hide .body-footer-container {
    transform: translateY(300px) !important;
    opacity: 0 !important;
  }

  .map-navigation.hide .nav-container {
    transform: translateY(-200px) !important;
  }

  /* .floating-bar.hide .rankings-table {
    transform: translateX(0px);
  } */

  .minimize-floatingbar.active {
    opacity: 1;
    pointer-events: all;
  }

  .map-navigation > .nav-container > ul li a::before {
    width: 15px;
    height: 15px;
    border: 3px solid;
  }
  .map-navigation > .nav-container > ul li a {
    padding: 5px;
  }
  .map-navigation > .nav-container > ul li.has-sub > a::after {
    font-size: 1rem;
  }
  .map-navigation > .nav-container > ul {
    gap: 0;
  }
  .restructure .floating-bar {
    top: 110px;
  }

  .restructure .floating-bar .rankings-wrapper .rankings-table .table-body {
    max-height: 70vh;
  }

  .minimize-body-footer {
    display: none;
  }
  .map-navigation .nav-container {
    min-height: 45px;
    display: flex;
  }
  .weighting-chart .weighting-chart-container .weighting-chart-wrapper svg {
    min-width: auto;
    height: 85vh;
  }
  .fullscreen-active .weighting-chart .weighting-chart-container .weighting-chart-wrapper svg {
    height: 85vh;
  }
  .chart-main .floating-bar {
    top: 60px;
    right: 15px;
  }
  .ranking-bar {
    opacity: 0;
    pointer-events: none;
    transition: var(--trans3);
    transform: translateX(100px);
    top: 125px;
    right: 0.8rem;
  }

  .ranking-bar.active {
    opacity: 1;
    pointer-events: all;
    transform: translateX(0px);
  }

  .chart-main .ranking-bar {
    transform: translateX(100px);
  }

  .chart-main .ranking-bar.active {
    transform: translateX(0px);
  }
  .ranking-bar.hide {
    display: block;
    opacity: 1;
    pointer-events: all;
    transform: translateX(0px);
  }
  .ranking-bar.hide .rankings-table {
    transform: translateX(0px);
  }
  .chart-main .ranking-bar {
    top: 100px;
  }
  .minimize-rankingbar.active {
    opacity: 1;
    pointer-events: all;
  }
  .comparison-chart .comparison-chart-container .comparison-chart-wrapper svg {
    min-width: auto;
    height: 98vh;
  }
  .comparison-chart {
    display: none;
  }

  .comparison-mobile-view {
    display: block;
  }
  .comparison-chart-main .body-footer {
    position: fixed;
  }

  .comparison-chart-main .body-footer .body-footer-container .body-footer-wrapper .peroid-filter {
    display: none;
  }

  .country-chart .country-chart-container .country-chart-wrapper .circle-chart {
    width: 80%;
    height: 100%;
    border: 20px solid #ffffff;
    min-width: auto;
    aspect-ratio: 1 / 1;
    /* scale: 0.8; */
  }
  .country-chart .country-chart-container .country-chart-wrapper .circle-chart .circle-item .main-pin.active {
    position: absolute;
  }
  .country-chart-main .charts {
    overflow: unset;
    min-height: 55vh;
    padding-bottom: 50px;
  }
  .charts .charts-container .charts-wrapper {
    height: auto;
  }
  .tabs-nav li .tab-link {
    min-height: 40px;
    padding: 10px 10px;
  }
  .indicators .indicator-item::after {
    font-size: 3rem;
  }
  .country-chart .country-chart-container .country-chart-wrapper .circle-chart .mobile-pin-overlay {
    display: flex;
  }
  .country-chart .country-chart-container .country-chart-wrapper .circle-chart .mobile-pin-overlay .circle-item {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
  }
  .country-chart .country-chart-container .country-chart-wrapper .circle-chart .mobile-pin-overlay .circle-item .main-pin {
    transform: scale(0.9) !important;
  }
  #chart-tooltip {
    display: none;
  }
  #map-child-ring-tooltip {
    display: none;
  }

  /* Weighting chart tooltip mobile fixes */
  .weighting-chart .weighting-chart-container .weighting-chart-wrapper {
    .tooltip-value {
      &.active {
        transform: scale(1) !important;
      }
    }

    .tooltipAnglesNormalized {
      &:hover {
        transform: scale(1) !important;
      }

      &.active {
        transform: scale(1) !important;
      }
    }
  }
  /* .full-screen-view-container .toggle-button span {
    display: block;
  }
  .full-screen-view-container .toggle-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: max-content;
    padding: 0 10px;
  } */
  .charts .scroll-down {
    display: none;
  }
  .body-footer .body-footer-container .body-footer-wrapper .legend-bar .legend-bar-container .legend-bar-item {
    min-width: max-content;
  }
  .timeline-body .map-navigation {
    width: calc(100% - 30px);
  }

  /* Timeline mobile responsive styles - now handled dynamically in JavaScript */
  .timeline-slider .timeline-wrapper .timeline-container .timeline-viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
  }

  /* Ensure arrows are visible when needed */
  .timeline-slider .timeline-wrapper .timeline-container .arrow.hidden {
    opacity: 0;
    pointer-events: none;
  }

  .timeline-slider .timeline-wrapper .timeline-container .arrow.disabled {
    opacity: 0.3;
    pointer-events: none;
  }

  /* Mobile-specific timeline tooltip adjustments */
  .timeline-tooltip {
    font-size: 14px !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    max-width: 200px !important;
    word-wrap: break-word !important;
  }

  /* Removed dot-group active transform that was interfering with D3 positioning */
  .map-view-body.restructure .floating-bar {
    top: 110px;
    right: 15px;
  }
  .sidebar .bottom .bottom-extras .right {
    gap: 15px;
  }
  .tour-tooltip {
    width: 90%;
    max-width: 300px;
  }
  .sidebar .bottom .bottom-extras .tour-trigger-btn .trigger-tooltip {
    display: none;
    left: 40%;
  }
  .country-container-bar.sticky-active {
    top: 50px;
    padding: 0.5rem;
  }
  .country-container-bar select {
    max-width: 400px;
  }
  .sidebar .middle .sidebar-menu {
    max-height: none;
  }
  .restructure .floating-bar .rankings-wrapper .rankings-table .slider-widget-container {
    max-height: 70vh;
  }
  .weighting-chart .weighting-chart-container .weighting-chart-wrapper .alt {
    margin-top: -70px;
  }
  .full-screen-view-container {
    left: 1rem !important;
  }
  .restructure .body-footer {
    scale: 1;
    left: 51%;
  }
  .body-footer {
    transform: translateX(-50%) scale(1);
  }
  .country-chart-main .body-footer {
    position: fixed !important;
    transform: translateX(-51%);
  }

  .chart-group .timeline-item:hover .dot-group .flag {
    width: 24px !important;
    height: 24px !important;
    x: -12 !important;
    y: -13 !important;
  }
  .map-view .map-view-container .map-view-wrapper .map-wrapper #viewport .pin {
    animation: none !important;
  }
  .chart-group .timeline-item:hover .dot-group .number {
    scale: 1;
  }
  .timeline-slider .wrapper {
    padding-bottom: 0px;
  }
  .body-footer .body-footer-container .body-footer-wrapper .chart-colors {
    display: none;
  }
}
@media only screen and (max-width: 600px) {
  .country-chart .country-chart-container .country-chart-wrapper .circle-chart .circle-item .main-pin {
    transform: scale(0.55) !important;
  }
  .country-chart .country-chart-container .country-chart-wrapper .circle-chart .circle-item {
    width: 50px;
    height: 50px;
  }
  .country-chart .country-chart-container .country-chart-wrapper .circle-chart .circle-item.bottom-left {
    bottom: -1vh;
    left: 15%;
  }
  .country-chart .country-chart-container .country-chart-wrapper .circle-chart .circle-item.bottom-right {
    bottom: -1vh;
    right: 15%;
  }
}
@media only screen and (min-width: 481px) and (max-width: 768px) {
  .country-chart .country-chart-container .country-chart-wrapper .circle-chart .circle-item .main-pin {
    transform: scale(0.7) !important;
  }
}
@media only screen and (min-width: 769px) and (max-width: 1024px) {
  .country-chart .country-chart-container .country-chart-wrapper .circle-chart .circle-item .main-pin {
    transform: scale(0.8) !important;
  }
  .country-chart .country-chart-container .country-chart-wrapper .circle-chart {
    min-height: 500px;
  }
  .charts {
    padding-top: 40px;
    padding-bottom: 60px;
  }
  .country-chart-main .body-footer {
    z-index: 9999;
  }
}

@media only screen and (max-width: 1024px) {
  .body-footer .body-footer-container .body-footer-wrapper .legend-bar .legend-bar-wrapper {
    align-items: center;
    flex-direction: column;
    align-items: flex-start;
  }

  .body-footer .body-footer-container .body-footer-wrapper .legend-bar .legend-bar-container .legend-bar-item .col {
    flex-direction: column;
  }

  .body-footer .body-footer-container .body-footer-wrapper .legend-bar .legend-bar-container .legend-bar-item {
    gap: 20px;
  }

  .body-footer .body-footer-container .body-footer-wrapper .legend-bar .legend-bar-container {
    border-radius: var(--radius);
    overflow: hidden;
    overflow-x: auto;
  }

  .body-footer .body-footer-container .body-footer-wrapper .legend-bar .legend-bar-wrapper {
    flex-wrap: wrap;
  }

  .body-footer .body-footer-container .body-footer-wrapper .legend-bar .title {
    text-align: left;
    max-width: 100%;
  }

  .body-footer .body-footer-container .body-footer-wrapper .left {
    align-items: flex-start;
  }

  .body-footer .body-footer-container .body-footer-wrapper .legend-bar .legend-bar-container .legend-bar-item.flip .col {
    flex-direction: column-reverse;
  }
  .body-footer .body-footer-container .body-footer-wrapper .peroid-filter {
    flex-direction: column;
    align-items: flex-start;
  }
  .body-footer .body-footer-container .body-footer-wrapper .peroid-filter p.title {
    max-width: 100%;
  }
  .country-chart-main .body-footer .body-footer-container .body-footer-wrapper {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 0;
  }
  .country-chart-main .body-footer .body-footer-container .body-footer-wrapper .right {
    width: 100%;
    flex: 1;
    min-width: max-content;
  }
  .country-chart-main .body-footer .body-footer-container .body-footer-wrapper .right .footer-floating-bar .icon-list {
    flex-direction: row;
    justify-content: space-between;
  }
  .body-footer .body-footer-container .body-footer-wrapper .right .footer-floating-bar {
    max-width: none;
  }
  .full-screen-view-container .toggle-button {
    width: 50px;
    height: 50px;
    font-size: 25px;
  }
  .tour-tooltip {
    max-width: 700px;
  }
}

@media only screen and (min-width: 769px) {
  .sidebar .toggle-icon {
    display: grid;
  }

  /* Ensure elements are visible by default on larger screens */
  .floating-bar {
    opacity: 1;
    pointer-events: all;
    transform: translateX(0px);
  }

  .body-footer {
    /* opacity: 1; */
    pointer-events: all;
  }

  .body-footer .body-footer-container {
    transform: translateY(0px);
    opacity: 1;
  }

  .map-navigation .nav-container {
    transform: translateY(0px);
  }
}

@media only screen and (min-width: 1024px) and (max-width: 1440px) {
  .country-chart .country-chart-container .country-chart-wrapper .circle-chart .circle-item .main-pin {
    transform: scale(0.8) !important;
  }
  .country-chart .country-chart-container .country-chart-wrapper .circle-chart {
    width: 500px;
    height: 500px;
  }
  .fullscreen-active .country-chart .country-chart-container .country-chart-wrapper .circle-chart {
    height: 550px;
    width: auto;
  }
}

@media only screen and (max-height: 700px) {
  .sidebar .middle .sidebar-menu {
    max-height: none;
  }
}

@media only screen and (orientation: landscape) and (min-width: 320px) and (max-width: 950px) and (hover: none) {
  .sidebar .toggle-icon {
    display: none;
  }
}

@media only screen and (orientation: landscape) and (max-height: 500px) and (max-width: 1024px) {
  .comparison-chart {
    display: none;
  }

  .comparison-mobile-view {
    display: block;
  }
  .full-screen-view-container .toggle-button.minimize-body-footer-button {
    display: none;
  }
  .comparison-mobile-view .wrapper {
    padding-top: 0px;
    padding-bottom: 40px;
  }
  .legend-bar-trigger {
    display: block;
  }
  .comparison-chart-main .body-footer .body-footer-container .body-footer-wrapper .peroid-filter {
    display: none;
  }
  .body-footer .body-footer-container .body-footer-wrapper .chart-colors {
    display: none;
  }
  .minimize-body-footer {
    display: none;
  }
}

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  #ie-warning {
    display: block;
  }
}
