/* ============================================================
   naqra.id — Global Stylesheet
   Refined Islamic Modern Design System
   ============================================================ */

/* ── GOOGLE FONTS (loaded via HTML <link>) ── */

:root {
  /* Colors */
  --green-deep:   #064E3B;
  --green-mid:    #065F46;
  --green-main:   #059669;
  --green-light:  #D1FAE5;
  --green-pale:   #ECFDF5;
  --gold:         #B7950B;
  --gold-light:   #F9E79F;
  --gold-bright:  #F4D03F;
  --cream:        #FDFAF4;
  --cream-dark:   #F5EDD8;
  --text-dark:    #1A1A1A;
  --text-mid:     #374151;
  --text-muted:   #6B7280;
  --white:        #FFFFFF;
  --border:       #E5E7EB;
  --border-dark:  #D1D5DB;
  --red:          #EF4444;
  --red-pale:     #FEF2F2;
  --shadow:       0 4px 24px rgba(6,78,59,0.10);
  --shadow-lg:    0 12px 48px rgba(6,78,59,0.18);
  --radius:       16px;
  --radius-sm:    10px;
  --radius-xs:    8px;

  /* Fonts */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;
  --font-arab:    'Amiri', serif;

  /* Transitions */
  --transition:   all 0.22s ease;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text-dark);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
button { font-family: var(--font-body); cursor: pointer; }
a { text-decoration: none; }
input, textarea, select { font-family: var(--font-body); }

/* ── GEO BACKGROUND ── */
.geo-bg {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath fill='none' stroke='%23064E3B' stroke-width='1' d='M40 0 L80 40 L40 80 L0 40 Z M40 10 L70 40 L40 70 L10 40 Z M40 20 L60 40 L40 60 L20 40 Z'/%3E%3C/svg%3E");
  background-size: 80px 80px;
}

/* ── NAVBAR ── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(253,250,244,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(6,78,59,0.10);
  height: 64px;
  display: flex; align-items: center;
  padding: 0 24px;
  transition: box-shadow 0.3s;
}
.navbar.scrolled { box-shadow: 0 2px 20px rgba(6,78,59,0.12); }

.nav-inner {
  width: 100%; max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark {
  width: 36px; height: 36px;
  background: var(--green-deep);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.logo-mark::after {
  content: 'ن';
  font-family: var(--font-arab);
  font-size: 20px;
  color: var(--gold-bright);
}
.logo-text {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  color: var(--green-deep);
  letter-spacing: -0.3px;
}
.logo-text span { color: var(--green-main); }

/* Nav links */
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a {
  font-size: 14px; font-weight: 500;
  color: var(--text-mid);
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  background: var(--green-pale);
  color: var(--green-deep);
}

/* Nav CTA */
.nav-cta { display: flex; gap: 8px; align-items: center; }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 4px; cursor: pointer;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--green-deep); border-radius: 2px;
  transition: var(--transition);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-xs);
  border: none; cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--green-deep);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--green-mid);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(6,78,59,0.28);
}
.btn-ghost {
  background: transparent;
  color: var(--green-deep);
  border: 1.5px solid var(--green-main);
}
.btn-ghost:hover { background: var(--green-pale); }

.btn-lg { font-size: 15px; padding: 13px 28px; border-radius: var(--radius-sm); }
.btn-sm { font-size: 13px; padding: 7px 14px; border-radius: 7px; }

.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #dc2626; }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 7px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 14px; color: var(--text-dark);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--green-main);
  box-shadow: 0 0 0 3px rgba(5,150,105,0.12);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 100px; resize: vertical; line-height: 1.6; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 5px; display: none; }

/* ── SECTION HELPERS ── */
.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--green-main); margin-bottom: 12px;
}
.section-label::before {
  content: ''; width: 20px; height: 2px;
  background: var(--green-main); border-radius: 1px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.5vw, 38px);
  font-weight: 700; color: var(--green-deep);
  line-height: 1.2; margin-bottom: 14px;
}
.section-desc { font-size: 15px; color: var(--text-muted); line-height: 1.7; }

/* ── CARD ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ── BADGE ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 100px;
}
.badge-green { background: var(--green-light); color: var(--green-mid); }
.badge-gold  { background: var(--gold-light);  color: var(--gold); }
.badge-gray  { background: var(--border); color: var(--text-muted); }
.badge-red   { background: var(--red-pale); color: var(--red); }

/* ── ALERT ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  display: none;
  align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.alert.show { display: flex; }
.alert-error { background: var(--red-pale); color: var(--red); border: 1px solid #fca5a5; }
.alert-success { background: var(--green-pale); color: var(--green-mid); border: 1px solid var(--green-light); }

/* ── TOPBAR (inside pages, not landing) ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(253,250,244,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(6,78,59,0.10);
  height: 64px;
  display: flex; align-items: center;
  padding: 0 24px;
  box-shadow: 0 2px 20px rgba(6,78,59,0.08);
}
.topbar-inner {
  width: 100%; max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar-nav { display: flex; gap: 4px; }
.topbar-nav a {
  font-size: 14px; font-weight: 500;
  color: var(--text-mid);
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
  text-decoration: none;
}
.topbar-nav a:hover, .topbar-nav a.active {
  background: var(--green-pale);
  color: var(--green-deep);
}
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--green-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--white);
  cursor: pointer; flex-shrink: 0;
}
.topbar-name { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* ── PAGE WRAPPER (for inner pages) ── */
.page-wrap { padding-top: 64px; min-height: 100vh; }
.page-inner { max-width: 1100px; margin: 0 auto; padding: 32px 20px; }

/* ── ARABIC TEXT HELPERS ── */
.arab {
  font-family: var(--font-arab);
  direction: rtl; text-align: right;
  line-height: 2;
}
.arab-gold { color: var(--gold); }
.arab-inline {
  font-family: var(--font-arab);
  font-size: 1.1em;
  color: var(--green-deep);
}

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── SPINNER ── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text-mid); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(6,78,59,0.4);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  color: var(--green-deep); margin-bottom: 6px;
}
.modal-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ── DROPDOWN MENU ── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 300;
  display: none;
  overflow: hidden;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  font-size: 14px; color: var(--text-mid);
  cursor: pointer; transition: background 0.15s;
  border: none; background: none; width: 100%; text-align: left;
  text-decoration: none;
}
.dropdown-item:hover { background: var(--green-pale); color: var(--green-deep); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: var(--red-pale); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── PAGINATION ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; }
.page-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 14px; font-weight: 500;
  color: var(--text-mid);
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover, .page-btn.active {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: var(--white);
}

/* ── PROGRESS BAR ── */
.progress-bar {
  height: 6px; background: var(--border);
  border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--green-main), var(--gold-bright));
  border-radius: 3px; transition: width 0.5s ease;
}

/* ── TABLE ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: var(--white); }
thead { background: var(--green-pale); }
th {
  padding: 12px 16px; text-align: left;
  font-size: 12px; font-weight: 700;
  color: var(--green-mid); letter-spacing: 0.5px; text-transform: uppercase;
}
td { padding: 13px 16px; font-size: 14px; color: var(--text-mid); border-top: 1px solid var(--border); }
tr:hover td { background: var(--cream); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-links, .nav-cta { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: fixed; top: 64px; left: 0; right: 0;
    background: var(--cream);
    padding: 12px 20px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    z-index: 199;
    gap: 2px;
  }
  .topbar-nav { display: none; }
  .topbar-name { display: none; }
  .page-inner { padding: 24px 16px; }
}

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