/* RESET + BASE */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: white;
  color: black;
  overflow-x: hidden;
}

/* HEADER STRIP */
.ammoh {
  text-align: center;
  font-size: 24px;
  color: white;
  background-color: #d51c1c;
  padding: 15px;
  font-weight: bold;
}

/* IMAGE BANNER */
.oneFive {
  background-image: url('https://armyrecognition.com/images/stories/north_america/united_states/artillery_vehicle/m777/M777_155mm_ultralight_lightweight_towed_howitzer_United_States_925_001.jpg');
  background-size: cover;
  background-position: center;
  border: 5px solid #d51c1c;
  width: 100%;
  height: 150px;
}

.oneFive p {
  margin: 0;
  text-align: center;
  font-size: 45px;
  color: white;
  text-shadow: 2px 2px #d51c1c;
  font-weight: 800;
  padding-top: 40px;
}

.topnav {
  display: flex;
  justify-content: center; /* Centering the content */
  align-items: center;
  background-color: #ffffff;
  padding: 10px;
  gap: 15px;
  border-bottom: 2px solid #d51c1c;
  position: relative;
  z-index: 1000;
}

.topnav a {
  display: inline-block;
  color: black;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
}

.topnav a:hover {
  background-color: #ddd;
}

.topnav a.active {
  background-color: #eb1e1e;
  color: white;
}

.topnav input[type="text"] {
  padding: 6px;
  margin-left: auto;
  margin-right: 10px;
  font-size: 17px;
}

/* DROPDOWN BUTTON */
.dropbtn {
  font-size: 17px;
  border: none;
  color: black;
  padding: 14px 16px;
  background-color: inherit;
  cursor: pointer;
}

/* Ensure dropdown stays visible when hovering over it */
.dropdown:hover .dropdown-content,
.dropdown-content:hover {
  display: block;
}

/* Dropdown container */
.dropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown menu itself */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: white; /* or desired color */
  min-width: 180px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
  z-index: 1000;
  padding: 10px 0;
}

/* Dropdown menu items */
.dropdown-content a {
  color: black;
  padding: 10px 20px;
  text-decoration: none;
  display: block;
  transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
  background-color: #ddd;
}


.dropdown-content-list {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 180px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 9999;
}

.dropdown-content-list li a {
  display: block;
  padding: 10px;
  color: black;
  text-decoration: none;
}

.dropdown-content-list li a:hover {
  background-color: #ddd;
}

.dropdown:hover .dropdown-content-list {
  display: block;
}

/* Dropdown Wrapper */
.dropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown Button */
.dropbtn {
  font-size: 17px;
  border: none;
  color: black;
  padding: 14px 16px;
  background-color: inherit;
  cursor: pointer;
  font-family: inherit;
}

/* Dropdown Content List */
.dropdown-content-list {
  margin-top: -1px; /* Removes hover gap */
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #f9f9f9;
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
}

/* Show on hover */
.dropdown:hover .dropdown-content-list {
  visibility: visible;
  opacity: 1;
}

/* Dropdown list item */
.dropdown-content-list li {
  border-bottom: 1px solid #ddd;
  list-style: none;
}

/* Dropdown links */
.dropdown-content-list li a {
  display: block;
  padding: 10px;
  color: black;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.dropdown-content-list li a:hover {
  background-color: #ddd;
}

/* Ensure sub-dropdowns stay open when hovering them too (if any) */
.sub-dropdown:hover .sub-dropdown-content {
  display: block;
}

.dropdown-content-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dropdown-content-list li {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.sub-dropdown {
  position: relative;
}

.sub-dropdown-content {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  background-color: #f9f9f9;
  min-width: 180px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  z-index: 9999;
  transition: opacity 0.2s ease;
  padding: 0;
}


.sub-dropdown:hover .sub-dropdown-content {
  display: block;
}

.dropdown-content-list li,
.sub-dropdown-content li {
  padding: 0;
  margin: 0;
}

.dropdown-content-list li a,
.sub-dropdown-content li a {
  padding: 8px 14px;
  font-size: 15px;
}


/* Optional subtle fade-in animation */
@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-content-list {
  animation: dropdownFade 0.2s ease-out;
}

.dropdown:hover .dropdown-content-list,
.dropdown-content-list:hover {
  display: block;
}

/* FILTER BUTTONS */
#filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px;
}

#filters button {
  background-color: #d51c1c;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

#filters button:hover {
  background-color: #b01717;
}

