/* =========================================================
   GLOBAL
   ========================================================= */

:root {
  --primary-color: #eff0ed;
  --accent-color: #e6e4e2;
  --border-button-color: #cfccc7;
  --clicked-button: #7c8e84;
  --clicked-text: #22282b;
  --text-color-button: #132429;
  --hover-color-button: #97a59f;
  --screen-size-change: 2440px;
}

body {
  font-weight: 600;
  padding: 0;
  text-align: center;
  background-color: var(--primary-color);
}

*,
*::before,
*::after {
  font-family: "Jost", system-ui !important;
}

button {
  font-weight: 500;
  background-color: var(--accent-color);
  color: var(--text-color-button);
  border-radius: 50px;
  border: 0.01px solid var(--border-button-color);
  cursor: pointer;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
}

button:hover {
  background-color: var(--hover-color-button) !important;
  color: var(--clicked-text) !important;
}

button.active {
  background-color: var(--clicked-button);
  color: var(--clicked-text);
  border: var(--accent-color) 1px solid;
}

button.inactive {
  background-color: #a1a3a5;
  color: #8d9192;
  cursor: default;
}

/* =========================================================
   OVERALL CONTAINER
   ========================================================= */

.overall-container {
  display: flex;
  max-width: 1930px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  overflow: hidden;
}

.Mockup {
  position: absolute;
  width: 99%;
  max-width: 100%;
  height: auto;
  display: block;
  opacity: 100%;
}

/* =========================================================
   LEFT COLUMN
   ========================================================= */

.left-column {
  flex: 0 0 20%;
  max-width: 180px;
  min-width: 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--primary-color);
  height: 100%;
  padding-right: 10px;
  padding-left: 10px;
  padding-bottom: 10px;
}

.Information {
  padding: 10px;
  box-sizing: border-box;
  text-align: left;
  color: #08151d;
  border-bottom: #7c8e84 0.25px solid;
  font-weight: 400;
}

.Title {
  font-weight: 500;
  padding-bottom: 10px;
  text-align: left;
  color: #08151d;
  text-transform: uppercase;
}

#image-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 100%;
}

.extra-image {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.extra-image .image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.extra-image img {
  max-width: 1300px;
  /* max-height: 400px; */
  width: auto;
  height: auto;
  min-width: 60%;
  min-height: 60%;
  object-fit: contain;
  border: #122431 11px solid;
  border-radius: 150px;
}

.extra-image .image-caption {
  font-size: 0.85rem;
  color: #353e47;
  text-align: center;
  max-width: 80%;
  font-weight: 300;
}

.extra-image.show {
  display: flex; /* show modal */
}

#showImageBtn .hide {
  display: none;
}

#showImageBtn.active .show {
  display: none;
}

#showImageBtn.active .hide {
  display: inline;
}

#showImageBtn {
  min-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0px 10px 0px;
}
/* =========================================================
   NUMERIC SORT BLOCK
   ========================================================= */

#sort-controls {
  padding: 10px 0px 10px 0px;
  box-sizing: border-box;
  border-bottom: #7c8e84 0.25px solid;
  border-top: #7c8e84 0.25px solid;
}

#resetBtn {
  width: 100%;
}

#numeric-filters {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 10px;
}

#numeric-filters button {
  display: inline-flex;
  align-items: center;
  padding: 0px 0px 0px 0px;
  gap: 6px;
  min-width: 0;
  box-sizing: border-box;
  text-align: left;
}

/* Numeric button icons */
#numeric-filters button img {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

/* ---- SORT TOGGLE ---- */

.ToggleButton {
  padding-bottom: 10px;
  padding-top: 10px;
}

.sort-toggle {
  width: 100%;
  padding: 6px 12px;
  text-align: left;
  color: #cfc8ba;
  border: var(--border-button-color) 1px solid;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  box-sizing: border-box;
}

.sort-toggle .sort-icon {
  font-size: 16px;
  opacity: 0.3;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.sort-toggle.asc-active .asc,
.sort-toggle.desc-active .desc {
  opacity: 1;
}

#toggleOrderBtn {
  color: #000000;
  flex-direction: row;
  justify-content: center;
}

/* =========================================================
   MAIN CONTAINER
   ========================================================= */

#main-container {
  flex: 1 1 80%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--primary-color);
  max-width: 1600px;
  padding-left: 2%;
  padding-right: 2%;
}

