@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400..700&display=swap');

/* ===================================
   CSS VARIABLES - Centralized Colors
   =================================== */
:root {
  --color-dark-bg: #220202;
  --color-dark-red: #8b0000;
  --color-crimson: #dc143c;
  --color-very-dark: #1a0505;
  --color-darker: #2a0808;
  --color-gold: #d4af37;
  --color-tan: #937e63;
  --color-light-tan: #a38a6b;
  --color-white: #ffffff;
  --color-off-white: whitesmoke;
  --color-light-gray: #e0e0e0;
  
  --font-display: 'Tangerine', serif;
  --font-heading: 'Playfair Display', 'Georgia', serif;
  --font-body: 'Crimson Text', 'Georgia', serif;
  
  --shadow-default: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 8px 16px rgba(0, 0, 0, 0.3);
  --shadow-heavy: 0 8px 20px rgba(0, 0, 0, 0.6);
  
  --gradient-radial: radial-gradient(circle, #dc143c 0%, #8b0000 50%, #000000 100%);
  --gradient-dark: linear-gradient(135deg, #2a0808 0%, #1a0505 100%);
}

/* ===================================
   BASE RESET
   =================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #000000; /* Fallback */
}

/* ===================================
   HEADER & NAVIGATION
   =================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  background-color: var(--color-dark-bg);
  padding: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  font-size: 21px;
  color: var(--color-white);
}

.navbar .nav-links {
  display: flex;
  gap: 80px;
  align-items: center;
  margin-left: auto;
}

.navbar .nav-links a:last-child {
  margin-right: 80px;
}

.navbar a {
  color: var(--color-off-white);
  text-decoration: none;
  transition: opacity 0.3s;
}

.navbar a:hover {
  text-decoration: underline;
  opacity: 0.6;
}

/* ===================================
   FOOTER
   =================================== */
.site-footer {
  background-color: var(--color-dark-bg);
  padding: 15px;
  font-family: var(--font-display);
  font-size: 25px;
  color: var(--color-white);
}

.footer-contents {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 24px;
  padding: 40px;
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: 10px;
}

.copyright {
  justify-self: center;
  white-space: nowrap;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.footer-contact a {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  color: var(--color-off-white);
  text-decoration: none;
  transition: opacity 0.3s;
}

.footer-contact a:hover {
  text-decoration: underline;
  opacity: 0.6;
}

.footer-contact i {
  width: 22px;
}

/* ===================================
   HOMEPAGE - HERO
   =================================== */
.hero-header {
  background: linear-gradient(rgba(128, 128, 128, 0.4), rgba(128, 128, 128, 0.4)),
              url('../images/homepage-background.png') center/cover no-repeat;
  padding: 60px 20px;
  min-height: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.welcome-box h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 56px;
  /* Text shadow effect for depth */
  text-shadow: 
    2px 2px 0px rgba(0, 0, 0, 0.2),
    4px 4px 0px rgba(0, 0, 0, 0.15),
    6px 6px 0px rgba(0, 0, 0, 0.1);
}

/* ===================================
   HOMEPAGE - GALLERY SECTION
   =================================== */
.gallery {
  background: radial-gradient(circle, #dc143c 0%, #8b0000 50%, #000000 100%);
  padding: 60px 40px;
  display: grid;
  grid-template-columns: 1fr 2px 1fr;
  grid-template-areas: "carousel divider message";
  gap: 60px;
  align-items: center;
  min-height: 600px;
}

.gallery-carousel-side {
  grid-area: carousel;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gallery-title,
.calendar-title {
  font-family: var(--font-display);
  font-size: 48px;
  color: var(--color-white);
  text-align: center;
  margin-bottom: 40px;
}

/* Carousel */
.carousel {
  position: relative;
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  align-items: center;
  gap: 15px;
}

.carousel-viewport {
  overflow: hidden;
  width: 100%;
  height: 550px;
  border-radius: 8px;
  box-shadow: var(--shadow-medium);
  background-color: rgba(0, 0, 0, 0.5);
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease-in-out;
}

.carousel-track img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  flex-shrink: 0;
}

.carousel-btn {
  background-color: var(--color-light-tan);
  border: none;
  color: var(--color-dark-bg);
  font-size: 36px;
  cursor: pointer;
  border-radius: 50%;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.carousel-btn:hover {
  background-color: var(--color-white);
  transform: scale(1.1);
}

.carousel-btn:active {
  transform: scale(0.95);
}

.gallery-divider {
  grid-area: divider;
  width: 2px;
  height: 80%;
  background-color: rgba(255, 255, 255, 0.5);
  justify-self: center;
}

/* Polemarch Message */
.polemarch-message {
  grid-area: message;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
}

.polemarch-message h2 {
  font-family: var(--font-display);
  font-size: 45px;
  margin-bottom: 30px;
  text-align: center;
}

.message-box {
  background-color: rgba(211, 211, 211, 0.9);
  padding: 50px 60px;
  border-radius: 8px;
  box-shadow: var(--shadow-default);
  min-height: 350px;
  max-width: 400px;
  width: 100%;
  display: flex;
  align-items: center;
}

.message-box p {
  font-family: Arial, sans-serif;
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-dark-bg);
  margin: 0;
}

.message-signature {
  margin-top: 30px;
  font-style: italic;
  text-align: right;
}

/* ===================================
   CALENDAR SECTION
   =================================== */
.calendar-section {
  background: radial-gradient(circle, #dc143c 0%, #8b0000 50%, #000000 100%);
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 500px;
}

.calendar-title {
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
  margin-bottom: 30px;
}

.calendar-section iframe {
  border-radius: 8px;
  box-shadow: var(--shadow-medium);
  background-color: var(--color-white);
}

/* ===================================
   ABOUT US PAGE - OPTIMIZED BACKGROUND
   =================================== */
.about-us-main {
  /* FIXED: Direct gradient instead of variable for better compatibility */
  background: radial-gradient(circle, #dc143c 0%, #8b0000 50%, #000000 100%);
  min-height: calc(100vh - 200px);
  padding: 40px 20px 80px;
}

.about-us-hero {
  text-align: center;
  padding: 60px 20px 80px;
  margin-bottom: 40px;
}

.about-us-hero h1 {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 700;
  color: var(--color-white);
  margin: 0 0 10px 0;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
}

.about-us-hero p {
  font-family: var(--font-body);
  font-size: 1.5rem;
  color: var(--color-gold);
  font-style: italic;
  margin: 0;
}

/* Member Grid */
.member-grid {
  display: flex;
  flex-direction: column;
  gap: 50px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
}

.member-row {
  display: flex;
  justify-content: space-between;
  gap: 50px;
}

.member-row-centered {
  justify-content: center;
}

/* Member Circle - PERFORMANCE OPTIMIZED */
.member-circle {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--color-dark-red);
  background-color: var(--color-darker);
  cursor: pointer;
  /* OPTIMIZED: Shorter transitions, GPU acceleration */
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow-heavy);
  flex-shrink: 0;
  will-change: transform;
  /* PERFORMANCE: Force GPU rendering */
  transform: translateZ(0);
  backface-visibility: hidden;
}

.member-circle img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  /* PERFORMANCE: GPU acceleration for images */
  transform: translateZ(0);
  backface-visibility: hidden;
}

.member-circle:hover {
  transform: translateY(-10px) scale(1.05) translateZ(0);
  border-color: var(--color-crimson);
  box-shadow: 0 15px 35px rgba(220, 20, 60, 0.5), 0 5px 15px rgba(0, 0, 0, 0.4);
}

.member-circle:hover img {
  transform: scale(1.1) translateZ(0);
}

.member-circle:focus,
.member-circle:focus-visible {
  outline: 3px solid var(--color-crimson);
  outline-offset: 4px;
}

/* ===================================
   MEMBER DIALOG - OPTIMIZED
   =================================== */
.member-dialog {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.member-dialog.active {
  pointer-events: all;
}

.dialog-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
  cursor: pointer;
}

.member-dialog.active .dialog-overlay {
  background: rgba(0, 0, 0, 0.75);
}

.dialog-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 550px;
  max-width: 90vw;
  height: 100%;
  background: linear-gradient(135deg, #2a0808 0%, #1a0505 100%);
  box-shadow: 10px 0 50px rgba(0, 0, 0, 0.8);
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  border-right: 3px solid var(--color-dark-red);
  /* PERFORMANCE */
  will-change: transform;
  transform: translateX(-100%) translateZ(0);
  backface-visibility: hidden;
}

.member-dialog.active .dialog-content {
  transform: translateX(0) translateZ(0);
}

.dialog-close {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  background: rgba(139, 0, 0, 0.2);
  border: 2px solid var(--color-dark-red);
  border-radius: 50%;
  color: var(--color-white);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.dialog-close:hover {
  background: var(--color-dark-red);
  transform: rotate(90deg);
  box-shadow: 0 0 20px rgba(220, 20, 60, 0.6);
}

.dialog-body {
  padding: 60px 40px 40px;
}

.dialog-image {
  width: 250px;
  height: 250px;
  margin: 0 auto 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 5px solid var(--color-dark-red);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  position: relative;
}

.dialog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialog-info {
  text-align: center;
}

.dialog-name {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-white);
  margin: 0 0 10px 0;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 1px;
  line-height: 1.2;
}

.dialog-title {
  font-family: var(--font-body);
  font-size: 1.3rem;
  color: var(--color-gold);
  font-style: italic;
  margin: 0 0 30px 0;
  font-weight: 600;
}

.dialog-divider {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-crimson), transparent);
  margin: 0 auto 30px;
}

