:root {
  --background-color-dark: #121212;
  --text-color-dark: #e0e0e0;
  --primary-color-dark: #1f1f1f;
  --secondary-color-dark: #333333;
  --accent-color: #bb86fc;

  --background-color-light: #f5f5f5;
  --text-color-light: #121212;
  --primary-color-light: #ffffff;
  --secondary-color-light: #e0e0e0;
}

html {
  scroll-behavior: smooth;
}

body {
  user-select: none;
  margin: 0;
  font-family: "Roboto", sans-serif;
  background-color: var(--background-color-dark);
  color: var(--text-color-dark);
  transition: background-color 0.5s ease, color 0.5s ease;
}

body.light-mode {
  --background-color-dark: var(--background-color-light);
  --text-color-dark: var(--text-color-light);
  --primary-color-dark: var(--primary-color-light);
  --secondary-color-dark: var(--secondary-color-light);
}

.header-container {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  z-index: 1000;
  transition: top 0.4s ease-in-out;
}

.header-container.visible {
  top: 20px;
}

#navbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(30, 30, 30, 0.7);
  backdrop-filter: blur(10px);
  padding: 8px;
  border-radius: 5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode #navbar {
  background-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-links {
  display: flex;
  gap: 8px;
  padding: 0 10px 0 0;
}

.nav-links a {
  color: var(--text-color-dark);
  text-decoration: none;
  font-size: 24px;
  transition: color 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.nav-links a:hover {
  color: var(--accent-color);
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.theme-toggle {
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color-dark);
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.2);
  margin-left: 2px;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  background-color: rgba(0, 0, 0, 0.4);
}

.theme-toggle .material-icons-sharp {
  position: absolute;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.theme-toggle .sun-icon {
  transform: scale(0) rotate(360deg);
  opacity: 0;
}

body.light-mode .theme-toggle .sun-icon {
  transform: scale(1) rotate(0);
  opacity: 1;
}

body.light-mode .theme-toggle .moon-icon {
  transform: scale(0) rotate(-360deg);
  opacity: 0;
}

body.light-mode .theme-toggle {
  background-color: rgba(255, 255, 255, 0.5);
}
body.light-mode .theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.8);
}

body.light-mode .nav-links a:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.hero-section {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 20px;
  box-sizing: border-box;
}

.parallax-bg {
  position: absolute;
  width: 100%;
  height: 120%;
  top: -10%;
  left: 0;
  background-size: cover;
  background-position: center;
  z-index: -1;
  opacity: 0.2;
  filter: blur(5px);
}

.parallax-left,
.parallax-right {
  position: absolute;
  height: 350px;
  width: auto;
  object-fit: contain;
  z-index: 1;
  opacity: 0.6;
  transition: transform 0.2s ease-out;
}

.parallax-left {
  top: 15%;
  left: 5%;
}

.parallax-right {
  top: 25%;
  right: 5%;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  z-index: 2;
  margin-bottom: 40px;
}

.uruapan-logo img {
  width: 70px;
  height: auto;
}

.uruapan-title h1 {
  font-family: "Montserrat", sans-serif;
  font-size: clamp(3rem, 10vw, 6rem);
  margin: 0;
  line-height: 1;
  letter-spacing: 2px;
}

.florece-text {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 5px;
  margin-top: -5px;
}

.search-section {
  z-index: 2;
  width: 100%;
  max-width: 600px;
}

.search-bar-container {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 15px 25px;
  border-radius: 30px;
  border: 1px solid var(--secondary-color-dark);
  background-color: var(--primary-color-dark);
  color: var(--text-color-dark);
  font-size: 1rem;
  outline: none;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 15px rgba(187, 134, 252, 0.3);
}

.carousel-container {
  margin-top: 25px;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.carousel-container::before,
.carousel-container::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  z-index: 2;
  pointer-events: none;
}

.carousel-container::before {
  left: 0;
  background: linear-gradient(
    to right,
    var(--background-color-dark),
    transparent
  );
}

.carousel-container::after {
  right: 0;
  background: linear-gradient(
    to left,
    var(--background-color-dark),
    transparent
  );
}

