@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* Language-aware typography */
  --font-latin: 'Plus Jakarta Sans', 'Segoe UI', Arial, sans-serif;
  --font-arabic: 'Vazirmatn', 'Cairo', 'Segoe UI', Tahoma, sans-serif;

  --primary-color: #009688;
  --primary-deep: #00675b;
  --primary-gradient: linear-gradient(135deg, #00bfa5 0%, #009688 45%, #00675b 100%);
  --primary-light: #e0f2f1;
  --secondary-color: #ffc400;
  --secondary-gradient: linear-gradient(135deg, #ffe082 0%, #ffc400 45%, #ff8f00 100%);
  --accent-color: #ff4081;
  --accent-gradient: linear-gradient(135deg, #ff4081 0%, #ff80ab 100%);
  --danger-color: #ef4444;
  --success-color: #10b981;
  --info-color: #3b82f6;
  --surface-color: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --bg-color: #f4f8f8;
  --text-dark: #0d1b2a;
  --text-muted: #475569;
  --card-shadow: 0 12px 32px -12px rgba(13, 27, 42, 0.10), 0 2px 8px -2px rgba(13, 27, 42, 0.05);
  --hover-shadow: 0 28px 56px -16px rgba(0, 150, 136, 0.30), 0 8px 20px -8px rgba(0, 150, 136, 0.18);
  --glow: 0 0 0 1px rgba(0, 150, 136, 0.06), 0 18px 50px -20px rgba(0, 150, 136, 0.35);
  --border-radius-sm: 14px;
  --border-radius-md: 22px;
  --border-radius-lg: 32px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-back: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ============ Base + dramatic animated aurora backdrop ============ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  animation: fadeInBody 0.9s var(--ease);
  margin: 0;
  font-family: var(--font-latin);
  background: var(--bg-color);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: 90px;
  position: relative;
  overflow-x: hidden;
}

/* Soft aurora blobs floating behind everything */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
}
body::before {
  width: 520px;
  height: 520px;
  top: -260px;
  left: -180px;
  background: radial-gradient(circle at 30% 30%, rgba(0, 191, 165, 0.42), transparent 70%);
  animation: floatBlob 18s ease-in-out infinite;
}
body::after {
  width: 460px;
  height: 460px;
  top: 40%;
  right: -200px;
  background: radial-gradient(circle at 70% 30%, rgba(255, 196, 0, 0.32), transparent 70%);
  animation: floatBlob 22s ease-in-out infinite reverse;
}

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, 60px) scale(1.12); }
  66% { transform: translate(-30px, 30px) scale(0.95); }
}

@keyframes fadeInBody {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* ============ Navbar ============ */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  padding: 14px 22px;
  box-shadow: 0 10px 30px -18px rgba(13, 27, 42, 0.25);
  position: sticky;
  top: 0;
  z-index: 999;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
}
.logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(150deg, #00897b 0%, #00564d 100%);
  box-shadow: 0 8px 18px -8px rgba(0, 86, 77, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  transition: transform 0.5s var(--ease-back);
}
.logo-badge img {
  height: 36px;
  width: 36px;
  object-fit: contain;
  border-radius: 10px;
}
.logo-word {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #009688 0%, #ff8f00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo:hover .logo-badge { transform: rotate(-6deg) scale(1.06); }

/* Language pill */
.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px 0 12px;
  height: 40px;
  border-radius: 13px;
  background: rgba(0, 150, 136, 0.07);
  border: 1.5px solid rgba(0, 150, 136, 0.14);
  transition: all 0.25s ease;
}
.lang-pill:hover {
  background: rgba(0, 150, 136, 0.12);
  border-color: rgba(0, 150, 136, 0.30);
}
.lang-pill > i {
  color: var(--primary-color);
  font-size: 1rem;
}
.lang-pill select {
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-dark);
  cursor: pointer;
  outline: none;
  padding: 0 4px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
[dir="rtl"] .lang-pill { padding: 0 12px 0 6px; }

.desktop-nav a { position: relative; }
.desktop-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -6px;
  height: 3px;
  border-radius: 3px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease);
}
.desktop-nav a:hover { color: var(--primary-color) !important; }
.desktop-nav a:hover::after { transform: scaleX(1); }

.nav-toggle {
  z-index: 1002;
  background: rgba(0, 150, 136, 0.07);
  border: none;
  cursor: pointer;
  padding: 0.55rem;
  margin-left: auto;
  display: block;
  border-radius: 12px;
  transition: background 0.25s ease;
}
.nav-toggle:hover { background: rgba(0, 150, 136, 0.14); }