.dialog-description {
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--color-light-gray);
  margin: 0 0 40px 0;
  text-align: left;
  padding: 0 10px;
}

.dialog-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid rgba(139, 0, 0, 0.3);
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  background: rgba(139, 0, 0, 0.1);
  border-left: 3px solid var(--color-dark-red);
  border-radius: 5px;
  transition: all 0.3s ease;
}

.detail-item:hover {
  background: rgba(139, 0, 0, 0.2);
  border-left-color: var(--color-crimson);
  transform: translateX(5px);
}

.detail-item i {
  font-size: 1.3rem;
  color: var(--color-crimson);
  width: 25px;
  text-align: center;
}

.detail-item span {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--color-white);
  font-weight: 600;
}

/* Scrollbar */
.dialog-content::-webkit-scrollbar {
  width: 8px;
}

.dialog-content::-webkit-scrollbar-track {
  background: var(--color-very-dark);
}

.dialog-content::-webkit-scrollbar-thumb {
  background: var(--color-dark-red);
  border-radius: 4px;
}

.dialog-content::-webkit-scrollbar-thumb:hover {
  background: var(--color-crimson);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 1200px) {
  .member-grid { gap: 40px; padding: 0 30px; }
  .member-row { gap: 40px; }
  .member-circle { width: 180px; height: 180px; }
  .about-us-hero h1 { font-size: 3.5rem; }
}

