body {
  overflow-x: hidden;
}
.gallerytop {
  display: flex;
  justify-content: center;
  margin-top: 0;
  padding-top: 10px;
  margin-bottom: 10px;
}

.gallerytle {
  margin-top: 7px;
  display: flex;
  justify-content: center;
}

.gallery {
  display: flex;
  justify-content: center;
}

.save-button {
  display: none;
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a2e;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  z-index: 2;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.save-button:hover {
  background: #55bcc9;
}

.download-button {
  display: none;
  position: absolute;
  bottom: 12px;
  right: 60px;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a2e;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  z-index: 2;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.download-button:hover {
  background: #55bcc9;
}

.image-container:hover .download-button {
  display: flex;
}

.image-container:hover .save-button {
  display: flex;
}

.image-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease;
  margin-bottom: 16px;
  break-inside: avoid;
}

/* Image hover effect */
.image-container:hover {
  transform: translateY(-4px);
}

.image-container img {
  width: 100%;
  display: block;
  transition: all 0.3s ease;
}

.image-container::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.image-container:hover::before {
  opacity: 1;
}

/* Username styling moved to bottom of file */

.bodyclass {
  display: flex;
  justify-content: center;
  padding: 0 20px;
}

.grid {
  columns: 4;
  column-gap: 16px;
  max-width: 1500px;
  width: 100%;
}

@media (max-width: 1200px) {
  .grid {
    columns: 3;
  }
}

@media (max-width: 900px) {
  .grid {
    columns: 2;
    column-gap: 12px;
  }
  
  .image-container {
    margin-bottom: 12px;
  }
}

@media (max-width: 600px) {
  .grid {
    columns: 1;
    column-gap: 0;
  }
  
  .image-container {
    margin-bottom: 12px;
    border-radius: 8px;
  }
  
  .bodyclass {
    padding: 0 10px;
  }
}

.loading-icon {
  display: block;
  /* text-align: center;
        font-size: 20px;
        margin-top: 20px; */

  height: 100px;
  justify-content: center;
  display: flex;
  align-items: center;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#galleryContainer {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.search-bar {
  border-radius: 20px;
  background-color: #f0f0f0;
  padding: 10px 15px;
  width: 800px; /* Keeps it from growing too large */
  border: #55bcc9;
}

.search-term {
  padding: 10px 15px;
  margin-bottom: 20px;
  margin-right: 10px;
  background-color: #f0f0f0;
  border-radius: 15px;
  font-size: 14px;
  outline: none;
  border: none;
}

.search-term:hover {
  background-color: black;
  color: white;
  transition: 0.3s ease-in-out;
}

.top-search-terms {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  padding: 10px 5px;
  scrollbar-width: thin;
  scrollbar-color: #7c7c7c #f0f0f0;
}

.top-search-terms:active {
  cursor: grabbing;
}

.btn-s {
  padding: 10px 15px;
  margin-bottom: 20px;
  margin-right: 10px;
  background-color: black;
  border-radius: 15px;
  font-size: 14px;
  border: none;
  color: white;
}

.btn-s:hover {
  background-color: #55bcc9;
  transition: 0.3s ease-in-out;
  color: white;
}

@media (max-width: 768px) {
  /* Mobile: header handles top padding now */
  .gallerytop {
    padding-top: 10px;
  }

  .search-bar {
    width: 340px;
  }

  .search-term {
    font-size: 10px;
    width: 60px;
    padding: 4px 6px;
    margin-right: 4px;
  }
  
  .popular-searches-label {
    font-size: 11px;
  }
}

/* Tablets and small laptops */
@media (max-width: 992px) and (min-width: 769px) {
  .gallerytop {
    padding-top: 10px;
  }
}

.login-error-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ff7f7f;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  z-index: 9999;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  animation: fadeInOut 3s ease;
}

.download-button img {
  height: 20px;
  width: 20px;
  filter: invert(1);
}

.save-button img {
  height: 20px;
  width: 20px;
  filter: invert(1);
}

/* Make icons white when button is hovered (cyan background) */
.download-button:hover img,
.save-button:hover img {
  filter: invert(0);
}
/* @media (min-width:900px) {
  .image-username {
    font-size: 20px;
  }
}
@media (min-width: 900px) and (max-width: 1200px) {
  .image-username {
    font-size: 16px;
  }
} */
.search-wrapper {
  position: relative;
  width: 100%;
}

.btn-s {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  border: none;
  background: none;
  padding: 0 10px;
  cursor: pointer;
}

.search-icon {
  width: 20px; /* Adjust size as needed */
  height: 20px;
  display: block;
}
.top-search-terms-container {
  width: 100%;
  max-width: 1200px;
  margin: 5px auto;
  padding: 1px;
  position: relative;
  background-color: transparent; /* Remove background */
}

/* Remove fade effects */
.top-search-terms-container::before,
.top-search-terms-container::after {
  display: none;
}

/* Update search terms container */
.top-search-terms {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  padding: 10px 5px;
  scrollbar-width: thin;
  scrollbar-color: #6e6e6e #f0f0f0;
}

/* Custom scrollbar styling */
.top-search-terms::-webkit-scrollbar {
  display: block;
  height: 8px;
}

.top-search-terms::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.top-search-terms::-webkit-scrollbar-thumb {
  background: #55bcc9;
  border-radius: 4px;
}

.top-search-terms::-webkit-scrollbar-thumb:hover {
  background: #000000;
}

