/* Theme variables */
:root {
  --green-deep: #0b5d39; /* Islamic green */
  --green: #0f7b4a; /* Secondary green */
  --blue-deep: #153e75; /* Islamic blue */
  --blue: #1e5bb8; /* Secondary blue */
  --gold: #c7a007; /* Islamic gold */
  --white: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --islamic-green: #0b5d39;
  --islamic-blue: #153e75;
  --islamic-gold: #c7a007;
  --islamic-ivory: #f8f5f0;
  --islamic-cream: #f9f6f0;
  --islamic-maroon: #800000;
  --islamic-teal: #008080;
  --islamic-amber: #d2b48c;
  --islamic-rose: #b76e79;
  --islamic-sage: #7a9b76;
  --islamic-sky: #87ceeb;
  --islamic-sand: #c2b280;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

/* Lux Islamic gradient + soft pattern */
body {
  margin: 0;
  font-family: 'Poppins', 'Lato', system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(21, 62, 117, 0.3), transparent 60%),
    radial-gradient(1000px 500px at 120% 120%, rgba(11, 93, 57, 0.3), transparent 60%),
    linear-gradient(135deg, var(--islamic-green), var(--islamic-blue));
  background-attachment: fixed;
  position: relative;
}

/* Subtle geometric Islamic pattern overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 10px 10px, rgba(255,255,255,0.06) 2px, transparent 2.5px),
    radial-gradient(circle at 30px 30px, rgba(255,255,255,0.05) 1.5px, transparent 2.5px);
  background-size: 40px 40px, 40px 40px;
  mix-blend-mode: overlay;
}

/* Islamic geometric pattern */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 36h24v24H36v-24zM0 36h24v24H0v-24zM36 12h24v24H36V12zM0 12h24v24H0V12zM12 0h24v24H12V0zM12 48h24v24H12v-24z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

/* Islamic corner decorations */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  border: 2px solid rgba(199, 160, 7, 0.35);
  border-radius: 16px;
}
.card::before { top: 14px; left: 14px; border-right: none; border-bottom: none; }
.card::after { bottom: 14px; right: 14px; border-left: none; border-top: none; }

/* Additional Islamic corner decorations with geometric patterns */
.card::before {
  background-image: 
    radial-gradient(circle at 10px 10px, rgba(199, 160, 7, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 20px 20px, rgba(199, 160, 7, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.card::after {
  background-image: 
    radial-gradient(circle at 10px 10px, rgba(199, 160, 7, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 20px 20px, rgba(199, 160, 7, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Islamic decorative borders */
.card {
  position: relative;
  overflow: hidden;
}

.card::before,
.card::after {
  z-index: 1;
}

/* Additional Islamic pattern inside card */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: repeating-linear-gradient(
    45deg,
    rgba(199, 160, 7, 0.1),
    rgba(199, 160, 7, 0.1) 5px,
    transparent 5px,
    transparent 10px
  );
}

.card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(199, 160, 7, 0.1),
    rgba(199, 160, 7, 0.1) 5px,
    transparent 5px,
    transparent 10px
  );
}

/* Islamic calligraphy elements */
.card::before {
  content: "﷽";
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 24px;
  color: rgba(199, 160, 7, 0.3);
  font-family: 'Scheherazade New', 'Amiri', 'Traditional Arabic', serif;
  z-index: 2;
}

.card::after {
  content: "﷽";
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-size: 24px;
  color: rgba(199, 160, 7, 0.3);
  font-family: 'Scheherazade New', 'Amiri', 'Traditional Arabic', serif;
  z-index: 2;
}

.page {
  min-height: calc(var(--vh, 1vh) * 100);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.page.page-top { align-items: start; }

.card {
  width: 100%;
  max-width: 960px;
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 245, 240, 0.95) 100%),
    rgba(255, 255, 255, 0.97);
  backdrop-filter: saturate(1.2) blur(2px);
  border-radius: 22px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.20);
  overflow: hidden;
  animation: fadeIn 700ms ease-out both;
  position: relative;
}

/* Decorative corners */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  border: 2px solid rgba(199, 160, 7, 0.35);
  border-radius: 16px;
}
.card::before { top: 14px; left: 14px; border-right: none; border-bottom: none; }
.card::after { bottom: 14px; right: 14px; border-left: none; border-top: none; }

.header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 26px 30px;
  background: 
    linear-gradient(135deg, rgba(11, 93, 57, 0.15) 0%, rgba(30, 91, 184, 0.15) 100%);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff; /* strong contrast for circular logo */
  border: 2px solid rgba(199, 160, 7, 0.45); /* gold ring */
  color: var(--white);
  box-shadow: 0 8px 18px rgba(11, 93, 57, 0.20);
  flex-shrink: 0;
  position: relative;
}
.logo::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(199, 160, 7, 0.6);
}
.brand-logo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: transparent; }
.brand-fallback { display: none; }
.brand-logo[style*="display: none"] + .brand-fallback { display: block; }

