/* ====================================================================
   MAIN CSS & GLOBAL LAYOUT
   Markaz Darul Quran Ash Shofwah
   ==================================================================== */

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

html {
  font-family: var(--font-body);
  color: var(--color-text-main);
  background-color: var(--color-bg-base);
  scroll-behavior: smooth;
  font-size: 16px;
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ====================================================================
   TOPBAR & HEADER NAVIGATION (FR-GLB-01, FR-GLB-02, FR-GLB-03)
   ==================================================================== */

.topbar {
  background-color: var(--color-primary-950);
  color: #a7f3d0;
  font-size: 0.825rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.topbar-item svg {
  width: 14px;
  height: 14px;
  color: var(--color-gold-400);
}

/* Sticky Main Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

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

/* Logo Brand */
.site-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-emblem {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-primary-800), var(--color-primary-950));
  border: 2px solid var(--color-gold-400);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold-400);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.brand-emblem svg {
  width: 26px;
  height: 26px;
}

.brand-emblem.has-custom-logo {
  background: #ffffff;
  padding: 3px;
  overflow: hidden;
  border: 2px solid var(--color-gold-400);
}

.brand-emblem.has-custom-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: calc(var(--radius-md) - 2px);
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary-900);
  line-height: 1.2;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--color-text-subtle);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Nav Menu */
.nav-menu {
  display: none;
  align-items: center;
  gap: 1.25rem;
}

@media (min-width: 1024px) {
  .nav-menu {
    display: flex;
  }
}

.nav-link {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--color-text-main);
  padding: 0.5rem 0.25rem;
  position: relative;
}

.nav-link:hover {
  color: var(--color-primary-700);
}

.nav-link.active {
  color: var(--color-primary-800);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary-700);
  border-radius: var(--radius-full);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-search-trigger {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-search-trigger:hover {
  border-color: var(--color-primary-600);
  color: var(--color-primary-700);
  background: var(--color-primary-50);
}

.btn-search-trigger svg {
  width: 18px;
  height: 18px;
}

/* Primary Header CTA - Golden Taawun Button */
.btn-taawun-header {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--color-gold-500), var(--color-gold-600));
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.25);
  border: 1px solid var(--color-gold-400);
  transition: all var(--transition-fast);
}

.btn-taawun-header:hover {
  background: linear-gradient(135deg, var(--color-gold-600), var(--color-gold-700));
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(217, 119, 6, 0.35);
}

.btn-taawun-header svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Mobile Hamburger Toggle */
.mobile-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
}

@media (min-width: 1024px) {
  .mobile-nav-toggle {
    display: none;
  }
}

.mobile-nav-toggle svg {
  width: 22px;
  height: 22px;
  color: var(--color-text-main);
}

/* Mobile Drawer (FR-GLB-02) */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 340px;
  height: 100vh;
  background: #ffffff;
  z-index: 100;
  box-shadow: var(--shadow-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.mobile-drawer.open {
  right: 0;
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.25rem;
}

.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-drawer-nav a {
  padding: 0.75rem 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.mobile-drawer-nav a:hover,
.mobile-drawer-nav a.active {
  background: var(--color-primary-50);
  color: var(--color-primary-800);
}

/* ====================================================================
   FOOTER COMPONENT (FR-GLB-04)
   ==================================================================== */

.site-footer {
  background-color: var(--color-primary-950);
  color: #d1fae5;
  margin-top: auto;
  border-top: 4px solid var(--color-gold-500);
}

.footer-top {
  padding: 4rem 0 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
  }
}

.footer-col h4 {
  font-family: var(--font-heading);
  color: #ffffff;
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background-color: var(--color-gold-400);
}

.footer-about p {
  color: #a7f3d0;
  font-size: 0.875rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: #d1fae5;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-links a:hover {
  color: var(--color-gold-400);
  transform: translateX(3px);
}

.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.875rem;
  color: #d1fae5;
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.footer-contact-item svg {
  width: 18px;
  height: 18px;
  color: var(--color-gold-400);
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-bottom {
  background-color: #011d17;
  padding: 1.25rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.825rem;
  color: #6ee7b7;
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Floating WhatsApp Button (FR-GLB-06) */
.floating-whatsapp {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 40;
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  background-color: #25d366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.floating-whatsapp:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
}

.floating-whatsapp svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

/* Search Modal Overlay (FR-GLB-05) */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5rem;
}

.search-modal.active {
  display: flex;
}

.search-modal-box {
  background: #ffffff;
  width: 90%;
  max-width: 600px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.search-input-wrapper input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.1rem;
}