.category-carousel {
  display: flex;
  gap: 15px;
  padding: 10px 0;
  animation: scroll 40s linear infinite;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.category-btn {
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid var(--secondary-color-dark);
  background-color: transparent;
  color: var(--text-color-dark);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.category-btn:hover,
.category-btn.active {
  background-color: var(--accent-color);
  color: #121212;
  border-color: var(--accent-color);
  transform: scale(1.05);
}

#content-display {
  padding: 50px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-section {
  position: relative;
  height: 30vh;
  background-color: var(--primary-color-dark);
  margin: 0;
  padding: 0;
  overflow: hidden;
  transition: height 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.gallery-controls {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.location-tag,
.type-tag {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  padding: 4px 12px;
  border-radius: 20px;
  color: #f5f5f5;
  font-size: 0.8rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.location-tag:hover {
  background: rgba(20, 20, 20, 0.8);
}

.expand-btn {
  background-color: var(--accent-color);
  color: #121212;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.expand-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.image-container {
  display: flex;
  height: 30vh;
  width: max-content;
  margin: 0;
  padding: 0;
  animation: auto-scroll 60s linear infinite;
  will-change: transform;
}

@keyframes auto-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.image-container img {
  height: 30vh;
  width: auto;
  display: block;
  margin: 0;
  padding: 0;
  object-fit: cover;
  transition: all 0.3s ease;
}

.gallery-section.expanded {
  height: 120vh;
  overflow-y: auto;
}

.gallery-section.expanded .image-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(150px, auto);
  gap: 5px;
  padding: 10px;
  padding-top: 150px;
  width: 100%;
  height: auto;
  box-sizing: border-box;
  animation: none;
}

.gallery-section.expanded .image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.gallery-section.expanded .image-container img:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
}
.gallery-section.expanded .image-container img:nth-child(4) {
  grid-column: span 2;
}
.gallery-section.expanded .image-container img:nth-child(7) {
  grid-row: span 2;
}
.gallery-section.expanded .image-container img:nth-child(10) {
  grid-column: span 2;
  grid-row: span 2;
}
.gallery-section.expanded .image-container img:nth-child(13) {
  grid-column: span 2;
}

.gallery-section.expanded {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.gallery-section.expanded::-webkit-scrollbar {
  display: none;
}

.support-section {
  display: flex;
  align-items: center;
  justify-content: space-around;
  min-height: 50vh;
  padding: 50px 20px;
  flex-wrap: wrap;
  gap: 40px;
  position: relative;
  overflow: hidden;
}

.support-content-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 40px;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
}

.support-vine {
  position: absolute;
  z-index: 1;
  height: 300px;
  width: auto;
  object-fit: contain;
  opacity: 0.6;
  transition: transform 0.2s ease-out;
  pointer-events: none;
}

.support-vine-tl {
  top: -50px;
  left: -50px;
}

.support-vine-tr {
  top: -50px;
  right: -50px;
  transform: scaleX(-1);
}

.support-vine-bl {
  bottom: -50px;
  left: -50px;
  transform: scaleY(-1);
}

.support-vine-br {
  bottom: -50px;
  right: -50px;
  transform: scale(-1, -1);
}

.add-image-box {
  border: 2px dashed var(--secondary-color-dark);
  border-radius: 15px;
  padding: 40px;
  text-align: center;
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: var(--text-color-dark);
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.add-image-box span {
  font-size: 48px;
}

.add-image-box p {
  margin: 0;
  font-size: 0.9rem;
}

.add-image-box input[type="file"] {
  display: none;
}

.add-image-box.drag-over {
  border-color: var(--accent-color);
  background-color: rgba(187, 134, 252, 0.1);
}

.support-button-container {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#parallax-vine-support {
  position: absolute;
  top: -80px;
  height: 150px;
  opacity: 0.7;
  pointer-events: none;
  z-index: -1;
}

#support-btn {
  background-color: var(--accent-color);
  color: #121212;
  padding: 15px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  box-shadow: 0 5px 15px rgba(187, 134, 252, 0.3);
  transition: all 0.3s ease;
  margin-top: 50px;
}

#support-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(187, 134, 252, 0.4);
}

#donation-section {
  min-height: 60vh;
  background-color: var(--primary-color-dark);
  padding: 80px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.donation-card {
  background-color: var(--background-color-dark);
  border-radius: 15px;
  padding: 30px 40px;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
}

.donation-vine {
  position: absolute;
  z-index: 1;
  height: 300px;
  width: auto;
  object-fit: contain;
  opacity: 0.6;
  transition: transform 0.2s ease-out;
  pointer-events: none;
}

.donation-vine-tl {
  top: -50px;
  left: -50px;
}

.donation-vine-tr {
  top: -50px;
  right: -50px;
  transform: scaleX(-1);
}

.donation-vine-bl {
  bottom: -50px;
  left: -50px;
  transform: scaleY(-1);
}

.donation-vine-br {
  bottom: -50px;
  right: -50px;
  transform: scale(-1, -1);
}

.donation-card h2 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.8rem;
  margin-top: 0;
}

.donation-options {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 25px;
  margin-bottom: 25px;
}

.donation-btn {
  background-color: var(--secondary-color-dark);
  color: var(--text-color-dark);
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.donation-btn:hover {
  background-color: var(--accent-color);
  color: #121212;
}

.donation-card img {
  border-radius: 8px;
  margin-top: 15px;
}

.donation-card p {
  font-size: 0.9rem;
  opacity: 0.8;
  line-height: 1.6;
  margin-top: 20px;
}

#memorial-section {
  min-height: 60vh;
  position: relative;
  padding: 100px 20px 50px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

#memorial-bg {
  position: absolute;
  width: 100%;
  height: 120%;
  top: -10%;
  left: 0;
  background-size: cover;
  background-position: center;
  z-index: -1;
  opacity: 0.2;
  filter: blur(5px);
}

#memorial-left-vine,
#memorial-right-vine {
  position: absolute;
  height: 350px;
  width: auto;
  object-fit: contain;
  z-index: 1;
  opacity: 0.6;
  transition: transform 0.2s ease-out;
}