/* Brand block for horizontal banner logo */
.brand-block { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.brand-banner { max-width: 260px; height: auto; display: block; object-fit: contain; }

.title {
  font-weight: 700;
  font-size: 1.35rem;
  color: #0f1a2a;
  letter-spacing: 0.3px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--islamic-green) 0%, var(--islamic-blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.95rem;
}

.content { padding: 26px 30px 34px; }
.content.centered { text-align: center; }

.greeting {
  margin: 8px 0 18px;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--islamic-green);
  letter-spacing: 0.2px;
  text-shadow: 0 2px 4px rgba(11, 93, 57, 0.1);
}
.highlight {
  background: linear-gradient(135deg, var(--islamic-green) 0%, var(--islamic-blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
}

/* Countdown styles */
.countdown { margin-top: 10px; }
.countdown-title {
  font-weight: 700;
  color: var(--islamic-blue);
  margin-bottom: 10px;
}
.countdown-simple {
  font-family: 'Poppins', monospace;
  font-weight: 800;
  font-size: 2rem;
  color: var(--islamic-green);
  text-align: center;
  background: 
    linear-gradient(135deg, rgba(241, 245, 249, 0.8) 0%, rgba(255, 255, 255, 0.8) 100%);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  margin-bottom: 10px;
}
@media (max-width: 480px) {
  .countdown-simple { font-size: 1.5rem; padding: 12px; }
}

/* Fancy countdown (detail page) */
.countdown-fancy {
  margin: 8px 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  background:
    radial-gradient(500px 200px at -10% -20%, rgba(30,91,184,0.10), transparent 60%),
    radial-gradient(500px 200px at 120% 120%, rgba(11,93,57,0.10), transparent 60%),
    #f8fafc;
}
.countdown-fancy .title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.countdown-fancy .label-title {
  font-weight: 800;
  color: var(--islamic-blue);
}
.countdown-fancy .hint { color: var(--muted); font-size: 0.9rem; }

.countdown-rings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 640px) {
  .countdown-rings { grid-template-columns: repeat(2, 1fr); }
}

.ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.08));
}
.ring .pie {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color, #0b5d39) 0deg, rgba(0,0,0,0.08) 0deg);
  transition: background 220ms ease;
}
.ring .pie::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #fff;
}
.ring-inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}
.ring .num { font-weight: 800; font-size: 1.4rem; color: var(--islamic-green); }
.ring .unit { font-weight: 700; font-size: 0.85rem; color: var(--muted); }

/* Ring color accents */
.ring.days { --ring-color: var(--islamic-green); }
.ring.hours { --ring-color: var(--islamic-blue); }
.ring.minutes { --ring-color: #0f7b4a; }
.ring.seconds { --ring-color: var(--islamic-gold); }

.description {
  margin-bottom: 18px;
  color: #0f172a;
  line-height: 1.7;
}

.hero { position: relative; }
.badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; justify-content: center; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: 
    linear-gradient(135deg, rgba(238, 242, 247, 0.9) 0%, rgba(255, 255, 255, 0.9) 100%);
  color: #0f172a;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  box-shadow: 0 6px 12px rgba(0,0,0,0.06);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 14px;
}
@media (min-width: 640px) {
  .info-grid { grid-template-columns: repeat(3, 1fr); }
}

.info {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 14px 16px;
  background: 
    linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(255, 255, 255, 0.8) 100%);
  position: relative;
}
.info::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 12px;
  width: 36px;
  height: 4px;
  background: linear-gradient(90deg, rgba(199,160,7,0), rgba(199,160,7,0.75), rgba(199,160,7,0));
  border-radius: 999px;
}
.label { font-weight: 700; color: var(--islamic-blue); font-size: 0.95rem; }
.value { margin-top: 6px; color: #0f172a; }

.divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,0.12), rgba(0,0,0,0));
  margin: 18px 0;
}

.agenda {
  margin-top: 18px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 16px 16px 18px;
  background: 
    linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(255, 255, 255, 0.8) 100%);
  text-align: left;
}
.agenda h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--islamic-blue);
  text-align: left;
}
.timeline { position: relative; margin-top: 8px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(199,160,7,0.1), rgba(199,160,7,0.7), rgba(199,160,7,0.1));
}
.timeline-item {
  position: relative;
  padding-left: 36px;
  margin: 10px 0;
}
.timeline-icon {
  position: absolute;
  left: 2px;
  top: 4px;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 2px solid rgba(199,160,7,0.6);
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.timeline-content { color: #0f172a; }

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.actions.center { justify-content: center; }

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.03); }
.btn:active { transform: translateY(0); filter: brightness(1.0); }

.btn-primary {
  background: 
    linear-gradient(135deg, var(--islamic-green) 0%, var(--islamic-blue) 100%);
  color: var(--white);
  box-shadow: 0 10px 22px rgba(21, 62, 117, 0.35);
}
.btn-secondary {
  background: 
    linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
  color: #0f172a;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed rgba(0,0,0,0.12);
  color: var(--muted);
  font-size: 0.93rem;
  text-align: center;
}