@media (max-width: 900px) {
  .member-grid { gap: 35px; }
  .member-row { gap: 35px; flex-wrap: wrap; justify-content: center; }
  .member-circle { width: 160px; height: 160px; }
  .about-us-hero h1 { font-size: 3rem; }
  .about-us-hero p { font-size: 1.3rem; }
}

@media (max-width: 850px) {
  .gallery {
    grid-template-columns: 1fr;
    grid-template-areas: "carousel" "message";
    gap: 60px;
  }
  .gallery-divider { display: none; }
  .carousel { grid-template-columns: 60px 1fr 60px; }
  .calendar-section iframe { width: 100%; max-width: 800px; }
}

@media (max-width: 800px) {
  .footer-contents {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .member-grid { gap: 25px; padding: 0 20px; }
  .member-row { gap: 25px; }
  .member-circle { width: 140px; height: 140px; border-width: 3px; }
  .about-us-hero { padding: 40px 20px 60px; }
  .about-us-hero h1 { font-size: 2.5rem; }
  .about-us-hero p { font-size: 1.1rem; }
  .dialog-content { width: 100%; max-width: 100%; }
  .dialog-body { padding: 80px 25px 30px; }
  .dialog-image { width: 200px; height: 200px; margin-bottom: 30px; }
  .dialog-name { font-size: 2rem; }
  .dialog-title { font-size: 1.1rem; }
  .dialog-description { font-size: 1rem; }
  .detail-item { padding: 12px 15px; }
  .detail-item span { font-size: 1rem; }
}

@media (max-width: 400px) {
  .member-grid { gap: 20px; }
  .member-row { gap: 20px; }
  .member-circle { width: 120px; height: 120px; }
  .about-us-hero h1 { font-size: 2rem; }
  .about-us-hero p { font-size: 1rem; }
}

/* ===================================
   CONTACT PAGE
   =================================== */
.contact-main {
  background: radial-gradient(circle, #dc143c 0%, #8b0000 50%, #000000 100%);
  min-height: calc(100vh - 200px);
  padding: 40px 20px 80px;
}

.contact-hero {
  text-align: center;
  padding: 60px 20px 80px;
  margin-bottom: 40px;
}

.contact-hero h1 {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 700;
  color: var(--color-white);
  margin: 0 0 10px 0;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
}

.contact-hero p {
  font-family: var(--font-body);
  font-size: 1.5rem;
  color: var(--color-gold);
  font-style: italic;
  margin: 0;
}

.contact-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

/* Contact Cards */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 20px;
}

.contact-card {
  background: rgba(42, 8, 8, 0.8);
  border: 2px solid var(--color-dark-red);
  border-radius: 12px;
  padding: 40px 30px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.contact-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-crimson);
  box-shadow: 0 8px 25px rgba(220, 20, 60, 0.4);
}