.filter-block {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.Header {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 16px;
  padding-top: 15px;
}

.Header-Title {
  padding: 0px 0px 0px 79px;
  grid-row: 1;
  grid-column: 2;
  border-left: #08151d solid 0px;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: right;

  /* --- Responsive font scaling --- */
  font-size: clamp(10px, 1vw, 48px);
  line-height: 1.1;
  white-space: normal;
}

/* =========================================================
   MENU TOP
   ========================================================= */

.MenuTop {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* =========================================================
   CONTINENT + COUNTRY FILTERS
   ========================================================= */

#continent-country-block {
  width: 100%;
}

#filters {
  display: inline-flex;
  gap: 5px;
  padding-bottom: 10px;
  border-bottom: #7c8e84 solid 0.25px;
  width: auto;
  align-self: flex-start;
}

.continent-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
  gap: 5px;
}

/* =========================================================
   COUNTRY BUTTONS
   ========================================================= */

.country-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.country-buttons button {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0px 8px 0px 0px;
  flex-shrink: 1;
  min-width: 0;
  box-sizing: border-box;
}

.continent-group > button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 1;
  min-width: 0;
}

.country-buttons button img {
  width: 25px;
  height: 25px;
  border-radius: 25px;
  transition: filter 0.2s;
  flex-shrink: 0;
  box-shadow: 0 0 5px #00000050;
}

@media (max-width: 2440px) {
  .country-buttons button span {
    display: none;
  }
}

/* =========================================================
   CONTINENT BUTTONS
   ========================================================= */

.continent-group > button {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 1px 8px 1px 1px;
  box-sizing: border-box;
  white-space: nowrap;
  text-align: center;
  text-transform: uppercase;
}

.continent-group > button img,
.country-flag {
  width: 25px;
  height: 25px;
  border-radius: 25px;
  vertical-align: middle;
  transition: filter 0.2s;
  border: #132429 solid 1px;
  flex-shrink: 0;
}

/* =========================================================
   DROPDOWN FILTERS
   ========================================================= */

.dropdown-filter {
  position: relative;
  display: inline-block;
}

#extra-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 10px;
}

/* ---------------- DROPDOWN FILTERS ---------------- */

.dropdown-filter {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.dropdown-button-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.dropdown-filter button span {
  display: inline;
}

.dropdown-filter > button {
  font-weight: 500;
  background-color: var(--accent-color);
  color: #08151d;
  padding: 0px 8px 0px 0px;
  border: 0.01px solid var(--border-button-color);
  cursor: pointer;
  align-items: center;
  display: inline-flex;
  justify-content: flex-start;
  gap: 6px;
}

.dropdown-filter > button.active {
  background-color: var(--clicked-button);
}

/* Dropdown panel styling */
.dropdown-panel {
  position: absolute;
  top: 125%;
  left: 0;
  transform: translate(20px) !important;
  padding: 20px;
  margin-bottom: 10px;
  background: #08151d;
  border: #2a3747 solid 2px;
  border-radius: 6px;
  box-shadow: 0px 5px 2px rgba(0, 0, 0, 0.2);
  max-height: 200px;
  overflow-y: auto;
  transition: all 0.25s ease;
  z-index: 1000;
  width: max-content;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #cfc8ba;
}

/* Hide native checkbox */
.dropdown-panel input[type="checkbox"] {
  accent-color: #7c8e84;
}

/* Each row inside the dropdown panel */
.dropdown-panel label {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  gap: 6px;
}

/* Text inside panel labels */
.dropdown-panel label span {
  white-space: nowrap;
}

/* Responsive: hide dropdown text on smaller screens */
@media (max-width: 2440px) {
  .dropdown-filter > button span {
    display: none;
  }

  .dropdown-button-icon {
    width: 40px;
    height: 40px;
  }
}

/* ============================================
   CUSTOM SCROLLBAR FOR DROPDOWN PANELS ONLY
   ============================================ */

.dropdown-panel::-webkit-scrollbar {
  width: 8px; /* scrollbar width */
}

.dropdown-panel::-webkit-scrollbar-track {
  background: #0d1c24;
  border-radius: 10px;
}

.dropdown-panel::-webkit-scrollbar-thumb {
  background: #7c8e84;
  border-radius: 10px;
}

.dropdown-panel::-webkit-scrollbar-thumb:hover {
  background: #cfc8ba;
}

/* =========================================================
   DISPLAY + IMAGE + NAVIGATION
   ========================================================= */

.display-block {
  width: 100%; /* full width of parent container */
  padding-bottom: 20px;
}

#display {
  width: 100%; /* make display div full width */
  text-align: center;
  display: block; /* this prevents shrink-wrap overflow */
}

