/* ===== CSS RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Traditional Chinese Temple Color Palette */
  --primary-red: #8b0000;
  --secondary-red: #dc143c;
  --gold: #ffd700;
  --dark-gold: #b8860b;
  --cream: #f5f5dc;
  --dark-brown: #2f1b14;
  --light-brown: #8b4513;
  --white: #ffffff;
  --black: #000000;
  --shadow: rgba(0, 0, 0, 0.3);

  /* Typography */
  --font-chinese: "Noto Serif SC", serif;
  --font-main: "Inter", sans-serif;

  /* Spacing */
  --section-padding: 80px 0;
  --container-padding: 0 20px;
  --border-radius: 8px;
}

body {
  font-family: var(--font-main);
  line-height: 1.6;
  color: var(--dark-brown);
  background-color: var(--cream);
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--container-padding);
}

/* ===== 3D HEADER WITH FLOATING ELEMENTS ===== */
.header-3d {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  z-index: 1000;
  perspective: 1000px;
}

.header-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--primary-red) 0%,
    var(--secondary-red) 100%
  );
  box-shadow: 0 4px 20px var(--shadow);
  transform: translateZ(0);
}

.floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.floating-element {
  position: absolute;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0.7;
  animation: float 6s ease-in-out infinite;
}

.element-1 {
  width: 20px;
  height: 20px;
  top: 20px;
  left: 10%;
  animation-delay: 0s;
}

.element-2 {
  width: 15px;
  height: 15px;
  top: 30px;
  right: 15%;
  animation-delay: 2s;
}

.element-3 {
  width: 25px;
  height: 25px;
  top: 15px;
  right: 30%;
  animation-delay: 4s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(180deg);
  }
}

/* ===== FLOATING NAVIGATION ===== */
.floating-nav {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  align-items: center;
  backdrop-filter: blur(10px);
  background: rgba(139, 0, 0, 0.9);
}

.nav-container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  clip-path: inset(0% 0% 5% 5%);
}

.temple-name {
  font-family: var(--font-chinese);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gold);
  text-shadow: 2px 2px 4px var(--shadow);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
  position: relative;
  transform: translateZ(0);
}

.nav-link:hover,
.nav-link.active {
  background: var(--gold);
  color: var(--primary-red);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

/* ===== HERO SECTION WITH LAYERED BACKGROUND ===== */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-top: 100px;
}

.layered-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.layer-1 {
  background-image: url("background.png");
  opacity: 0.8;
  transform: translateZ(0);
}

.layer-2 {
  background: linear-gradient(
    45deg,
    rgba(139, 0, 0, 0.3) 0%,
    rgba(255, 215, 0, 0.2) 100%
  );
  transform: translateZ(10px);
}

.layer-3 {
  background: radial-gradient(
    circle at center,
    transparent 0%,
    rgba(0, 0, 0, 0.1) 100%
  );
  transform: translateZ(20px);
}

.hero-content {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  z-index: 10;
  position: relative;
  text-align: center;
}

.hero-text {
  color: var(--white);
  max-width: 800px;
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(255, 215, 0, 0.1);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 215, 0, 0.3);
  transition: all 0.3s ease;
}

.feature-item:hover {
  background: rgba(255, 215, 0, 0.2);
  transform: translateY(-3px);
}

.feature-item i {
  font-size: 2rem;
  color: var(--gold);
}

.feature-item span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--white);
}

.hero-title {
  font-family: var(--font-chinese);
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 3px 3px 6px var(--shadow);
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.hero-description {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 15px 30px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  transform: translateZ(0);
}

.btn-primary {
  background: var(--gold);
  color: var(--primary-red);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover {
  background: var(--dark-gold);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--gold);
}

.btn-secondary:hover {
  background: var(--gold);
  color: var(--primary-red);
  transform: translateY(-3px);
}

.hero-img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px var(--shadow);
  clip-path: inset(0% 0% 5% 5%);
}

/* ===== SACRED DEITIES SECTION ===== */
.deities-section {
  padding: var(--section-padding);
  background: linear-gradient(135deg, var(--cream) 0%, #f0f0f0 100%);
}

.deities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.deity-card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.deity-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--gold);
}

.deity-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(
    135deg,
    var(--primary-red) 0%,
    var(--secondary-red) 100%
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 5px 15px rgba(139, 0, 0, 0.3);
}

.deity-icon i {
  font-size: 2.5rem;
  color: var(--gold);
}

.deity-card h3 {
  font-family: var(--font-chinese);
  font-size: 1.5rem;
  color: var(--primary-red);
  margin-bottom: 0.5rem;
}

.deity-title {
  font-size: 1.1rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 1rem;
}

.deity-description {
  color: var(--dark-brown);
  line-height: 1.6;
  font-size: 0.95rem;
}

.section-title {
  font-family: var(--font-chinese);
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--primary-red);
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--gold);
}

/* ===== ABOUT SECTION ===== */
.about-section {
  padding: var(--section-padding);
  background: var(--white);
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--light-brown);
  margin-top: 1rem;
}

.about-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: start;
}

.history-card {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--cream);
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.history-img {
  width: 200px;
  height: 150px;
  object-fit: cover;
  border-radius: var(--border-radius);
  clip-path: inset(0% 0% 5% 5%);
}

.card-content h3 {
  font-family: var(--font-chinese);
  font-size: 1.5rem;
  color: var(--primary-red);
  margin-bottom: 1rem;
}