.contact-card .card-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--color-dark-red), var(--color-crimson));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--color-white);
  box-shadow: 0 4px 15px rgba(220, 20, 60, 0.3);
}

.contact-card h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-white);
  margin: 0 0 15px 0;
}

.contact-card a {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--color-gold);
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-card a:hover {
  color: var(--color-white);
  text-decoration: underline;
}

/* PayPal Section */
.paypal-section {
  background: rgba(42, 8, 8, 0.9);
  border: 3px solid var(--color-dark-red);
  border-radius: 16px;
  padding: 50px 40px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.section-header i {
  font-size: 2.5rem;
  color: var(--color-gold);
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--color-white);
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.paypal-description,
.form-description {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--color-light-gray);
  line-height: 1.8;
  max-width: 700px;
  margin: 0 auto 30px;
}

.paypal-button-container {
  margin-top: 30px;
}

.paypal-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #0070ba, #003087);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 1.3rem;
  font-weight: 600;
  padding: 18px 45px;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 112, 186, 0.4);
}

.paypal-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 112, 186, 0.6);
  background: linear-gradient(135deg, #003087, #001f5b);
}

.paypal-button i {
  font-size: 1.5rem;
}

.paypal-note {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-light-gray);
  margin-top: 15px;
  font-style: italic;
}

/* Google Form Section */
.form-section {
  background: rgba(42, 8, 8, 0.9);
  border: 3px solid var(--color-dark-red);
  border-radius: 16px;
  padding: 50px 40px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.form-section .section-header {
  margin-bottom: 20px;
}

.google-form-container {
  margin-top: 30px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.google-form-container iframe {
  display: block;
  width: 100%;
  border: none;
  background: white;
}

/* Social Media Section */
.social-section {
  text-align: center;
  padding: 40px 20px;
}

.social-section h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--color-white);
  margin: 0 0 40px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.social-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 25px 35px;
  background: rgba(42, 8, 8, 0.8);
  border: 2px solid var(--color-dark-red);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
  min-width: 140px;
}

.social-link:hover {
  transform: translateY(-5px);
  border-color: var(--color-crimson);
  box-shadow: 0 8px 25px rgba(220, 20, 60, 0.4);
}

.social-link i {
  font-size: 3rem;
  color: var(--color-white);
  transition: color 0.3s ease;
}

.social-link span {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--color-gold);
  font-weight: 600;
}

.social-link.instagram:hover i {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.social-link.facebook:hover i {
  color: #1877f2;
}

.social-link.twitter:hover i {
  color: #1da1f2;
}

/* Contact Page Responsive */
@media (max-width: 768px) {
  .contact-hero h1 {
    font-size: 3rem;
  }
  
  .contact-hero p {
    font-size: 1.2rem;
  }
  
  .section-header {
    flex-direction: column;
    gap: 10px;
  }
  
  .section-header h2 {
    font-size: 2rem;
  }
  
  .paypal-section,
  .form-section {
    padding: 35px 25px;
  }
  
  .social-links {
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .contact-hero h1 {
    font-size: 2.5rem;
  }
  
  .contact-cards {
    grid-template-columns: 1fr;
  }
  
  .paypal-button {
    font-size: 1.1rem;
    padding: 15px 35px;
  }
}