/* GRID SECTION */
#gridSection {
  width: 100%;
  background-color: #d51c1c;
  border-top: 4px solid #900;
  padding: 30px 50px;
  box-sizing: border-box;
  overflow-x: hidden;
}

#grid-title {
  color: white;
  text-align: center;
  font-size: 28px;
  margin-bottom: 20px;
}

/* TWO-COLUMN GRID */
.grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  width: 100%;
  box-sizing: border-box;
}

.large-item {
  padding: 30px;
  background-color: #fffbea;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.large-item:first-child {
  border-right: 2px solid #d51c1c;
}

.large-item h3 {
  margin-bottom: 15px;
  font-size: 24px;
  color: #d51c1c;
  text-align: center;
}

.large-item p {
  font-size: 20px;
  margin: 10px 0;
  text-align: left;
}

.grid-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

.button-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

/* BACK TO TOP BUTTON */
#backToTop {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 10002;
  font-size: 18px;
  padding: 12px 20px;
  background-color: #d51c1c;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#backToTop:hover {
  background-color: #b01717;
}


#formOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.8);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
}

#overlayBackground {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#formContainer {
  position: relative;
  z-index: 2;
  max-width: 90vw;
  max-height: 90vh;
}

#formContainer img {
  width: 100%;
  height: auto;
  display: block;
}

.hotspot {
  position: absolute;
  background: transparent;
  border: 2px dashed red;
  box-sizing: border-box;
  cursor: pointer;
}

.hotspot:hover {
  background: rgba(255, 0, 0, 0.1);
}

.hotspot::after {
  content: attr(data-label);
  position: absolute;
  top: -25px;
  left: 0;
  font-size: 14px;
  background: rgba(255, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  display: none;
}

.hotspot:hover::after {
  display: block;
}

#infoPopup {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 20px;
  z-index: 10001;
  border: 2px solid #d51c1c;
  border-radius: 10px;
}

#infoPopup button {
  margin-top: 10px;
  background: #d51c1c;
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #d51c1c;
  color: #fff;
  border: none;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 5px;
  z-index: 10;
  transition: background-color 0.3s;
}

.close-btn:hover {
  background-color: #b01717;
}

.image-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10001;
}

.popup-content {
  position: relative;
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.5);
}

.popup-content img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #d51c1c;
  color: #fff;
  border: none;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.popup-close:hover {
  background-color: #b01717;
}

.popup-close:hover {
  background-color: #b01717;
}

.transfer-container {
  background-color: #b30000;
  padding: 20px;
  margin-bottom: 30px;
  text-align: center;
  border-radius: 8px;
}

.transfer-container h2 {
  color: #fff;
  margin-bottom: 20px;
}


.ammo-transfer-image {
  align-items: center;
  max-width: 90%;
  height: auto;
  margin: 15px auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}

.slideshow-container {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  gap: 20px;
}

.slide-left,
.slide-right {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.slide-left img,
.slide-right img {
  max-width: 90%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}

.slide-btn {
  position: absolute;
  top: 50%;
  background-color: #d51c1c;
  color: #fff;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 24px;
  z-index: 10;
  transform: translateY(-50%);
}

.slide-btn:hover {
  background-color: #b01717;
}

.slide-btn-left {
  left: 10px;
}

.slide-btn-right {
  right: 10px;
}


/* RESPONSIVE DESIGN */
@media screen and (max-width: 768px) {
  .grid-container {
    grid-template-columns: 1fr;
  }

  .topnav {
    flex-direction: column;
    align-items: flex-start;
  }

  .topnav input[type="text"] {
    width: 100%;
    margin: 10px 0;
  }
}