.nav-toggle .bar {
  display: block;
  width: 24px;
  height: 2.5px;
  margin: 5px 0;
  background: var(--primary-color);
  border-radius: 2px;
  transition: 0.3s;
}

/* ============ Sidebar drawer ============ */
.side-nav {
  height: 100%;
  width: 300px;
  position: fixed;
  z-index: 10000;
  top: 0;
  left: -340px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  overflow-x: hidden;
  transition: left 0.5s var(--ease);
  padding-top: 0;
  box-shadow: 20px 0 60px -20px rgba(13, 27, 42, 0.25);
  border-right: 1px solid rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
}

.side-nav.open { left: 0; }

.side-nav-header {
  padding: 44px 24px 26px 24px;
  text-align: center;
  background: linear-gradient(160deg, rgba(0, 191, 165, 0.16) 0%, rgba(255, 255, 255, 0) 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
}

.side-nav-header img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(150deg, #00897b 0%, #00564d 100%);
  box-shadow: 0 12px 30px -8px rgba(0, 86, 77, 0.55);
  margin-bottom: 0.8rem;
  border: 3px solid #fff;
}

.side-nav-header h2 {
  color: var(--text-dark);
  font-size: 1.25rem;
  margin: 0;
  font-weight: 800;
}

.side-nav-links {
  list-style: none;
  padding: 0 16px;
  margin: 0;
  flex: 1;
}

.side-nav-links li { margin-bottom: 8px; }

.side-nav-links li a {
  color: var(--text-dark);
  padding: 14px 18px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  transition: all 0.25s var(--ease);
}

.side-nav-links li a i {
  font-size: 1.2rem;
  color: var(--primary-color);
  transition: transform 0.3s var(--ease-back);
}

.side-nav-links a:hover {
  background: var(--primary-gradient);
  color: #fff;
  transform: translateX(6px);
  box-shadow: 0 10px 22px -10px rgba(0, 150, 136, 0.55);
}
.side-nav-links a:hover i { color: #fff; transform: scale(1.15); }

/* ============ Cards ============ */
.app-card {
  background: var(--surface-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--card-shadow);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(13, 27, 42, 0.05);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  position: relative;
}

.app-card:hover {
  box-shadow: var(--hover-shadow);
  transform: translateY(-6px);
  border-color: rgba(0, 150, 136, 0.18);
}

/* ============ Buttons ============ */
.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease-back), box-shadow 0.3s var(--ease);
  box-shadow: 0 6px 16px -8px rgba(13, 27, 42, 0.25);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Sheen sweep on hover */
.app-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform 0.7s var(--ease);
  z-index: 1;
}
.app-btn:hover::before { transform: translateX(130%); }

.app-btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--primary-gradient);
  color: #fff !important;
}
.btn-primary:hover {
  box-shadow: 0 14px 30px -10px rgba(0, 150, 136, 0.55);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--secondary-gradient);
  color: #5b4300 !important;
}
.btn-secondary:hover {
  box-shadow: 0 14px 30px -10px rgba(255, 160, 0, 0.55);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color) !important;
  border: 2px solid var(--primary-color);
  box-shadow: none;
}
.btn-outline:hover {
  background: var(--primary-color);
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px rgba(0, 150, 136, 0.45);
}

/* ============ Floating Action Button ============ */
.fab {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 16px 34px -12px rgba(0, 150, 136, 0.6);
  z-index: 1000;
  text-decoration: none;
  transition: all 0.35s var(--ease-back);
}
.fab::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(0, 150, 136, 0.4);
  animation: fabPulse 2s ease-out infinite;
}
@keyframes fabPulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.5); opacity: 0; }
}
.fab:hover {
  transform: translateY(-5px) scale(1.08);
  box-shadow: 0 20px 40px -10px rgba(0, 150, 136, 0.7);
  color: white;
}

/* ============ Bottom navigation (mobile) ============ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  width: calc(100% - 32px);
  height: 70px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  box-shadow: 0 16px 40px -12px rgba(13, 27, 42, 0.22);
  z-index: 9999;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 0 10px;
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  width: 25%;
  height: 100%;
  transition: all 0.25s var(--ease);
  position: relative;
}

.nav-item i {
  font-size: 1.4rem;
  margin-bottom: 4px;
  transition: transform 0.35s var(--ease-back);
}

.nav-item span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.1px;
}

.nav-item.active { color: var(--primary-color); }

.nav-item.active i {
  transform: translateY(-7px) scale(1.18);
  color: var(--primary-color);
  filter: drop-shadow(0 6px 10px rgba(0, 150, 136, 0.4));
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-gradient);
}

/* ============ Media queries ============ */
@media (max-width: 768px) {
  .bottom-nav { display: block; }
  body { padding-bottom: 100px; }
  .hide-on-mobile { display: none !important; }
}

