/* Font display optimization: reduce CLS from web font loading */
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: local('Cairo');
  size-adjust: 100%;
  ascent-override: 90%;
  descent-override: 10%;
}

@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: local('Tajawal');
  size-adjust: 102%;
}

:root {
  --bg-dark: #020617;
  --bg-card: rgba(15, 23, 42, 0.6);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --brand-glow: #10b981;
  --accent-glow: #f59e0b;
  --glass-border: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  --nav-bg: rgba(2, 6, 23, 0.8);
  --nav-height: 80px;
}

* {
  box-sizing: border-box;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

body {
  margin: 0;
  font-family: 'Tajawal', sans-serif;
  color: var(--text-main);
  background-color: var(--bg-dark);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--nav-height);
}

.background-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(circle at 0% 0%, #064e3b 0%, transparent 40%),
    radial-gradient(circle at 100% 0%, #0f172a 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, #1e1b4b 0%, transparent 40%),
    radial-gradient(circle at 0% 100%, #020617 0%, transparent 40%);
  filter: blur(80px);
  opacity: 0.6;
}

h1,
h2,
h3,
h4,
.tag {
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: var(--nav-height);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  z-index: 1000;
  border-bottom: 1px solid var(--glass-border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  font-family: 'Cairo', sans-serif;
}

.logo-icon {
  color: var(--brand-glow);
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
}

.logo span {
  color: var(--brand-glow);
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
}

.nav-links a:hover {
  color: var(--brand-glow);
}

.menu-toggle, .search-toggle {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 10px;
}

.menu-toggle:hover, .search-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--brand-glow);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-toggle {
  display: none;
}

/* Mobile Menu */
.mobile-overlay {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: 100vw;
  height: calc(100vh - var(--nav-height));
  background: rgba(2, 6, 23, 0.3);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  display: flex !important;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 20px;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

.menu-close {
  display: none;
}

.menu-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.mobile-menu-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98));
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  width: 300px;
  max-width: 80vw;
  padding: 20px 10px;
  margin-top: 10px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(-20px) scale(0.95);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-overlay.active .mobile-menu-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.mobile-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-links a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 16px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  border-radius: 18px;
  transition: all 0.3s ease;
  position: relative;
  text-align: right;
}

.mobile-links a svg {
  color: var(--text-muted);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.mobile-links a.active {
  color: var(--brand-glow);
  background: rgba(16, 185, 129, 0.08);
}

.mobile-links a.active svg {
  color: var(--brand-glow);
}

.mobile-links a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding-right: 25px;
}

.mobile-links a:hover svg {
  color: var(--brand-glow);
  transform: scale(1.1);
}

.mobile-links a::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 0;
  background: var(--brand-glow);
  border-radius: 4px 0 0 4px;
  transition: height 0.3s ease;
}

.mobile-links a:hover::after,
.mobile-links a.active::after {
  height: 60%;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .menu-toggle { display: flex; }
  .navbar .container { padding: 0 4%; }
}

@media (max-width: 480px) {
  .mobile-links a { font-size: 1.6rem; }
  .mobile-menu-header { margin-bottom: 40px; }
  .card { padding: 24px; }
  .generator-header h2 { font-size: 1.5rem; }
}

.search-box {
  position: relative;
  width: 240px;
}

.search-box input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 8px 36px 8px 12px;
  border-radius: 12px;
  color: #fff;
  font-family: 'Tajawal', sans-serif;
}

.search-box svg {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.article-header {
  margin-bottom: 50px;
  position: relative;
  z-index: 1;
  padding: 40px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(2, 6, 23, 0) 100%);
  border-radius: 24px;
  border: 1px solid rgba(16, 185, 129, 0.1);
}

.article-header h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  background: linear-gradient(to bottom left, #fff 40%, rgba(255, 255, 255, 0.7));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
  .article-header h1 {
    font-size: 2.2rem;
  }
}

.article-body h2 {
  font-size: 1.8rem;
  color: #fff;
  margin: 50px 0 25px;
  display: flex;
  align-items: center;
  gap: 15px;
}