#memorial-left-vine {
  top: 15%;
  left: 5%;
}

#memorial-right-vine {
  top: 25%;
  right: 5%;
}

#parallax-ribbon {
  position: absolute;
  top: 10px;
  height: 80px;
  opacity: 0.8;
}

#memorial-shield {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin-bottom: 20px;
  object-fit: cover;
  border: 3px solid var(--accent-color);
  box-shadow: 0 0 15px rgba(187, 134, 252, 0.5);
  z-index: 2;
  position: relative;
}

.memorial-text {
  z-index: 2;
  position: relative;
}

.memorial-text h2 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.8rem;
  margin: 10px 0;
}

.memorial-text p {
  font-size: 1.1rem;
  margin: 5px 0;
}

.memorial-text i {
  font-size: 1rem;
  opacity: 0.9;
  margin-top: 15px;
  display: block;
}

footer {
  background-color: transparent;
  border-top: #646464 solid 0.001rem;
  color: #b0b0b0;
  padding: 40px;
  margin-top: -8%;
  text-align: center;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

footer a {
  color: #b0b0b0;
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .header-container.visible {
    top: 10px;
  }

  #navbar {
    padding: 5px;
    gap: 5px;
  }

  .nav-links {
    gap: 2px;
    padding: 0 5px 0 0;
  }

  .nav-links a,
  .theme-toggle {
    font-size: 20px;
    width: 35px;
    height: 35px;
  }

  .hero-section {
    padding: 10px;
  }

  .uruapan-logo img {
    width: 60px;
  }

  .florece-text {
    letter-spacing: 4px;
  }

  .search-section {
    margin-top: 30px;
    width: 95%;
  }

  .carousel-container::before,
  .carousel-container::after {
    width: 50px;
  }

  .gallery-section.expanded {
    height: auto;
    max-height: 200vh;
  }
  .gallery-section.expanded .image-container {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(120px, auto);
    padding-top: 140px;
  }
  .gallery-section.expanded .image-container img:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }
  .gallery-section.expanded .image-container img:nth-child(1) {
    grid-column: span 2;
  }
  .gallery-section.expanded .image-container img:nth-child(5) {
    grid-row: span 2;
  }
  .gallery-section.expanded .image-container img:nth-child(8) {
    grid-column: span 2;
  }

  .support-section {
    padding: 40px 15px;
    flex-direction: column;
  }

  .support-content-wrapper {
    flex-direction: column;
    gap: 40px;
  }

  .support-vine {
    height: 150px;
  }

  .support-vine-tl {
    top: -20px;
    left: -30px;
  }

  .support-vine-tr {
    top: -20px;
    right: -30px;
  }

  .support-vine-bl {
    bottom: -20px;
    left: -30px;
  }

  .support-vine-br {
    bottom: -20px;
    right: -30px;
  }

  .add-image-box {
    width: 90% !important;
    padding: 20px;
  }

  .donation-card {
    padding: 20px;
  }

  .donation-vine {
    height: 150px;
  }

  .donation-vine-tl {
    top: -20px;
    left: -30px;
  }

  .donation-vine-tr {
    top: -20px;
    right: -30px;
  }

  .donation-vine-bl {
    bottom: -20px;
    left: -30px;
  }

  .donation-vine-br {
    bottom: -20px;
    right: -30px;
  }

  footer {
    flex-direction: column;
    margin-top: -30%;
  }

  .parallax-left,
  .parallax-right,
  #memorial-left-vine,
  #memorial-right-vine {
    height: 175px;
    opacity: 0.4;
  }

  .parallax-left,
  #memorial-left-vine {
    top: 5%;
    left: 0;
    right: auto;
  }

  .parallax-right,
  #memorial-right-vine {
    top: 5%;
    right: 0;
    left: auto;
  }
}
