/* ======================================
   GLOBAL VARIABLES
====================================== */
:root {
  --primary-green: #0E5E35;
  --secondary-green: #1B8952;
  --accent-gold: #D4AF37;
  --bg-light: #F7FDF9;
  --white: #ffffff;
  --text-dark: #222222;
  --text-grey: #555555;
  --border-color: #e6f0dc;
  --shadow-sm: 0 4px 12px rgba(14, 94, 53, 0.08);
  --shadow-md: 0 8px 24px rgba(14, 94, 53, 0.15);
  --radius-md: 12px;
}

/* ======================================
   RESET & BASE
====================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.3s;
}

ul { list-style: none; }

main {
  flex: 1;
}

/* ======================================
   LAYOUT STABILITY (CLS FIX CORE)
====================================== */

/* Header & Footer */
#header-container {
  min-height: 80px;
}

#footer-container {
  min-height: 200px;
}

/* Container (define ONCE) */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* Sections normal (no forced height) */
.section,
.global-directory,
.internal-links-section {
  min-height: 1px;
}

/* Hero / Page Header (LCP element) */
.hero-container,
.page-header {
  min-height: 260px;
}

@media (max-width: 768px) {
  .hero-container,
  .page-header {
    min-height: 320px;
  }
}

/* City Grid */
.city-grid {
  min-height: 420px;
}

@media (max-width: 768px) {
  .city-grid {
    min-height: 560px;
  }
}

/* Calendar Grid */
.calendar-wrapper,
#calendarGrid {
  min-height: 520px;
  width: 100%;
}

@media (max-width: 768px) {
  .calendar-wrapper,
  #calendarGrid {
    min-height: 680px;
  }
}

/* Tables async */
.table-wrapper {
  min-height: 520px;
}

/* Buttons height */
.cal-btn,
.gps-btn,
.load-more-btn,
.link-btn,
select {
  min-height: 42px;
}

/* Images */
img {
  width: 100%;
  height: auto;
  display: block;
}

/* Icons placeholder */
svg, i, [data-lucide] {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-block;
}

/* Fonts */
@font-face {
  font-family: 'Poppins';
  font-display: swap;
}

@font-face {
  font-family: 'Amiri';
  font-display: swap;
}

/* ======================================
   TYPOGRAPHY
====================================== */
h1, h2, h3 {
  color: var(--primary-green);
  font-weight: 700;
  line-height: 1.25;
}

h1 {
  font-size: 2.4rem;
  text-align: center;
  margin-bottom: 20px;
}

h2 {
  font-size: 2rem;
  margin-bottom: 15px;
}

/* ======================================
   TABLE STYLES
====================================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  background: var(--white);
  margin-top: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  min-width: 600px;
}

thead {
  background: var(--primary-green);
  color: var(--white);
}

th {
  padding: 14px;
  text-transform: uppercase;
  font-size: 14px;
}

td {
  padding: 12px;
  border-bottom: 1px solid #eee;
  color: #555;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

tr:hover {
  background-color: #e9f5ec;
}

/* Mobile scroll helper */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .prayer-table {
    min-width: 600px;
  }

  .prayer-table th,
  .prayer-table td {
    padding: 10px 6px;
    font-size: 14px;
    white-space: nowrap;
  }
}

/* ======================================
   BUTTONS & CARDS
====================================== */
.gps-btn,
.load-more-btn,
.cal-btn,
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-green);
  color: #fff !important;
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: 0.25s;
}

.gps-btn:hover,
.load-more-btn:hover,
.cal-btn:hover,
.link-btn:hover {
  background: var(--secondary-green);
  transform: translateY(-2px);
}

.card-body {
  padding: 20px;
  text-align: left;
}

/* ======================================
   POPUPS / DUA
====================================== */
.popup-overlay,
.dua-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup-content,
.dua-box {
  background: #fff;
  max-width: 420px;
  padding: 25px;
  border-radius: 16px;
  text-align: center;
}

.dua-box {
  font-family: 'Amiri', serif;
}

.dua-box h3 {
  color: #0E5E35;
  margin-bottom: 15px;
}

.dua-box .arabic {
  font-size: 22px;
  direction: rtl;
  margin-bottom: 10px;
}

.dua-box .trans {
  font-size: 14px;
  color: #555;
  margin-bottom: 15px;
}

.dua-box button {
  background: #0E5E35;
  color: #fff;
  border: none;
  padding: 8px 22px;
  border-radius: 20px;
  cursor: pointer;
}

.dua-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 26px;
  cursor: pointer;
}

/* ======================================
   UTILITIES
====================================== */
.bg-white {
  background: #fff;
}

.text-center {
  text-align: center;
}

.shadow {
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