#display img {
  width: 100%;
  height: auto;
  display: block;
}

.image-wrapper img {
  flex-shrink: 0;
}

@media (max-width: 2440px) {
  #display img {
    width: 95%;
    margin-left: auto;
    margin-right: auto;
  }
  .image-wrapper {
    flex-direction: column;
    gap: 8px;
  }
}

/* =========================================================
   ARROWS
   ========================================================= */
/* ARROWS */

.nav-arrow-left,
.nav-arrow-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: #d6d3cd;
  color: #7c8e84;
  border: none;
  cursor: pointer;
  z-index: 10;
  padding: 10px;
  border: #7d8f85 1px solid;

  height: 25%;
  width: 10px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-arrow-left {
  left: -15px;
}

.nav-arrow-right {
  right: -15px;
}

.nav-arrow-left:hover,
.nav-arrow-right:hover {
  background-color: rgba(0, 0, 0, 0.6);
}

@media (max-width: 2440px) {
  .nav-arrow-left {
    left: 15px;
  }

  .nav-arrow-right {
    right: 15px;
  }
}

/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
/* ================= LEFT COLUMN — RESPONSIVE ================= */
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */

@media (max-width: 2440px) {
  /* ---------- Column container ---------- */
  .left-column {
    max-width: 106px;
    padding: 0 5px;
    overflow: hidden;
    display: block;
    border-right: #22282b 1px solid;
    padding-right: 10px;
  }

  .Information {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 15px;
    border-bottom: #7c8e84 0.25px solid;
  }

  .Title {
    padding-bottom: 0px;
  }

  .Information .Text {
    display: none;
  }

  /* ---------- Numeric filters grid ---------- */

  #numeric-filters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  #numeric-filters button {
    display: flex;
    justify-content: center;
    line-height: 0;
  }

  /* #numeric-filters button.active {
    background-color: var(--clicked-button);
    color: var(--clicked-text);
    border: 1px solid var(--accent-color);
  } */

  /* #numeric-filters button.inactive {
    background-color: #a1a3a5;
    color: #8d9192;
    cursor: default;
  } */

  #numeric-filters button span {
    display: none;
  }

  #numeric-filters button img {
    width: 50px;
    height: 50px;
    display: block;
  }

  /* ---------- Sort / reset controls ---------- */
  #sort-controls {
    display: flex;
    justify-content: center;
  }

  #numeric-sort-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
  }

  /* ---------- Reset button ---------- */
  #numeric-filters {
    width: 100%;
  }

  /* ---------- Toggle wrapper ---------- */
  #numeric-filters .ToggleButton {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
  }

  /* ---------- Toggle button ---------- */
  #toggleOrderBtn {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
  }

  #toggleOrderBtn .sort-icon {
    font-size: 16px;
    line-height: 1;
    opacity: 0.7;
  }

  #toggleOrderBtn.asc-active .asc,
  #toggleOrderBtn.desc-active .desc {
    opacity: 1;
  }

  #numeric-filters .ToggleButton {
    grid-column: 1 / -1;
  }
}

/* // NO RESULTS // */

.no-results {
  position: fixed;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #132429;
  text-align: center;
}

/* RESPONSIVE */
/* ======================================================================= */
/* ======================================================================= */
/* ======================================================================= */
/* ======================================================================= */
/* ======================================================================= */
/* ======================================================================= */
/* ======================================================================= */
/* ======================================================================= */
/* ======================================================================= */