@media (max-width: 768px) {
  .article-body h2 {
    font-size: 1.4rem;
    margin: 35px 0 20px;
  }
}

.article-body h2::before {
  content: '';
  width: 12px;
  height: 12px;
  background: var(--brand-glow);
  border-radius: 3px;
  box-shadow: 0 0 10px var(--brand-glow);
}

.article-body ul {
  list-style: none;
  margin-bottom: 30px;
  padding-right: 20px;
}

.article-body li {
  position: relative;
  padding-right: 30px;
  margin-bottom: 15px;
  color: #cad1d9;
}

.article-body li::before {
  content: '→';
  position: absolute;
  right: 0;
  color: var(--brand-glow);
  font-weight: bold;
}

.article-body a {
  color: var(--brand-glow);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.article-body a:hover {
  filter: brightness(1.2);
  text-decoration-thickness: 2px;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.fact-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fact-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.fact-value {
  font-size: 1.1rem;
  color: #fff;
  font-weight: 600;
}

.toc-container {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.4), rgba(2, 6, 23, 0.4));
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 8px 20px;
  margin: 0 auto 30px;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.2);
  width: fit-content;
  display: flex;
  flex-direction: column;
  height: min-content;
  overflow: hidden;
}

.toc-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--brand-glow);
  line-height: 1;
}

.toc-chevron {
  transition: transform 0.3s ease;
}

.toc-container.is-open .toc-chevron {
  transform: rotate(180deg);
}

.toc-title {
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  overflow: hidden;
  opacity: 0;
}

.toc-container.is-open .toc-list {
  display: grid;
  opacity: 1;
  padding-top: 15px;
  padding-bottom: 5px;
}

@media (max-width: 600px) {
  .toc-list { grid-template-columns: 1fr; }
}

.toc-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.toc-number {
  font-family: 'Courier New', monospace;
  font-weight: 900;
  color: var(--brand-glow);
  opacity: 0.6;
  font-size: 0.85rem;
}

.toc-text { font-weight: 500; }

.toc-link:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: #fff;
  transform: translateX(-5px);
}

.toc-link:hover .toc-number { opacity: 1; }

.article-body h2 { scroll-margin-top: 100px; }

/* Layout Regions */
.site-main { padding: 60px 0; }

.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.sidebar-card {
  background: rgba(255, 255, 255, 0.02);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  min-height: 100px; /* Prevent CLS layout shifts */
  contain: layout style; /* Optimize rendering */
}

.side-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: #fff;
}

.side-header p,
.side-header h4 {
  margin: 0;
  font-size: 1.15rem;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
}

.featured-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 440px; /* Placeholder height for 4 items to prevent CLS */
}

.featured-list:empty::before {
  content: "";
  height: 440px;
  width: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
  border-radius: 16px;
}

@keyframes loading-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.featured-item {
  text-decoration: none;
  display: block;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.featured-item:hover {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.15);
  transform: translateX(-5px);
}

.featured-cat {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--brand-glow);
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 6px;
}

