@font-face {
  font-family: 'Vazirmatn FD';
  src: url('../fonts/vazirmatn-fd.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

:root {
  --brand-primary: #0f6cbd;
  --brand-secondary: #23a98c;
  --brand-accent: #f59f00;
  --surface-bg: #f4f8fc;
  --surface-card: rgba(255, 255, 255, 0.92);
  --surface-border: rgba(15, 108, 189, 0.12);
  --shadow-soft: 0 18px 45px rgba(15, 76, 129, 0.12);
  --shadow-card: 0 10px 30px rgba(20, 72, 122, 0.1);
}

@media (min-width: 768px) {
  html { font-size: 16px; }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease-out both;
}
.animate-fade-in {
  animation: fadeIn 0.4s ease-out both;
}
.animate-scale-in {
  animation: scaleIn 0.4s ease-out both;
}

/* Staggered children animation */
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }

/* ===== Focus & Base ===== */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

body {
  direction: rtl;
  text-align: right;
  background:
    radial-gradient(circle at top right, rgba(35, 169, 140, 0.18), transparent 30%),
    radial-gradient(circle at top left, rgba(245, 159, 0, 0.16), transparent 28%),
    linear-gradient(180deg, #f9fcff 0%, var(--surface-bg) 52%, #edf4fb 100%);
  margin-bottom: 0;
  font-family: 'Vazirmatn FD', 'Segoe UI', Tahoma, sans-serif;
  color: #16324a;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.2;
  z-index: -1;
}

/* ===== User avatar ===== */
.user-avatar {
  width: var(--avatar-size, 40px);
  height: var(--avatar-size, 40px);
  object-fit: cover;
  border-radius: 50%;
  display: inline-block;
}
.user-avatar-sm { --avatar-size: 32px; }
.user-avatar-xs { --avatar-size: 28px; }
.user-avatar-md { --avatar-size: 40px; }
.user-avatar-lg { --avatar-size: 56px; }

/* ===== Navbar ===== */
.navbar {
  background: linear-gradient(135deg, #1a3a5c 0%, #2c5f8a 45%, #3a7ca5 100%) !important;
  box-shadow: 0 10px 30px rgba(26, 58, 92, 0.24) !important;
  animation: fadeIn 0.4s ease-out;
}
.navbar-brand {
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}
.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  /* mosque-logo.png is monochrome black; invert it for the dark navbar. */
  filter: brightness(0) invert(1);
}
.navbar .nav-link {
  opacity: 0.95;
  border-radius: 999px;
  padding-inline: 0.85rem;
  font-size: 0.92rem;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}
.navbar .nav-link:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}
.navbar .nav-link i {
  font-size: 1rem;
  opacity: 0.85;
}

/* ===== Cards ===== */
.card {
  border-radius: 0.9rem;
  border: 1px solid rgba(15, 108, 189, 0.18);
  background: var(--surface-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(20, 72, 122, 0.14);
}

/* ===== Form Border Accent ===== */
.card-form-border {
  border: 2px solid rgba(15, 108, 189, 0.25) !important;
  box-shadow: 0 0 0 1px rgba(15, 108, 189, 0.08), var(--shadow-card) !important;
}
.card-form-border-green {
  border: 2px solid rgba(35, 169, 140, 0.3) !important;
  box-shadow: 0 0 0 1px rgba(35, 169, 140, 0.08), var(--shadow-card) !important;
}
.card-header {
  border-bottom: 1px solid rgba(15, 108, 189, 0.08);
  background: linear-gradient(135deg, rgba(15, 108, 189, 0.08), rgba(35, 169, 140, 0.12));
  font-weight: 700;
}

/* ===== Icon Card (for panels) ===== */
.icon-card {
  position: relative;
  padding: 1.5rem;
  border-radius: 1rem;
  transition: all 0.3s ease;
  overflow: hidden;
}
.icon-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 0 1rem 0 2rem;
  opacity: 0.12;
  transition: opacity 0.3s ease;
}
.icon-card:hover::before {
  opacity: 0.22;
}
.icon-card .icon-wrapper {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 0.85rem;
  transition: transform 0.3s ease;
}
.icon-card:hover .icon-wrapper {
  transform: scale(1.1) rotate(-3deg);
}

.icon-card-blue .icon-wrapper { background: rgba(15,108,189,0.12); color: #0f6cbd; }
.icon-card-blue::before { background: #0f6cbd; }
.icon-card-green .icon-wrapper { background: rgba(35,169,140,0.12); color: #23a98c; }
.icon-card-green::before { background: #23a98c; }
.icon-card-yellow .icon-wrapper { background: rgba(245,159,0,0.12); color: #f59f00; }
.icon-card-yellow::before { background: #f59f00; }
.icon-card-red .icon-wrapper { background: rgba(220,53,69,0.12); color: #dc3545; }
.icon-card-red::before { background: #dc3545; }
.icon-card-purple .icon-wrapper { background: rgba(111,66,193,0.12); color: #6f42c1; }
.icon-card-purple::before { background: #6f42c1; }
.icon-card-teal .icon-wrapper { background: rgba(32,201,151,0.12); color: #20c997; }
.icon-card-teal::before { background: #20c997; }

/* ===== Stat Card ===== */
.stat-card {
  position: relative;
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  overflow: hidden;
}
.stat-card .stat-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3.5rem;
  opacity: 0.07;
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}
.stat-card .stat-label {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 0.25rem;
}

/* ===== Buttons ===== */
.btn {
  border-radius: 0.85rem;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(15, 108, 189, 0.18);
}
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary), #258cfb);
  border-color: transparent;
}
.btn-outline-primary {
  border-color: rgba(15, 108, 189, 0.32);
  color: var(--brand-primary);
}
.btn-outline-primary:hover {
  background: linear-gradient(135deg, var(--brand-primary), #258cfb);
  border-color: transparent;
}
.btn-success {
  background: linear-gradient(135deg, #198754, #20c997);
  border-color: transparent;
}
.btn-warning {
  background: linear-gradient(135deg, #f59f00, #ffc078);
  border-color: transparent;
  color: #1a1a1a;
}
.btn-danger {
  background: linear-gradient(135deg, #dc3545, #ff6b6b);
  border-color: transparent;
}

/* ===== Forms ===== */
.form-control, .form-select {
  border-radius: 0.85rem;
  border-color: rgba(15, 108, 189, 0.16);
  background-color: rgba(255, 255, 255, 0.96);
  min-height: 46px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.12);
}
.form-check {
  padding: 0.75rem 1rem 0.75rem 2.2rem;
}
.form-check-input {
  width: 1.1rem;
  height: 1.1rem;
}

/* ===== Tables ===== */
.table {
  --bs-table-bg: transparent;
}
.table thead th {
  background: rgba(15, 108, 189, 0.06);
  border-bottom-width: 2px;
  font-weight: 700;
  font-size: 0.9rem;
}
.table tbody tr {
  transition: background-color 0.18s ease, transform 0.18s ease;
}
.table tbody tr:hover {
  background-color: rgba(15, 108, 189, 0.04);
}

/* ===== Badges ===== */
.badge { font-weight: 600; }
.badge.text-bg-success { background: linear-gradient(135deg, #198754, #20c997) !important; }
.badge.text-bg-danger { background: linear-gradient(135deg, #dc3545, #ff6b6b) !important; }
.badge.text-bg-warning { background: linear-gradient(135deg, #f59f00, #ffc078) !important; color: #1a1a1a !important; }

/* ===== Footer ===== */
.footer {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(15, 108, 189, 0.14);
  margin-top: auto;
  padding: 0.3rem 0;
  font-size: 0.78rem;
}

/* ===== Page Hero ===== */
.page-hero {
  position: relative;
  background:
    linear-gradient(135deg, rgba(15, 108, 189, 0.92), rgba(35, 169, 140, 0.84)),
    linear-gradient(180deg, #ffffff, #eef6fb);
  color: #fff;
  border: none !important;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.page-hero::before,
.page-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}
.page-hero::before {
  width: 240px; height: 240px;
  top: -80px; left: -50px;
}
.page-hero::after {
  width: 180px; height: 180px;
  bottom: -65px; right: 8%;
}
.page-hero .text-muted {
  color: rgba(255, 255, 255, 0.88) !important;
}
.page-hero .hero-icon {
  font-size: 3rem;
  opacity: 0.3;
  position: absolute;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
}

/* ===== Surface Panel ===== */
.surface-panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
}

/* ===== Quick Links ===== */
.quick-links .btn {
  min-width: 155px;
}

/* ===== Section Title ===== */
.section-title {
  color: #0d4c83;
  font-weight: 800;
}

/* ===== Search Box ===== */
.search-box {
  position: relative;
}
.search-box .search-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
}
.search-box .form-control {
  padding-right: 2.5rem;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #999;
}
.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

/* ===== Floating Action Button ===== */
.fab {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 24px rgba(15,108,189,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 1000;
}
.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(15,108,189,0.4);
}

/* ===== Container ===== */
.container > main {
  min-height: calc(100vh - 100px);
}

/* ===== Form Floating RTL ===== */
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ===== Responsive ===== */
@media (max-width: 767.98px) {
  .page-hero {
    padding: 1.5rem !important;
  }
  .page-hero .hero-icon { display: none; }
  .quick-links .btn {
    width: 100%;
  }
  .icon-card { padding: 1rem; }
  .stat-card .stat-value { font-size: 1.5rem; }
}

/* ===== Landing Page ===== */
.landing-banner {
  position: relative;
  margin: -1.5rem -0.75rem 2rem;
  padding: 4rem 1.5rem 3rem;
  border-radius: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #1a3a5c 0%, #2c5f8a 35%, #3a7ca5 70%, #4a8fb5 100%);
  min-height: 280px;
  display: flex;
  align-items: center;
}
.landing-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, rgba(0,0,0,0.45), transparent 60%);
  pointer-events: none;
}
.landing-banner-skyline {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 120px;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath d='M0,120 L0,80 L40,80 L40,60 L50,50 L60,60 L60,80 L80,80 L80,70 L90,60 L100,70 L100,80 L120,80 L120,40 L125,30 L130,20 L135,30 L140,40 L140,80 L160,80 L160,65 L170,55 L180,65 L180,80 L200,80 L200,75 L210,65 L220,75 L220,80 L260,80 L260,50 L270,40 L280,50 L280,80 L300,80 L300,70 L310,60 L320,70 L320,80 L340,80 L340,45 L350,35 L360,45 L360,80 L400,80 L400,72 L410,62 L420,72 L420,80 L440,80 L440,55 L450,45 L460,55 L460,80 L500,80 L500,68 L510,58 L520,68 L520,80 L540,80 L540,42 L545,32 L550,22 L555,32 L560,42 L560,80 L580,80 L580,70 L590,60 L600,70 L600,80 L620,80 L620,48 L630,38 L640,48 L640,80 L680,80 L680,74 L690,64 L700,74 L700,80 L720,80 L720,52 L730,42 L740,52 L740,80 L780,80 L780,66 L790,56 L800,66 L800,80 L820,80 L820,38 L825,28 L830,18 L835,28 L840,38 L840,80 L860,80 L860,72 L870,62 L880,72 L880,80 L920,80 L920,58 L930,48 L940,58 L940,80 L960,80 L960,70 L970,60 L980,70 L980,80 L1000,80 L1000,44 L1010,34 L1020,44 L1020,80 L1060,80 L1060,76 L1070,66 L1080,76 L1080,80 L1100,80 L1100,50 L1110,40 L1120,50 L1120,80 L1160,80 L1160,68 L1170,58 L1180,68 L1180,80 L1200,80 L1200,120 Z' fill='white'/%3E%3C/svg%3E");
  background-position: bottom;
  background-repeat: repeat-x;
  background-size: 1200px 120px;
}
.landing-banner-content {
  position: relative;
  z-index: 1;
  width: 100%;
}
.landing-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  /* Keep the monochrome logo visible against the dark hero banner. */
  filter: brightness(0) invert(1) drop-shadow(0 4px 16px rgba(0,0,0,0.3));
  margin-bottom: 1rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  padding: 8px;
}
.landing-title {
  color: #fff;
  font-weight: 900;
  font-size: 2.2rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.25);
  margin-bottom: 0.3rem;
}
.landing-subtitle {
  color: rgba(255,255,255,0.7);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  margin: 0;
}
.landing-card {
  border-radius: 16px !important;
  background: rgba(255,255,255,0.95) !important;
}
.landing-card:hover {
  transform: translateY(-4px);
}
.landing-card-header {
  background: linear-gradient(135deg, rgba(26,58,92,0.06), rgba(212,168,67,0.08)) !important;
}
.landing-icon-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.04);
  flex-shrink: 0;
  font-size: 1.1rem;
}
@media (max-width: 767.98px) {
  .landing-banner { padding: 2.5rem 1rem 2rem; min-height: 200px; }
  .landing-logo { width: 72px; height: 72px; }
  .landing-title { font-size: 1.6rem; }
  .landing-subtitle { font-size: 0.9rem; }
}
