/* ============================================
   MASJID TPT - Custom Stylesheet
   Islamic Theme | Glassmorphism | Responsive
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #0D7C3D;
  --primary-dark: #064E25;
  --primary-light: #15A050;
  --gold: #C9A84C;
  --gold-dark: #8B6914;
  --gold-light: #E8D48B;
  --teal: #0A5C4A;
  --bg-light: #F8F6F0;
  --bg-cream: #FDF8EE;
  --bg-dark: #1A1A2E;
  --white: #FFFFFF;
  --text-dark: #1E293B;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Global Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 16px;
}

section[id] {
  scroll-margin-top: 80px;
}

body {
  font-family: 'Inter', 'Amiri', sans-serif;
  color: var(--text-dark);
  background: var(--bg-light);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-light); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* --- Islamic Pattern Background --- */
.islamic-pattern-bg {
  position: relative;
}
.islamic-pattern-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image:
    repeating-linear-gradient(45deg, var(--primary) 0px, var(--primary) 1px, transparent 1px, transparent 20px),
    repeating-linear-gradient(-45deg, var(--primary) 0px, var(--primary) 1px, transparent 1px, transparent 20px),
    repeating-linear-gradient(0deg, var(--gold) 0px, var(--gold) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(90deg, var(--gold) 0px, var(--gold) 1px, transparent 1px, transparent 40px);
  pointer-events: none;
  z-index: 0;
}

/* --- Glassmorphism Card --- */
.glass-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(13, 124, 61, 0.1);
  transition: var(--transition);
}
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}
.nav-link {
  position: relative;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  transition: var(--transition);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: var(--primary);
  transition: var(--transition);
  transform: translateX(-50%);
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
}
.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* --- Hamburger --- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: var(--text-dark);
  border-radius: 3px;
  transition: var(--transition);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* --- Mobile Nav --- */
.mobile-nav {
  position: fixed;
  top: 0; right: -100%;
  width: 280px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  z-index: 999;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 100px 30px 30px;
  box-shadow: -5px 0 30px rgba(0,0,0,0.1);
}
.mobile-nav.open { right: 0; }
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.mobile-nav-overlay.open { opacity: 1; visibility: visible; }
.mobile-nav .nav-link {
  display: block;
  font-size: 1.1rem;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

/* --- Hero Swiper --- */
.hero-swiper {
  width: 100%;
  height: 60vh;
  min-height: 450px;
}
.hero-swiper .swiper-slide {
  position: relative;
  overflow: hidden;
}
.hero-swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(6,78,37,0.7) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 60px 80px;
}
.hero-overlay h1 {
  font-family: 'Aref Ruqaa', serif;
  color: var(--white);
  font-size: clamp(2rem, 5vw, 3.5rem);
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  margin-bottom: 10px;
}
.hero-overlay p {
  color: rgba(255,255,255,0.9);
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  max-width: 600px;
}
.hero-swiper .swiper-pagination-bullet {
  background: var(--white);
  opacity: 0.5;
  width: 10px; height: 10px;
}
.hero-swiper .swiper-pagination-bullet-active {
  background: var(--gold);
  opacity: 1;
  width: 28px;
  border-radius: 5px;
}
.mitra-pagination {
  position: relative !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  margin-top: 24px !important;
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.mitra-pagination .swiper-pagination-bullet {
  background: var(--primary);
  opacity: 0.3;
  width: 8px; height: 8px;
}
.mitra-pagination .swiper-pagination-bullet-active {
  background: var(--primary);
  opacity: 1;
  width: 20px;
  border-radius: 4px;
  transition: var(--transition);
}
.hero-swiper .swiper-button-next,
.hero-swiper .swiper-button-prev {
  color: var(--white);
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  width: 48px; height: 48px;
  border-radius: 50%;
}
.hero-swiper .swiper-button-next::after,
.hero-swiper .swiper-button-prev::after {
  font-size: 18px;
  font-weight: bold;
}

/* --- Modal Popup --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal-content {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.85) translateY(30px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  position: relative;
}
.modal-overlay.show .modal-content {
  transform: scale(1) translateY(0);
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 10;
  transition: var(--transition);
}
.modal-close:hover { background: rgba(0,0,0,0.7); transform: rotate(90deg); }
.modal-content img {
  width: 100%;
  display: block;
}
.modal-body {
  padding: 24px;
  text-align: center;
}
.modal-body h3 {
  font-family: 'Aref Ruqaa', serif;
  color: var(--primary-dark);
  font-size: 1.3rem;
  margin-bottom: 8px;
}

/* --- Section Common --- */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.section-heading {
  text-align: center;
  margin-bottom: 50px;
}
.section-heading h2 {
  font-family: 'Aref Ruqaa', serif;
  color: var(--primary-dark);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 10px;
  position: relative;
  display: inline-block;
}
.section-heading h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  margin: 12px auto 0;
  border-radius: 3px;
}
.section-heading p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

/* --- Islamic Ornament Divider --- */
.ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
  color: var(--gold);
  font-size: 1.2rem;
}
.ornament-divider::before,
.ornament-divider::after {
  content: '';
  height: 1px;
  width: 80px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* --- Prayer Time Cards --- */
.prayer-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(248,246,240,0.9));
  border: 1px solid rgba(13,124,61,0.1);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.prayer-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  transform: scaleX(0);
  transition: var(--transition);
}
.prayer-card:hover::before, .prayer-card.active::before {
  transform: scaleX(1);
}
.prayer-card.active {
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: white;
  box-shadow: 0 8px 30px rgba(13, 124, 61, 0.3);
  transform: translateY(-4px);
}
.prayer-card.active .prayer-name { color: var(--gold-light); }
.prayer-card.active .prayer-time { color: white; }
.prayer-name {
  font-family: 'Aref Ruqaa', serif;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.prayer-time {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
}

/* --- Countdown --- */
.countdown-box {
  background: linear-gradient(135deg, var(--primary-dark), var(--teal));
  color: white;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.countdown-timer {
  font-size: 2.2rem;
  font-weight: 700;
  font-family: 'Inter', monospace;
  letter-spacing: 2px;
}

/* --- Tables --- */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius);
}
.table-responsive.glass-card {
  padding: 0;
  overflow: hidden;
  overflow-x: auto;
}
.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.styled-table thead {
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: white;
}
.styled-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.styled-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.styled-table tbody tr:hover {
  background: rgba(13, 124, 61, 0.04);
}