.mission-card {
  padding: 2rem;
  background: linear-gradient(
    135deg,
    var(--primary-red) 0%,
    var(--secondary-red) 100%
  );
  color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px var(--shadow);
}

.mission-card h3 {
  font-family: var(--font-chinese);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--gold);
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.stat-item {
  text-align: center;
  padding: 2rem;
  background: var(--gold);
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.stat-number {
  font-family: var(--font-chinese);
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-red);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1.1rem;
  color: var(--dark-brown);
  font-weight: 500;
}

/* ===== TEMPLE SERVICES SECTION ===== */
.services-section {
  padding: var(--section-padding);
  background: linear-gradient(135deg, var(--cream) 0%, #f0f0f0 100%);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.service-card {
  height: 400px;
  perspective: 1000px;
}

.blessing-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  cursor: pointer;
}

.blessing-card:hover {
  transform: rotateY(180deg);
}

.card-inner {
  position: relative;
  width: 100%;
  height: 300px;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-shadow: 0 10px 25px var(--shadow);
}

.card-front {
  background: linear-gradient(
    135deg,
    var(--primary-red) 0%,
    var(--secondary-red) 100%
  );
  color: var(--white);
}

.card-back {
  background: var(--gold);
  color: var(--primary-red);
  transform: rotateY(180deg);
}

.card-front i,
.card-back i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--gold);
}

.card-back i {
  color: var(--primary-red);
}

.card-front h3,
.card-back h3 {
  font-family: var(--font-chinese);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.card-back h4 {
  font-family: var(--font-chinese);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--primary-red);
}

/* ===== COMMUNITY OUTREACH SECTION ===== */
.outreach-section {
  padding: var(--section-padding);
  background: var(--white);
}

.outreach-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-top: 3rem;
}

.outreach-text h3 {
  font-family: var(--font-chinese);
  font-size: 2rem;
  color: var(--primary-red);
  margin-bottom: 1.5rem;
}

.outreach-text p {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  color: var(--dark-brown);
}

.outreach-programs {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.program-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--cream);
  border-radius: var(--border-radius);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.program-item i {
  font-size: 2rem;
  color: var(--primary-red);
  margin-top: 0.5rem;
}

.program-item h4 {
  font-family: var(--font-chinese);
  font-size: 1.2rem;
  color: var(--primary-red);
  margin-bottom: 0.5rem;
}

.outreach-img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 25px var(--shadow);
  clip-path: inset(0% 0% 5% 5%);
}

/* ===== SUBSCRIBE SECTION ===== */
.subscribe-section {
  padding: var(--section-padding);
  background: linear-gradient(
    135deg,
    var(--primary-red) 0%,
    var(--secondary-red) 100%
  );
  color: var(--white);
  text-align: center;
}

.subscribe-content {
  max-width: 600px;
  margin: 0 auto;
}

.subscribe-section .section-title {
  color: var(--gold);
  margin-bottom: 1rem;
}

.subscribe-section .section-subtitle {
  color: var(--white);
  margin-bottom: 3rem;
  opacity: 0.9;
}

.subscribe-form {
  margin-bottom: 2rem;
}

.form-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group input {
  flex: 1;
  padding: 15px 20px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  outline: none;
}

.form-group input:focus {
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
}

.form-note {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ===== CONTACT SECTION ===== */
.contact-section {
  padding: var(--section-padding);
  background: var(--cream);
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 3rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 2rem;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.contact-card:hover {
  transform: translateY(-5px);
}

.contact-card i {
  font-size: 2rem;
  color: var(--primary-red);
  margin-top: 0.5rem;
}

.contact-card h3 {
  font-family: var(--font-chinese);
  font-size: 1.3rem;
  color: var(--primary-red);
  margin-bottom: 0.5rem;
}

.contact-card p {
  color: var(--dark-brown);
  line-height: 1.6;
}

.map-container {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 10px 25px var(--shadow);
}

.map-container iframe {
  width: 100%;
  height: 300px;
  border: none;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--dark-brown);
  color: var(--white);
  padding: 3rem 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
  font-family: var(--font-chinese);
  margin-bottom: 1rem;
  color: var(--gold);
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: var(--white);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: var(--gold);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  display: inline-block;
  width: 40px;
  height: 40px;
  background: var(--primary-red);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-links a:hover {
  background: var(--gold);
  color: var(--primary-red);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--light-brown);
  opacity: 0.8;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .hero-content {
    text-align: center;
  }

  .hero-features {
    gap: 1.5rem;
  }

  .feature-item {
    padding: 0.8rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .history-card {
    flex-direction: column;
    text-align: center;
  }

  .history-img {
    width: 100%;
    height: 200px;
  }

  .outreach-content {
    grid-template-columns: 1fr;
  }

  .contact-content {
    grid-template-columns: 1fr;
  }

  .form-group {
    flex-direction: column;
  }

  .deities-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
  }

  .deity-card {
    padding: 1.5rem;
  }

  .deity-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
  }

  .deity-icon i {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .temple-name {
    font-size: 1.2rem;
  }

  .nav-link {
    padding: 8px 15px;
    font-size: 0.9rem;
  }

  .deities-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .deity-card {
    padding: 1rem;
  }
}

/* ===== ANIMATIONS & TRANSITIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* ===== SCROLL ANIMATIONS ===== */
/* Ensure all sections are visible by default */
.hero-section,
.about-section,
.services-section,
.outreach-section,
.subscribe-section,
.contact-section {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .header-3d,
  .floating-nav,
  .hero-buttons,
  .subscribe-section,
  .footer {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .hero-section {
    margin-top: 0;
  }
}