/* Update search term buttons */
.search-term-link {
  display: inline-block;
  padding: 8px 20px;
  background-color: #e4e4e4;
  border: none;
  border-radius: 25px;
  color: rgb(0, 0, 0);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  margin: 0 5px;
}

.search-term-link:hover {
  background-color: #000000;
  color: white;
  transform: translateY(-2px);
}

#topSearchTermsList {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 10px;
}

#topSearchTermsList li {
  flex: 0 0 auto;
}

/* Custom Alert Box Styling */
.custom-alert {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; /* Enable scroll if needed */
  background: rgba(0, 0, 0, 0.5); /* Black background with opacity */
  justify-content: center; /* Center horizontally */
  align-items: center; /* Center vertically */
  backdrop-filter: blur(5px); /* Blur effect for the rest of the page */
}

/* Alert Content Styling */
.custom-alert-content {
  background: rgb(
    255,
    255,
    255
  ); /* Light white background with slight transparency */
  padding: 20px;
  border-radius: 8px; /* Rounded corners */
  width: 80%; /* Adjust width as needed */
  max-width: 500px; /* Maximum width */
  text-align: center;
}

/* Text Color */
.custom-alert-content p {
  color: #000000; /* White text color */
}

/* Button Styling */
.custom-alert button {
  background-color: #000000; /* Light cyan blue background */
  color: #ffffff; /* Darker text color */
  border: none;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin-top: 10px;
  cursor: pointer;
  border-radius: 5px; /* Rounded button corners */
}

.custom-alert button:hover {
  background-color: #55bcc9; /* Slightly darker cyan blue on hover */
}
.username {
  color: inherit; /* Inherit color from the parent element */
  text-decoration: none; /* Remove underline */
}
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* background-color: rgba(255, 255, 255, 0.8); */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999; /* Ensure it's on top of other content */
  background: rgba(0, 0, 0, 0.25); /* subtle dim, transparent */
}

/* Pure CSS spinner via pseudo-element (no HTML changes) */
.loading-overlay::after {
  content: "";
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.35);
  border-top-color: #55bcc9;
  animation: spin 0.9s linear infinite;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.02) inset;
}

/* Hide old GIF if present */
.loading-gif {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Visibility helpers */
.hidden {
  display: none;
}

/* Show images by default, hide only while gallery is hidden */
#gallery .gallery-image {
  display: block;
}
#gallery.hidden .gallery-image {
  display: none;
}

/* If you have a homepage-specific style, you might want to add: */
.homepage-navbar + .gallerytop {
  padding-top: 0; /* Remove padding for homepage if needed */
}

/* =============================================
   GALLERY HEADER
   ============================================= */
.gallery-header {
  text-align: center;
  padding: 100px 24px 20px;
  background: #f8fafc;
}

body.dark-mode .gallery-header {
  background: #0a0a0a;
}

.gallery-title {
  font-family: 'MuseoModerno', sans-serif;
  font-size: 36px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 12px 0;
}

body.dark-mode .gallery-title {
  color: #f1f5f9;
}

.gallery-title span {
  color: #55bcc9;
}

.gallery-subtitle {
  font-size: 16px;
  color: #64748b;
  margin: 0;
  max-width: 500px;
  margin: 0 auto;
}

body.dark-mode .gallery-subtitle {
  color: #94a3b8;
}

@media (max-width: 768px) {
  .gallery-header {
    padding: 24px 16px 16px;
  }
  
  .gallery-title {
    font-size: 28px;
  }
  
  .gallery-subtitle {
    font-size: 14px;
  }
}

/* =============================================
   POPULAR SEARCHES LABEL
   ============================================= */
.popular-searches-label {
  display: block;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

body.dark-mode .popular-searches-label {
  color: #94a3b8;
}

/* =============================================
   IMPROVED USERNAME BADGE ON IMAGES
   ============================================= */
.image-username {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 3;
  display: none;
}

.image-username .username {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
  text-shadow: none;
}

.image-username .username::before {
  content: '@';
  opacity: 0.7;
}

.image-username .username:hover {
  background: rgba(85, 188, 201, 0.85);
  border-color: rgba(85, 188, 201, 0.5);
  transform: translateY(-2px);
}

.image-container:hover .image-username {
  display: block;
}

/* =============================
   Dark Mode: Gallery page tweaks
   ============================= */
/* Make the search icon white in dark mode for readability */
body.dark-mode .gallerytop .search-icon {
  filter: invert(1) brightness(1.2) contrast(1.1);
}

/* Top search terms: use very dark grey chips with light text */
body.dark-mode .search-term-link {
  background-color: #171717 !important;
  color: #eaeaea !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
/* Dark mode hover: make background black for stronger contrast */
body.dark-mode .search-term-link:hover {
  background-color: #000000 !important;
  color: #ffffff !important;
}

/* Dark-friendly scrollbar for the top search terms scroller */
body.dark-mode .top-search-terms {
  scrollbar-color: #55bcc9 #0f0f0f; /* thumb, track for Firefox */
}
body.dark-mode .top-search-terms::-webkit-scrollbar-track {
  background: #0f0f0f;
}
body.dark-mode .top-search-terms::-webkit-scrollbar-thumb {
  background: #55bcc9;
}
body.dark-mode .top-search-terms::-webkit-scrollbar-thumb:hover {
  background: #3aa8b5; /* slightly darker teal on hover */
}
