/* ===== 1. VARIABLES (Colors) ===== */
: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;
}

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

html, body {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

main { flex: 1; }

/* ===== 3. UTILITY CLASSES ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section { padding: 60px 0; }
.bg-white { background: var(--white); border-top: 1px solid #eee; border-bottom: 1px solid #eee; }

h1, h2, h3 { color: var(--primary-green); font-weight: 700; }
h1 { font-size: 2.5rem; text-align: center; margin-bottom: 20px; }
h2 { font-size: 2rem; margin-bottom: 15px; }

/* ===== 4. TABLE STYLES (Prayer & Calendar) ===== */
.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-color: var(--primary-green); color: var(--white); }

th {
    padding: 15px;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
}

td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    color: #555;
    font-weight: 500;
}

tr:nth-child(even) { background-color: #f9f9f9; }
tr:hover { background-color: #e9f5ec; }

/* ===== 5. BUTTONS & CARDS ===== */
.gps-btn, .load-more-btn, .cal-btn, .link-btn {
    display: inline-block;
    background: var(--primary-green);
    color: var(--white) !important;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: center;
}

.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; }
.icon-box {
    height: 100px;
    background: var(--light-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--primary-green);
}
/* MOBILE DROPDOWN FIX */

.popup-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.6);
  display:none;
  justify-content:center;
  align-items:center;
  z-index:9999;
}
.popup-content{
  background:#fff;
  padding:20px;
  max-width:400px;
}
.dua-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.6);
  display:none;
  justify-content:center;
  align-items:center;
  z-index:10000;
}

.dua-box{
  background:#fff;
  max-width:420px;
  padding:25px;
  border-radius:16px;
  text-align:center;
  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;
}


"/* 1. Header ki jagah pehle se rok lein */
#header-container {
    min-height: 70px; 
    display: block; /* Zaroori hai taake height apply ho */
}

/* 2. Table load hone se pehle jagah banayein (CLS ka main mujrim) */
/* Aapke 8 sheher hain, andazan 550px height banegi */
.table-wrapper {
    min-height: 550px; 
    display: block;
    background-color: #ffffff; /* Safed background taake glitch na lage */
}

/* 3. Mobile Footer Jump Rokne ke liye */
#footer-container {
    min-height: 100px;
    display: block;
}

/* 4. Global Directory (Mobile Only Fix) */
@media (max-width: 768px) {
    .global-directory {
        /* Mobile par yeh section lamba hota hai, isliye height fix karein */
        min-height: 1200px; 
    }
}"
/* =========================================
   CLS FIXES (LAYOUT STABILITY)
   Is code ko apni CSS me sab se neechay paste karein
   ========================================= */

/* 1. Main Container Stability */
main {
    min-height: 100vh; /* Footer ko foran upar aanay se rokta hai */
    contain: layout;   /* Browser ko batata hai k iska layout change bahar asar na kare */
}

/* 2. Controls Section Fix */
/* Buttons load hone se pehle jagah reserve karein */
.cal-controls {
    min-height: 78px; 
    box-sizing: border-box;
    display: flex; /* Layout ko stable rakhta hai */
}

/* 3. Calendar Grid Wrapper Fix (MOST IMPORTANT) */
/* Calendar load hone se pehle poori height reserve karein taake neeche wala content jump na kare */
.calendar-wrapper {
    min-height: 550px; /* Average height of 6 rows */
    display: block;
    width: 100%;
    contain: paint; /* Performance boost */
}

/* 4. Today Date Highlight Box */
/* "Loading..." text aur actual date ka size alag hota hai, isliye height fix karein */
.today-highlight {
    min-height: 90px;
    min-width: 250px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 5. Mobile Adjustments */
@media (max-width: 768px) {
    .calendar-wrapper {
        min-height: 480px; /* Mobile par calendar thora chota hota hai */
    }
    
    .cal-controls {
        min-height: 140px; /* Mobile par buttons stack hotay hain, height ziyada chahiye */
    }
}

/* =========================================
   MOBILE SPEED BOOSTER (Pre-Paint Critical Styles)
   Yeh code Tailwind Script load hone se pehle hi
   colors aur layout dikha dega.
   ========================================= */

/* 1. Critical Colors (Jo Tailwind Config mein defined hain) */
:root {
    --islamic-green-fix: #1B4D3E;
    --islamic-gold-fix: #D4AF37;
    --islamic-dark-fix: #0F2819;
    --islamic-light-fix: #F4F7F6;
}

/* 2. Hero Section Pre-Paint (Sabse Zaroori for LCP) */
/* Yeh classes browser ko foran background dikhane par majboor karengi */
.bg-islamic-green {
    background-color: var(--islamic-green-fix) !important;
    color: #ffffff !important;
}

.text-islamic-gold {
    color: var(--islamic-gold-fix) !important;
}

.text-islamic-dark {
    color: var(--islamic-dark-fix) !important;
}

/* 3. Typography & Spacing Fixes (Mobile Layout Shift roknay k liye) */
.text-center { text-align: center !important; }
.font-bold { font-weight: 700 !important; }
.italic { font-style: italic !important; }

/* Hero Padding Fix */
.py-16 { 
    padding-top: 4rem !important; 
    padding-bottom: 4rem !important; 
}
.px-4 { 
    padding-left: 1rem !important; 
    padding-right: 1rem !important; 
}

/* 4. Heading Sizes (Mobile Optimized) */
/* Mobile par text ka size pehle se set karein taake font jump na kare */
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }

@media (min-width: 768px) {
    .md\:text-5xl { font-size: 3rem; line-height: 1; }
    .md\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
}

/* 5. Icon Placeholder (Lucide Fix) */
/* Jab tak JS load ho, icons 0 size k na hon */
[data-lucide], i, svg {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    vertical-align: middle;
}

/* 6. Font Display Swap */
/* Text gayab na ho jab tak font load ho raha hai */
@font-face {
    font-family: 'Poppins';
    font-display: swap;
}
@font-face {
    font-family: 'Amiri';
    font-display: swap;
}

/* 7. Grid & Flex Helpers (Layout Stability) */
.container { width: 100%; margin-left: auto; margin-right: auto; }
.grid { display: grid; }
.gap-6 { gap: 1.5rem; }
.bg-white { background-color: #ffffff !important; }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1); }

/* 1. Scroll Container Class: Ye naya class banayein */ .table-scroll { overflow-x: auto; /* Agar content zyada ho to scroll kare */ -webkit-overflow-scrolling: touch; /* Mobile par smooth scroll ke liye */ background: #fff; border: 1px solid #eee; border-radius: 0 0 6px 6px; /* Niche se gol kinare */ width: 100%; } /* 2. Mobile Specific Rule: Ye @media query mein add karein */ @media (max-width: 768px) { .prayer-table { min-width: 600px; /* IMPORTANT: Table ko 600px se kam nahi hone dega, isliye scroll ayega */ } /* Text size thoda chota karein taake fit ho */ .prayer-table th, .prayer-table td { padding: 10px 5px; font-size: 14px; white-space: nowrap; /* Text ko tootne (wrap hone) se rokta hai */ } }

/* 1. Scroll Container Class: Ye naya class banayein */
.table-scroll {
    overflow-x: auto;               /* Agar content zyada ho to scroll kare */
    -webkit-overflow-scrolling: touch; /* Mobile par smooth scroll ke liye */
    background: #fff;
    border: 1px solid #eee;
    border-radius: 0 0 6px 6px;     /* Niche se gol kinare */
    width: 100%;
}

/* 2. Mobile Specific Rule: Ye @media query mein add karein */
@media (max-width: 768px) {
    .prayer-table {
        min-width: 600px; /* IMPORTANT: Table ko 600px se kam nahi hone dega, isliye scroll ayega */
    }
    
    /* Text size thoda chota karein taake fit ho */
    .prayer-table th, 
    .prayer-table td { 
        padding: 10px 5px; 
        font-size: 14px; 
        white-space: nowrap; /* Text ko tootne (wrap hone) se rokta hai */
    }
}
/* ================================
   CLS FIX – GLOBAL STABILITY CSS
   ================================ */

/* 1. Box sizing stable */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Container – stable width */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 16px;
  min-height: 1px;
  overflow-anchor: none;
}

/* 3. Sections reserve space */
.section {
  min-height: 1px;
}

/* 4. Images – no layout jump */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Aspect ratio wrapper for images */
.img-wrapper {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
}

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

/* 5. Video / iframe / maps */
iframe,
video {
  width: 100%;
  min-height: 240px;
  border: 0;
}

/* 6. Ads placeholder */
.ad-slot {
  width: 100%;
  min-height: 250px;
  background: #f3f4f6;
}

/* 7. Dynamic content placeholder */
.dynamic-content {
  min-height: 300px;
}

/* 8. Hero section fix */
.hero-container {
  min-height: 60vh;
}

/* 9. Fonts fallback to prevent shift */
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* 10. Prevent margin collapse issues */
h1, h2, h3, p {
  margin-top: 0;
}

/* 11. Mobile padding fix */
@media (max-width: 480px) {
  .container {
    padding-inline: 12px;
  }
}