@media (max-width: 2440px) {
  /* Main container becomes two columns */
  #main-container {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr;
    align-items: stretch;
  }

  /* Remove vertical stacking behavior */
  .Header-Title {
    display: none;
  }

  #main-container {
    display: grid;
    grid-template-columns: 1fr auto; /* Image left, MenuTop right */
    grid-template-rows: 1fr; /* single row for image + menu */
    gap: 16px;
    align-items: start;
  }

  .display-block {
    grid-column: 1;
    grid-row: 1;
  }

  .MenuTop {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column; /* stack buttons vertically */
    align-items: flex-start;
    max-height: 100vh; /* ensure it doesn’t overflow the viewport */
    border-left: #22282b 1px solid;
    padding-left: 10px;
  }

  #continent-country-block {
    width: 100%;
  }

  #filters {
    display: inline-flex;
    gap: 15px;
    padding-bottom: 10px;
    border-bottom: #7c8e84 solid 0.25px;
    flex-direction: column;
  }

  .continent-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-sizing: border-box;
    gap: 5px;
    width: 109px;
  }

  .country-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .country-buttons button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    flex-shrink: 1;
    min-width: 0;
    box-sizing: border-box;
  }

  .continent-group > button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 1; /* allow shrinking */
    min-width: 0; /* remove any minimum imposed by flex */
    width: 100;
  }

  .country-buttons button img {
    width: 30px;
    height: 30px;
    border-radius: 25px;
    transition: filter 0.2s;
    /* border: #cfc8ba solid 1.5px; */
    flex-shrink: 0; /* prevents image from shrinking too small */
    box-shadow: 0 0 3px #cfc8ba50;
  }

  #extra-filters {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-wrap: wrap;
    height: 225px;
  }

  /* ---------------- DROPDOWN FILTERS ---------------- */

  .dropdown-filter {
    position: relative;
    display: inline-flex;
    align-items: center;
  }

  .dropdown-filter button span {
    display: inline;
  }

  .dropdown-filter > button {
    font-weight: 500;
    background-color: var(--accent-color);
    color: #08151d;
    padding: 0px 0px;
    border: 0.01px solid var(--border-button-color);
    cursor: pointer;
    align-items: center;
    display: inline-flex;
    justify-content: flex-start;
    gap: 6px;
  }

  .dropdown-filter > button.active {
    background-color: var(--clicked-button);
  }

  /* Dropdown panel styling */
  .dropdown-panel {
    position: absolute;
    top: 125%;
    left: 0;
    transform: translate(
      20px
    ) !important; /* X = right offset, Y = upward offset */
    padding: 20px;
    margin-bottom: 10px;
    background: #08151d;
    border: #2a3747 solid 2px;
    border-radius: 6px;
    box-shadow: 0px 5px 2px rgba(0, 0, 0, 0.2);
    max-height: 200px;
    overflow-y: auto;
    transition: all 0.25s ease;
    z-index: 1000;
    width: max-content;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #cfc8ba;
  }

  /* Each row inside the dropdown panel */
  .dropdown-panel label {
    display: flex;
    flex-direction: row; /* checkbox left, text right */
    align-items: center;
    justify-content: flex-start;
    width: 100%; /* fill the panel width */
    gap: 6px;
  }

  /* Text inside panel labels */
  .dropdown-panel label span {
    white-space: nowrap; /* prevent wrapping */
  }

  /* Responsive: hide dropdown text on smaller screens */
  @media (max-width: 2440px) {
    .dropdown-filter > button span {
      display: none; /* keeps icon and arrow only */
    }

    .dropdown-button-icon {
      width: 50px;
      height: 50px;
    }
  }

  /* =========================================================
   COUNTRY BUTTONS
   ========================================================= */

  .country-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
  }

  .country-buttons button {
    padding: 1px 1px;
  }

  @media (max-width: 2440px) {
    .country-buttons button span {
      display: none;
    }
  }

  /* =========================================================
   CONTINENT BUTTONS
   ========================================================= */

  .continent-group > button {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 4px;
    padding: 2px 2px;
    box-sizing: border-box;
    white-space: nowrap;
    text-align: center;
    text-transform: uppercase;
  }

  /* Dropdown panel styling */
  .dropdown-panel {
    top: auto; /* remove previous top */
    bottom: 100%; /* position above the button */
    right: 0; /* align right edge of panel with button */
    left: auto; /* ignore left */
    transform: translate(0, 0); /* no extra transform needed */
  }

  .extra-image {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(8px);
  }

  .extra-image .image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .extra-image img {
    max-width: 1000px;
    /* max-height: 400px; */
    width: auto;
    height: auto;
    min-width: 60%;
    min-height: 60%;
    object-fit: contain;
    border: #122431 11px solid;
    border-radius: 150px;
  }
}