/* --- Tab Navigation --- */
.tab-nav {
  display: flex;
  gap: 4px;
  background: rgba(13, 124, 61, 0.06);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 30px;
  overflow-x: auto;
}
.tab-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(13, 124, 61, 0.3);
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeInTab 0.4s ease; }

/* --- QRIS / Finance Cards --- */
.qris-card {
  background: linear-gradient(135deg, var(--primary-dark), var(--teal));
  color: white;
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
}
.qris-card img {
  width: 200px;
  height: 200px;
  background: white;
  border-radius: 12px;
  object-fit:cover;
  /*padding: 10px;*/
  /*margin: 15px auto;*/
}
.finance-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}
.finance-item {
  background: white;
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow);
}
.finance-item.expense { border-left-color: #E74C3C; }
.finance-item.balance { border-left-color: var(--gold); }

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: 40px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 15px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--gold));
}
.timeline-item {
  position: relative;
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -33px; top: 25px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-light);
}
.timeline-year {
  font-family: 'Aref Ruqaa', serif;
  color: var(--gold-dark);
  font-weight: 700;
  font-size: 1.1rem;
}

/* --- Profile Card --- */
.profile-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-align: center;
}
.profile-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.profile-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.profile-card .card-body {
  padding: 20px 16px;
}
.profile-card h4 {
  font-family: 'Aref Ruqaa', serif;
  color: var(--primary-dark);
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.profile-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Article Card --- */
.article-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.article-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.article-card .card-body {
  padding: 24px 20px;
}
.article-card h4 {
  color: var(--primary-dark);
  font-size: 1rem;
  margin-bottom: 8px;
}
.article-card .date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Accordion --- */
.accordion-item {
  background: white;
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  cursor: pointer;
  font-weight: 600;
  color: var(--primary-dark);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
  transition: var(--transition);
}
.accordion-header:hover { background: rgba(13,124,61,0.04); }
.accordion-icon {
  transition: transform 0.3s ease;
  font-size: 1.2rem;
  color: var(--primary);
  flex-shrink: 0;
  margin-left: 12px;
}
.accordion-item.open .accordion-icon { transform: rotate(180deg); }
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  padding: 0 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
}
.accordion-item.open .accordion-body {
  max-height: 500px;
  padding: 0 24px 24px;
}

/* --- Facility Grid Icon --- */
.facility-icon-card {
  text-align: center;
  padding: 28px 20px;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.facility-icon-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.facility-icon-card .icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
  display: block;
}
.facility-icon-card h4 {
  font-size: 0.95rem;
  color: var(--primary-dark);
  margin-bottom: 6px;
}
.facility-icon-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Gallery Grid --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  aspect-ratio: 4/3;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item::after {
  content: '🔍';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  opacity: 0;
  transition: var(--transition);
}
.gallery-item:hover::after { opacity: 1; }

/* --- Footer --- */
.footer {
  background: linear-gradient(135deg, var(--bg-dark), #16213E);
  color: rgba(255,255,255,0.8);
  position: relative;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--gold), var(--primary));
}
.footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: var(--transition);
}
.footer a:hover { color: var(--gold); }
.footer h4 {
  font-family: 'Aref Ruqaa', serif;
  color: var(--gold-light);
  margin-bottom: 16px;
  font-size: 1.1rem;
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(13, 124, 61, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 900;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(13, 124, 61, 0.5);
}

/* --- Animations --- */
@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(13, 124, 61, 0.2); }
  50% { box-shadow: 0 0 20px rgba(13, 124, 61, 0.4); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .hero-swiper { height: 50vh; min-height: 350px; }
}
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .desktop-nav { display: none !important; }
  .hero-swiper { height: 45vh; min-height: 280px; }
  .hero-overlay { padding: 30px 20px; }
  .hero-swiper .swiper-button-next,
  .hero-swiper .swiper-button-prev { display: none; }
  .section-heading { margin-bottom: 30px; }
  .tab-nav { flex-wrap: nowrap; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .profile-card img { height: 160px; }
  .finance-summary { gap: 16px; }
  .finance-item { padding: 20px 16px; }
  .accordion-header { padding: 16px 18px; font-size: 0.9rem; }
  .facility-icon-card { padding: 22px 14px; }
}
@media (max-width: 480px) {
  html { font-size: 14px; }
  .hero-swiper { height: 40vh; min-height: 250px; }
  .gallery-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .modal-content { width: 95%; }
  .back-to-top { bottom: 20px; right: 20px; width: 42px; height: 42px; }
  .article-card .card-body { padding: 20px 16px; }
  .profile-card .card-body { padding: 16px 12px; }
  .facility-icon-card { padding: 20px 12px; }
  .accordion-header { padding: 14px 16px; }
  .finance-summary { grid-template-columns: 1fr; gap: 14px; }
  .finance-item { padding: 22px 20px; }
  .styled-table { min-width: 500px; }
  .table-responsive { -webkit-overflow-scrolling: touch; }
  .styled-table th { padding: 12px 14px; font-size: 0.82rem; }
  .styled-table td { padding: 10px 14px; font-size: 0.82rem; }
}