/* ============ Category + visual cards ============ */
.category-card {
  border: 1px solid rgba(13, 27, 42, 0.04);
  border-radius: var(--border-radius-md);
  background: var(--surface-color);
  transition: all 0.45s var(--ease);
  overflow: hidden;
  position: relative;
}
.category-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  z-index: 0;
}
.category-card > * { position: relative; z-index: 1; }
.category-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--glow);
  border-color: transparent;
}
.category-card:hover::before { opacity: 0.06; }
.category-card img { transition: transform 0.45s var(--ease-back); }
.category-card:hover img { transform: scale(1.18) rotate(3deg); }

.app-card img { transition: transform 0.45s var(--ease); }

/* ============ Carousel polish ============ */
.carousel-control-prev-icon,
.carousel-control-next-icon {
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.3);
}
.carousel-indicators [data-bs-target] {
  border-radius: 50%;
  width: 9px;
  height: 9px;
}

/* ============ Forms ============ */
.form-control,
.form-select {
  border-radius: 12px;
  border: 1.5px solid rgba(13, 27, 42, 0.08);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(0, 150, 136, 0.12);
}
.input-group-text { transition: background 0.25s ease; }

/* ============ Footer link hover ============ */
footer a[href] { transition: color 0.25s ease, transform 0.25s ease; }
footer .col a[style*="border-radius: 50%"]:hover {
  background: var(--primary-gradient) !important;
  color: #fff !important;
  transform: translateY(-3px);
}

/* ============ Scroll reveal utility ============ */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  will-change: opacity, transform;
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* ============ Alert pulse ============ */
.animate-pulseAlert { animation: pulseAlert 1.5s infinite; }
@keyframes pulseAlert {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); box-shadow: 0 10px 25px rgba(0, 150, 136, 0.3); }
  100% { transform: scale(1); }
}

/* ============ Utility ============ */
.bg-primary-light { background: var(--primary-light); }
.text-primary { color: var(--primary-color) !important; }

::selection {
  background: rgba(0, 150, 136, 0.20);
  color: var(--primary-deep);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--primary-color), var(--primary-deep));
  border-radius: 10px;
  border: 3px solid var(--bg-color);
}
::-webkit-scrollbar-thumb:hover { background: var(--primary-deep); }

/* ============ Language-aware fonts ============ */
[dir="rtl"] body,
html[lang="ar"] body,
html[lang="ku"] body,
[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] textarea,
[dir="rtl"] button,
[dir="rtl"] .btn {
  font-family: var(--font-arabic);
}
/* Kurdish/Arabic strokes look thin at weight 400 — give body a medium weight */
[dir="rtl"] body { font-weight: 500; }
[dir="rtl"] p,
[dir="rtl"] span,
[dir="rtl"] a,
[dir="rtl"] li,
[dir="rtl"] label,
[dir="rtl"] td,
[dir="rtl"] .small,
[dir="rtl"] small,
[dir="rtl"] .text-muted { font-weight: 500; }
[dir="rtl"] .fw-semibold { font-weight: 600 !important; }
[dir="rtl"] .fw-bold,
[dir="rtl"] .fw-extrabold,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 { font-weight: 800 !important; }
/* The muted grey is too faint on Arabic text — lift its weight/contrast */
[dir="rtl"] .text-muted { color: #3f4d63 !important; }
/* Letter-spacing breaks connected Arabic/Kurdish letters — disable it for RTL */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
[dir="rtl"] p, [dir="rtl"] span, [dir="rtl"] a,
[dir="rtl"] li, [dir="rtl"] label, [dir="rtl"] button,
[dir="rtl"] .card-title, [dir="rtl"] .card-text,
[dir="rtl"] .nav-item span { letter-spacing: 0 !important; }
/* A touch more line-height makes Kurdish easier to read */
[dir="rtl"] body { line-height: 1.75; }
/* Keep the Latin brand wordmark in the Latin display font everywhere */
.logo-word { font-family: var(--font-latin) !important; }

/* ============ RTL ============ */
[dir="rtl"] .side-nav {
  left: auto;
  right: -340px;
  transition: right 0.5s var(--ease);
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.6);
}
[dir="rtl"] .side-nav.open { right: 0; left: auto; }
[dir="rtl"] .side-nav-links a:hover { transform: translateX(-6px); }