/* Mobile Responsiveness Enhancements */
@media (max-width: 768px) {
  .page {
    padding: 20px 12px;
  }
  
  .card {
    margin: 10px auto;
    border-radius: 18px;
  }
  
  .card::before,
  .card::after {
    width: 80px;
    height: 80px;
  }
  
  .header {
    padding: 20px 20px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
  
  .logo { width: 56px; height: 56px; }
  
  .brand-logo { width: 48px; height: 48px; }
  .brand-banner { max-width: 200px; }
  
  .greeting {
    font-size: 1.6rem;
    margin: 8px 0 14px;
  }
  
  .content {
    padding: 20px 20px 28px;
  }
  
  .countdown-grid {
    gap: 8px;
  }
  
  .time-box {
    padding: 10px;
  }
  
  .time-num {
    font-size: 1.4rem;
  }
  
  .time-label {
    font-size: 0.75rem;
  }
  
  .countdown-fancy {
    padding: 12px 12px;
  }
  
  .countdown-rings {
    gap: 8px;
  }
  
  .ring {
    width: 90px;
    height: 90px;
  }
  
  .ring .num { font-size: 1.1rem; }
  .ring .unit { font-size: 0.75rem; }
  
  .info-grid {
    gap: 12px;
  }
  
  .info {
    padding: 12px 14px;
  }
  
  .agenda {
    padding: 14px 14px 16px;
  }
  
  .timeline-item {
    margin: 8px 0;
  }
  
  .actions {
    margin-top: 18px;
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
    padding: 14px;
  }
  
  .footer {
    margin-top: 20px;
    font-size: 0.85rem;
  }
  
  .bismillah {
    font-size: 1.5rem !important;
  }
  
  .description {
    text-align: center;
    margin: 15px 0;
    line-height: 1.6;
    color: var(--text);
  }
}

@media (max-width: 480px) {
  .page {
    padding: 16px 10px;
  }
  
  .card {
    border-radius: 16px;
  }
  
  .card::before,
  .card::after {
    width: 60px;
    height: 60px;
  }
  
  .header {
    padding: 16px 16px;
  }
  
  .logo { width: 48px; height: 48px; }
  
  .brand-logo { width: 40px; height: 40px; }
  .brand-banner { max-width: 180px; }
  
  .title {
    font-size: 1.15rem;
  }
  
  .subtitle {
    font-size: 0.85rem;
  }
  
  .greeting {
    font-size: 1.4rem;
  }
  
  .content {
    padding: 16px 16px 24px;
  }
  
  .countdown-title {
    font-size: 0.95rem;
  }
  
  .time-num {
    font-size: 1.2rem;
  }
  
  .countdown-fancy .label-title {
    font-size: 0.95rem;
  }
  
  .info-grid {
    gap: 10px;
  }
  
  .label {
    font-size: 0.85rem;
  }
  
  .value {
    font-size: 0.85rem;
  }
  
  .agenda h3 {
    font-size: 0.95rem;
  }
  
  .timeline-content {
    font-size: 0.85rem;
  }
  
  .footer {
    font-size: 0.8rem;
  }
}

@media (max-width: 360px) {
  .greeting {
    font-size: 1.3rem;
  }
  
  .time-num {
    font-size: 1.1rem;
  }
  
  .ring {
    width: 75px;
    height: 75px;
  }
  
  .ring .num { font-size: 1rem; }
  .ring .unit { font-size: 0.7rem; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll reveal */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal { opacity: 0; transform: translateY(12px); will-change: opacity, transform; }
.reveal.in { animation: fadeUp 600ms ease-out both; }

/* Utilities */
.center-img { display: block; margin: 12px auto; max-width: 100%; height: auto; }
.center { text-align: center; }
.header-centered { justify-content: center; text-align: center; flex-direction: column; }
.header-centered .title, .header-centered .subtitle { text-align: center; }
.header-centered .logo { margin-bottom: 8px; }

/* Greeting responsiveness */
.greeting { line-height: 1.25; overflow-wrap: anywhere; word-break: break-word; }
.greeting .highlight { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }

/* Typewriter: default to static for better wrapping */
.typewriter {
  display: inline-block;
  overflow: visible;
  white-space: normal;
  border-right: 0;
  animation: none;
}
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}
@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--islamic-green); }
}

/* Responsive fallback: allow wrapping and use fade-in on small screens */
@media (max-width: 768px) { .greeting { font-size: 1.5rem; } }
@media (max-width: 480px) { .greeting { font-size: 1.25rem; } }
@media (max-width: 360px) { .greeting { font-size: 1.15rem; } }

/* Re-enable typewriter only on large screens */
@media (min-width: 992px) {
  .typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--islamic-green);
    animation: typing 2400ms steps(40, end), blink-caret 800ms step-end infinite;
  }
}
@media (max-width: 768px) {
  .greeting { font-size: 1.6rem; }
}
