/* 
  Australian Tamil Church - Modern Redesign
  Design System and Styles
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #0f172a;
  --accent: #3b82f6;
  --background: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --white: #ffffff;
  --glass: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 1rem;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 18px;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  background-color: var(--background);
  line-height: 1.7;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--secondary);
  font-weight: 700;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Sections */
section {
  padding: 60px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.section-header h2 {
  font-size: 3rem;
  margin-bottom: 1.25rem;
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.2rem;
}

/* Navigation */
/* Updated Header Styling */
#header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  transition: var(--transition);
  padding: 1.25rem 0;
}

#header.sticky {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  padding: 0.75rem 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

#header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#header .logo img {
  height: 60px;
  transition: var(--transition);
}

#header.sticky .logo img {
  height: 45px;
}

@media (max-width: 768px) {
  #header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
  }
  #header .logo img {
    height: 50px;
  }
}

#header nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
}

#header nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--white);
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: 1rem;
  letter-spacing: 0.5px;
  transition: var(--transition);
  opacity: 0.85;
}

#header nav a:hover {
  color: var(--primary);
  opacity: 1;
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.mobile-toggle span {
  width: 25px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-toggle.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-toggle.open span:nth-child(2) {
  opacity: 0;
}

.mobile-toggle.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Classic Fade Carousel Restored */
.fade-carousel {
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.fade-carousel .carousel-inner .item {
    height: 100vh;
}

.carousel-indicators {
    bottom: 2rem;
    z-index: 50;
}

.carousel-indicators li {
    width: 12px;
    height: 12px;
    margin: 0 5px;
    background-color: rgba(255, 255, 255, 0.3);
    border: none;
}

.carousel-indicators li.active {
    background-color: var(--primary);
    width: 12px;
    height: 12px;
}

.hero {
    color: var(--white);
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 10;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%);
    width: 100%;
    padding: 0 2rem;
}

.hero h3 {
    color: var(--white);
    font-size: 1.5rem;
    margin-top: 1rem;
    letter-spacing: 2px;
}

@media (max-width: 768px) {
    .hero hgroup img {
        height: 150px !important;
    }
    .hero h3 {
        font-size: 1rem;
        margin-top: 0.5rem;
    }
    .next-service-card {
        display: none; /* Hide card on mobile hero to avoid clutter */
    }
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.7) 0%, rgba(15, 23, 42, 0.4) 100%);
}

.fade-carousel .slides .slide-1,
.fade-carousel .slides .slide-2,
.fade-carousel .slides .slide-3 {
    height: 100vh;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.fade-carousel .slides .slide-1 { background-image: url(img/photo-01.jpg); }
.fade-carousel .slides .slide-2 { background-image: url(img/photo-02.jpg); }
.fade-carousel .slides .slide-3 { background-image: url(img/photo-03.jpg); }

/* Animation for Hero Content */
.fade-carousel .carousel-inner .item .hero {
    opacity: 0;
    transition: transform 1.5s ease-out, opacity 1.5s ease-out;
    transform: translate(-50%, -40%);
}

.fade-carousel .carousel-inner .item.active .hero {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.btn {
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--white);
  color: var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--secondary);
}

/* Service Highlights Card */
.next-service-card {
  position: absolute;
  bottom: 0px;
  right: 2rem;
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--secondary);
  width: 340px;
  box-shadow: var(--shadow-lg);
  z-index: 20;
  animation: slideLeft 1s ease-out 0.6s backwards;
}

.next-service-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.service-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
}

.service-item:last-of-type {
  border-bottom: none;
}

.service-item .time {
  font-weight: 700;
  color: var(--primary);
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 2rem; /* Reduced from 6rem to tighten layout */
}

.about-grid.about-reversed .about-img {
  order: 2;
}

.about-grid.about-reversed .about-content {
  order: 1;
}

@media (max-width: 768px) {
  .about-grid.about-reversed .about-img { order: 0; }
  .about-grid.about-reversed .about-content { order: 0; }
}

.about-content h3 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.about-content p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.stat-item h4 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.stat-item p {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--secondary);
}