.featured-title {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Hero Section */
.home-hero {
  text-align: center;
  margin-bottom: 60px;
}

.home-hero h1 {
  font-size: clamp(1.8rem, 7vw, 3.5rem);
  margin: 0 0 16px;
  background: linear-gradient(to bottom, #fff 30%, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Grid & Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: min(32px, 5vw);
}

.card {
  background: var(--bg-card);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  padding: 40px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card:hover {
  transform: translateY(-12px);
  border-color: var(--brand-glow);
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.1);
}

.card-glass-effect {
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}

.card:hover .card-glass-effect { opacity: 1; }

.card-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--brand-glow);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 24px;
  width: fit-content;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.meta-group {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta svg {
  color: var(--brand-glow);
  opacity: 0.8;
}

.card h3 {
  font-size: 1.6rem;
  margin-bottom: 16px;
  line-height: 1.4;
  color: #fff;
  transition: color 0.3s;
}

.card:hover h3 { color: var(--brand-glow); }

.card p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  border-top: 1px solid var(--glass-border);
  padding-top: 24px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s;
}

.btn-outline svg { transition: transform 0.3s; }
.btn-outline:hover { color: var(--brand-glow); }
.btn-outline:hover svg { transform: translateX(-5px); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  background: var(--brand-glow);
  color: #020617;
}

/* Article Page */
.article-page-header { margin-bottom: 60px; }

.article-breadcrumb {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.article-breadcrumb a {
  color: var(--brand-glow);
  text-decoration: none;
}

.article-title {
  font-size: 3.5rem;
  line-height: 1.2;
  margin: 0 0 24px;
  font-weight: 900;
  background: linear-gradient(to bottom, #f8fafc, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
  .article-title {
    font-size: 2.2rem;
  }
}

.article-meta-info {
  display: flex;
  gap: 24px;
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--glass-border);
}

.article-meta-info .meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.article-intro {
  font-size: 1.4rem;
  color: var(--text-main);
  line-height: 1.6;
  border-right: 5px solid var(--brand-glow);
  padding: 10px 25px;
  background: rgba(16, 185, 129, 0.03);
  border-radius: 4px 16px 16px 4px;
  margin-bottom: 40px;
}

.quick-facts-container {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 30px;
  margin: 40px 0;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.quick-facts-header {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--brand-glow);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.fact-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fact-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.fact-value {
  font-size: 1.1rem;
  color: #fff;
  font-weight: 600;
}

/* FAQ */
.faq-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  margin-bottom: 20px;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.faq-item:hover {
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
}

.faq-question {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px 20px;
  background: rgba(16, 185, 129, 0.05);
}

.faq-question h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #fff;
  font-family: 'Cairo', sans-serif;
  line-height: 1.4;
}

.faq-answer {
  display: flex;
  gap: 15px;
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
  color: var(--text-muted);
}

.faq-answer p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.8rem;
  font-family: monospace;
}

.faq-question .faq-icon {
  background: var(--brand-glow);
  color: #020617;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.faq-answer .faq-icon {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.article-body {
  font-size: 1.2rem;
  color: #e2e8f0;
  line-height: 1.9;
}

.article-body p { margin-bottom: 30px; }

.article-body h2 {
  margin: 50px 0 25px;
  color: #fff;
  font-size: 1.8rem;
}

.article-body ul, .article-body ol {
  margin-bottom: 30px;
  padding-right: 25px;
}

.article-body li { margin-bottom: 12px; }

.info-box {
  background: rgba(16, 185, 129, 0.05);
  border-right: 4px solid var(--brand-glow);
  padding: 24px;
  border-radius: 12px;
  margin: 40px 0;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.info-box-icon {
  flex-shrink: 0;
  color: var(--brand-glow);
  background: rgba(16, 185, 129, 0.1);
  padding: 10px;
  border-radius: 10px;
}

.info-box-content p {
  margin-bottom: 0 !important;
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Footer */
.new-footer {
  margin-top: 80px;
  border-top: 1px solid var(--glass-border);
  background: radial-gradient(circle at center top, rgba(16, 185, 129, 0.03) 0%, transparent 60%);
  position: relative;
}

.footer-content-wrapper {
  max-width: 700px;
  margin: 0 auto;
  padding: 60px 20px 40px;
}

@media (min-width: 900px) {
  .footer-content-wrapper {
    max-width: 1100px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 60px;
  }
}

.footer-top-section {
  text-align: center;
  margin-bottom: 40px;
}

@media (min-width: 900px) {
  .footer-top-section {
    flex: 1;
    text-align: right;
    margin-bottom: 0;
  }
}

.footer-logo-large {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  font-family: 'Cairo', sans-serif;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 500px;
  margin: 0 auto 25px;
}

@media (min-width: 900px) {
  .footer-desc { margin: 15px 0 25px; }
}

.footer-status-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
}

@media (min-width: 900px) {
  .footer-status-badges { justify-content: flex-start; }
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.status-badge .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-badge .dot.green { 
  background: var(--brand-glow); 
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6); 
}
.status-badge .dot.blue { 
  background: #3b82f6; 
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6); 
}

.footer-accordions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

@media (min-width: 900px) {
  .footer-accordions { 
    flex: 1.2; 
    max-width: 550px; 
  }
}

.footer-accordion {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.footer-accordion:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.footer-accordion summary {
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  -webkit-user-select: none;
  user-select: none;
  font-family: 'Cairo', sans-serif;
  list-style: none;
}

.footer-accordion summary::-webkit-details-marker {
  display: none;
}

.footer-accordion summary .chevron {
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.footer-accordion[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-accordion[open] summary .chevron {
  transform: rotate(180deg);
  color: var(--brand-glow);
}

.footer-accordion-content {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(2, 6, 23, 0.3);
}

.footer-accordion-content a {
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  font-weight: 500;
}

.footer-accordion-content a:hover {
  color: var(--brand-glow);
  transform: translateX(-5px);
}

.footer-bottom-section {
  border-top: 1px solid var(--glass-border);
  padding: 30px 20px;
  background: rgba(2, 6, 23, 0.8);
}

.footer-bottom-container p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 5px 0;
}

.made-with {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}


/* Generator Section */
.generator-section {
  padding: 80px 40px;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
  border-radius: 60px;
  border: 1px solid var(--glass-border);
  margin-bottom: 80px;
  position: relative;
  overflow: hidden;
}

.generator-header {
  text-align: center;
  margin-bottom: 60px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.generator-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: start;
}

.card-console {
  background: rgba(2, 6, 23, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 40px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.2);
}

.control-tower {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.control-panel {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 24px;
}

.generator-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
}

.tab-btn {
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  flex: 1;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--brand-glow);
  color: #020617;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.official-view { width: 100%; animation: fadeIn 0.5s ease-out; }

.provider-selector {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 12px;
  border-radius: 12px;
  color: #fff;
  margin-bottom: 24px;
  font-family: 'Tajawal', sans-serif;
  cursor: pointer;
  outline: none;
}

.provider-selector:focus {
  border-color: var(--brand-glow);
}

.provider-selector option {
  background: #0f172a;
  color: #fff;
  padding: 10px;
}

.official-view-container { width: 100%; }

.official-card-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.official-nav {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--glass-border);
  font-size: 0.9rem;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.meta-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  padding: 16px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-box strong {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.meta-box span, .meta-box a {
  font-size: 0.95rem;
  font-weight: 500;
}

@media (max-width: 992px) {
  .generator-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .generator-section { padding: 40px 15px; border-radius: 30px; }
  .card-console { padding: 20px 15px; }
  .virtual-card { width: 100%; height: auto; aspect-ratio: 1.58 / 1; padding: 18px; }
  .card-number { font-size: 1.1rem; margin-bottom: 15px; letter-spacing: 1px; }
  .card-chip { width: 35px; height: 28px; margin-bottom: 15px; }
  .card-logo { top: 18px; right: 18px; font-size: 1.3rem; }
  .card-details { font-size: 0.65rem; }
  .card-details label { font-size: 0.55rem; }
  .generator-header h2 { font-size: 1.8rem; }
}

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

/* Virtual Card UI */
.virtual-card {
  width: 400px;
  height: 250px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 24px;
  padding: 30px;
  position: relative;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5), inset 0 0 100px rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  overflow: hidden;
}

.virtual-card.flipping {
  transform: rotateY(180deg) scale(0.9);
  opacity: 0.5;
}

.virtual-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transform: rotate(45deg);
  animation: shine 6s infinite linear;
}

@keyframes shine {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

.card-chip {
  width: 50px;
  height: 40px;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  border-radius: 8px;
  margin-bottom: 30px;
  position: relative;
}

.card-logo {
  position: absolute;
  top: 30px;
  right: 30px;
  font-size: 1.8rem;
  font-weight: 900;
  font-style: italic;
  opacity: 0.9;
}

.card-number {
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  letter-spacing: 2px;
  margin-bottom: 25px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.card-details {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-details label {
  display: block;
  opacity: 0.5;
  margin-bottom: 5px;
  font-size: 0.65rem;
}

.card-actions {
  display: flex;
  gap: 12px;
}

.copy-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 8px 16px;
  border-radius: 100px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: 'Tajawal', sans-serif;
}

.copy-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Responsive */
@media (max-width: 968px) {
  .layout-with-sidebar { grid-template-columns: 1fr; }
  .virtual-card { width: 100%; max-width: 350px; height: 210px; padding: 20px; }
  .card-number { font-size: 1.4rem; letter-spacing: 2px; }
  .nav-links { display: none; }
}

/* About Page */
.about-hero {
  text-align: center;
  padding: 80px 20px;
  background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
}

.about-hero h1 {
  font-size: 4rem;
  margin-bottom: 20px;
  background: linear-gradient(to bottom, #fff 30%, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
  .about-hero h1 {
    font-size: 2.5rem;
  }
}

.about-hero p {
  font-size: 1.4rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto;
}

.about-section { padding: 60px 0; }

.section-header {
  margin-bottom: 40px;
  border-right: 4px solid var(--brand-glow);
  padding-right: 20px;
}

.section-header h2 {
  font-size: 2.2rem;
  margin: 0;
  color: #fff;
}

@media (max-width: 768px) {
  .section-header h2 {
    font-size: 1.6rem;
  }
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.value-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  padding: 40px;
  border-radius: 32px;
  transition: all 0.3s;
}

.value-item:hover {
  background: rgba(16, 185, 129, 0.05);
  border-color: var(--brand-glow);
  transform: translateY(-10px);
}

.value-icon {
  width: 60px;
  height: 60px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-glow);
  margin-bottom: 24px;
}

.value-item h3 { margin-bottom: 12px; color: #fff; }
.value-item p { color: var(--text-muted); line-height: 1.6; }

@media (max-width: 768px) {
  .about-hero h1 { font-size: 2.5rem; }
}

/* Article Tables Premium Styling */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 40px 0;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--glass-border);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 1rem;
  color: #e2e8f0;
}

.article-table thead {
  background: linear-gradient(to bottom, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
  border-bottom: 2px solid rgba(16, 185, 129, 0.3);
}

.article-table th {
  padding: 20px;
  color: var(--brand-glow);
  font-weight: 800;
  font-family: 'Cairo', sans-serif;
  font-size: 1.1rem;
  white-space: nowrap;
}

.article-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  line-height: 1.5;
}

.article-table tbody tr {
  transition: background 0.3s ease;
}

.article-table tbody tr:hover {
  background: rgba(16, 185, 129, 0.03);
}

.article-table tr:last-child td {
  border-bottom: none;
}

.article-table strong {
  color: var(--brand-glow);
}

@media (max-width: 768px) {
  .article-table { font-size: 0.9rem; }
  .article-table th, .article-table td { padding: 14px 15px; }
}

/* Reading time */
.reading-time {
  display: flex;
  align-items: center;
  gap: 6px;
}


/* Entrance animation */
.entrance {
  animation: fadeInUp 0.6s ease-out both;
}

/* Search Overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-overlay-inner {
  width: min(700px, 92%);
  transform: translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-overlay.active .search-overlay-inner {
  transform: translateY(0);
}

.search-overlay-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(16, 185, 129, 0.08);
}

.search-overlay-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-family: 'Tajawal', sans-serif;
  font-size: 1.2rem;
  line-height: 1.5;
}

.search-overlay-input::placeholder {
  color: var(--text-muted);
}

.search-overlay-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.search-overlay-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.search-results {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 55vh;
  overflow-y: auto;
}

.search-result-item {
  display: block;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.search-result-item:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateX(-4px);
}

.search-result-cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--brand-glow);
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 6px;
}

.search-result-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  margin: 0 0 6px;
}

.search-result-summary {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 1rem;
}

.search-overlay-icon {
  color: var(--brand-glow);
  flex-shrink: 0;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 50px;
  margin-bottom: 20px;
}

.page-btn {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
}

.page-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.4);
  color: #fff;
}

.page-btn.active {
  background: var(--brand-glow);
  border-color: var(--brand-glow);
  color: #000;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
  pointer-events: none;
}