/* Beliefs Section */
.beliefs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.belief-card {
  background: var(--white);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.belief-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.belief-number {
  font-size: 4rem;
  font-weight: 800;
  color: #f1f5f9;
  position: absolute;
  top: -10px;
  right: 1rem;
  z-index: 0;
}

.belief-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.belief-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

/* Ministries Section */
.ministries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.ministry-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.ministry-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.ministry-img {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.ministry-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.ministry-card:hover .ministry-img img {
  transform: scale(1.1);
}

.ministry-info {
  padding: 2rem;
}

.ministry-info h3 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.ministry-info p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ministry-contact {
  padding-top: 1.25rem;
  border-top: 1px solid #f1f5f9;
  font-size: 1rem;
}

.phone-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.phone-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.phone-link i {
  font-size: 0.8rem;
  opacity: 0.8;
}

.ministry-contact strong {
  display: block;
  color: var(--secondary);
}

/* Gallery Section */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0.5rem;
  cursor: pointer;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(37, 99, 235, 0.4);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item.hide {
  display: none;
}

.gallery-overlay i {
  font-size: 1.5rem;
  color: var(--white);
}

/* Gallery Filter Buttons */
.btn-filter {
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  border: 1px solid #e2e8f0;
  background: var(--white);
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin: 0 0.25rem;
}

.btn-filter:hover, .btn-filter.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Contact Form Focus States */
.contact-form-container input:focus, 
.contact-form-container textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.lightbox-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90%;
  animation: zoomIn 0.3s ease-out;
}

.lightbox-title {
  color: var(--white);
  margin-top: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  background: rgba(15, 23, 42, 0.6);
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  backdrop-filter: blur(5px);
}

.close-lightbox {
  color: var(--white);
  font-size: 1.25rem;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.close-lightbox:hover {
  background: #ef4444; /* Standard Red for close */
  border-color: #ef4444;
  transform: rotate(90deg);
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Lightbox Navigation */
.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--white);
  font-size: 3rem;
  cursor: pointer;
  z-index: 2002;
  transition: var(--transition);
  padding: 1rem;
  opacity: 0.7;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  background: rgba(15, 23, 42, 0.3);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-prev:hover, .lightbox-next:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-controls {
  position: absolute;
  top: 2rem;
  right: 2.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  z-index: 2005;
}

.lightbox-autoplay {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 0 1.5rem;
  height: 45px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.lightbox-autoplay:hover {
  background: var(--primary);
}

.lightbox-autoplay.active {
  background: var(--primary);
  border-color: var(--primary);
}

.lightbox-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--primary);
  width: 0%;
  transition: width 0.1s linear;
  z-index: 2003;
}

@media (max-width: 768px) {
  .lightbox-prev, .lightbox-next {
    font-size: 2rem;
    padding: 0.5rem;
    width: 45px;
    height: 45px;
  }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
  .close-lightbox { top: 0.75rem; right: 1rem; font-size: 2.5rem; }
  .lightbox-controls { top: 0.8rem; right: 4rem; }
  .lightbox-autoplay { padding: 0.5rem 1rem; font-size: 0.8rem; }
  .lightbox-title { font-size: 1.1rem; padding: 0.4rem 1rem; width: 90%; text-align: center; }
}

/* Footer & Contact */
footer {
  background: var(--secondary);
  color: var(--white);
  padding: 60px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 4rem;
  margin-bottom: 3rem;
  align-items: start;
}

.footer-info h2 {
  color: var(--white);
  margin-bottom: 1.5rem;
}

.footer-info p {
  opacity: 0.7;
  margin-bottom: 2rem;
}

.footer-links h3, .footer-contact h3 {
  color: var(--white);
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

.footer-links ul li {
  margin-bottom: 0.75rem;
}

.footer-links ul li a {
  opacity: 0.7;
}

.footer-links ul li a:hover {
  opacity: 1;
  color: var(--primary);
  padding-left: 5px;
}

.footer-info img {
  height: 60px;
  margin-bottom: 2rem;
  filter: brightness(0) invert(1);
  display: block;
}

.footer-contact p {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  opacity: 0.8;
  align-items: center;
}

.footer-contact i {
  color: var(--primary);
  width: 20px;
  font-size: 1.1rem;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  opacity: 0.8; /* Increased from 0.5 for better visibility */
}

/* Ensure footer text is legible on dark background */
footer p, footer li a {
  color: rgba(255, 255, 255, 0.8) !important;
}

footer h3 {
  color: var(--white) !important;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-content h1 { font-size: 3.5rem; }
  .beliefs-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 3rem; }
}
@media (max-width: 768px) {
  #header {
    background: var(--secondary) !important;
    padding: 10px 0;
    height: 70px;
    display: flex;
    align-items: center;
  }

  #header .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 1rem !important;
    position: relative; /* Base for absolute toggle */
    display: flex;
    justify-content: center; /* Center logo by default on mobile if requested, or keep space-between */
  }

  /* Force logo to be centered on mobile for better branding if menu is on side */
  #header .logo {
    display: block;
    margin: 0 auto !important;
  }

  #header .logo img {
    height: 40px !important;
    max-width: 180px;
  }

  /* Absolute Positioned Toggle for Guaranteed Placement */
  .mobile-toggle {
    display: flex !important;
    position: absolute !important;
    right: 1.5rem !important;
    top: 50% !important;
    transform: translateY(-50%);
    z-index: 1002;
    width: 30px;
    height: 24px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
  }

  .mobile-toggle span {
    background-color: var(--white) !important;
    display: block;
    height: 3px;
    width: 100%;
    border-radius: 3px;
    transition: 0.3s;
  }
  
  nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.98);
    padding: 80px 2rem;
    z-index: 1000;
    flex-direction: column;
    text-align: center;
  }
  
  nav.active {
    display: flex;
  }

  nav ul {
    flex-direction: column;
    gap: 1.5rem;
  }

  nav ul li a {
    font-size: 1.2rem;
    color: var(--white);
    text-transform: uppercase;
    font-weight: 700;
  }

  .hero-content h1 { font-size: 2.2rem; }
  
  .about-grid { grid-template-columns: 1fr; }
  .beliefs-grid { grid-template-columns: 1fr; }
  .ministries-grid { grid-template-columns: 1fr; }
  
  .next-service-card {
    position: relative;
    right: 0;
    width: 100%;
    margin-top: 2rem;
    border-radius: var(--radius);
  }
  
  .hero { height: auto; padding: 120px 0 50px; }
  
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 3rem; text-align: center; }
  .footer-info img { margin: 0 auto 1.5rem auto; }
  .footer-contact p { justify-content: center; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 1rem; align-items: center; }
}
