* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

[lang="ar"] * {
  font-family: 'Cairo', sans-serif;
}

:root {
  --primary-red: #ef4444;
  --primary-blue: #38bdf8;
  --bg-dark: #020617;
  --card-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);
  --muted: #94a3b8;
}

body {
  background: var(--bg-dark);
  color: white;
  overflow-x: hidden;
  line-height: 1.5;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.4), transparent 70%);
  top: -100px;
  left: -100px;
  filter: blur(120px);
  z-index: -1;
  animation: floatRed 15s ease-in-out infinite;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.3), transparent 70%);
  bottom: -100px;
  right: -100px;
  filter: blur(120px);
  z-index: -1;
  animation: floatBlue 18s ease-in-out infinite;
  pointer-events: none;
}

nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 25px;
  background: rgba(15, 23, 42, 0.6);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

nav a.logo-link {
  color: var(--primary-red);
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.burger {
  display: none;
  cursor: pointer;
  z-index: 1001;
}

.burger div {
  width: 22px;
  height: 2px;
  background-color: white;
  margin: 5px;
  transition: all 0.3s ease;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-menu .close-menu {
  display: none; /* Hidden by default */
  position: absolute;
  top: 16px;
  right: 20px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--theme-border-soft, rgba(255, 255, 255, 0.2));
  background: rgba(255, 255, 255, 0.08);
  color: var(--theme-link, #cbd5e1);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  z-index: 1004; /* Ensure it's above other menu items */
  line-height: 1;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.nav-menu .close-menu:hover {
  background: var(--theme-link-hover-bg, rgba(239, 68, 68, 0.16));
  color: var(--theme-link-active, #ffffff);
}

.nav-menu a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active-link {
  background: rgba(239, 68, 68, 0.1);
  color: var(--primary-red);
}

.nav-menu #login-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.13);
  color: #fca5a5;
  font-weight: 700;
}

.nav-menu #login-nav-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(248, 113, 113, 0.62);
  color: #fee2e2;
}

.nav-menu #login-nav-btn[aria-expanded="true"] {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(248, 113, 113, 0.72);
  color: #fff;
}

#lang-select {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  padding: 5px;
  cursor: pointer;
}

#lang-select option {
  background: #0f172a;
  color: white;
}

main {
  padding: 130px 20px 40px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-block {
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  padding: 28px;
  background: rgba(15, 23, 42, 0.45);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  margin-bottom: 20px;
}

.hero-block h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  margin-bottom: 10px;
}

.hero-block p {
  color: var(--muted);
}

.section {
  padding: 30px 0;
}

.section h2 {
  margin-bottom: 20px;
  font-size: 30px;
  position: relative;
  display: inline-block;
}

.section h2::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 20%;
  right: 20%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-red), var(--primary-blue));
  border-radius: 10px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  padding: 18px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 26px rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.3);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #bae6fd;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.card p,
.muted {
  color: var(--muted);
}

.btn,
.btn-outline {
  display: inline-block;
  text-decoration: none;
  padding: 12px 25px;
  border-radius: 12px;
  font-weight: 700;
  transition: 0.3s;
  border: 1px solid rgba(239, 68, 68, 0.5);
  margin-top: 12px;
}

.btn {
  color: white;
  background: rgba(239, 68, 68, 0.32);
}

.btn:hover {
  background: rgba(220, 38, 38, 0.5);
  transform: scale(1.05);
}

.btn-outline {
  color: white;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.split {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 16px;
}

.media {
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--card-bg);
}

.media img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
}

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

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.meta-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.4);
}

.meta-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.meta-item strong {
  font-size: 14px;
}

.check-list {
  margin: 10px 0 0 20px;
  color: #cbd5e1;
}

.check-list li {
  margin-bottom: 6px;
}

footer {
  text-align: center;
  padding: 30px 20px;
  color: #64748b;
}

:root[data-theme="light-comfort"] body {
  color: #0f172a;
}

:root[data-theme="light-comfort"] nav {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.34);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

:root[data-theme="light-comfort"] .nav-menu a {
  color: #334155;
}

:root[data-theme="light-comfort"] .nav-menu a:hover,
:root[data-theme="light-comfort"] .nav-menu a.active-link {
  color: #7f1d1d;
  background: rgba(239, 68, 68, 0.16);
}

:root[data-theme="light-comfort"] #lang-select {
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.4);
}

:root[data-theme="light-comfort"] #lang-select option {
  background: #ffffff;
  color: #0f172a;
}

:root[data-theme="light-comfort"] .burger div {
  background-color: #0f172a;
}

:root[data-theme="light-comfort"] .card,
:root[data-theme="light-comfort"] .media,
:root[data-theme="light-comfort"] .panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(245, 248, 252, 0.93));
  border-color: rgba(148, 163, 184, 0.34);
}

:root[data-theme="light-comfort"] .card h3,
:root[data-theme="light-comfort"] .panel h1,
:root[data-theme="light-comfort"] .panel h2,
:root[data-theme="light-comfort"] .panel h3 {
  color: #0f172a;
}

:root[data-theme="light-comfort"] .card p,
:root[data-theme="light-comfort"] .muted {
  color: #1f2937;
}

:root[data-theme="light-comfort"] .hero-block p,
:root[data-theme="light-comfort"] .check-list li,
:root[data-theme="light-comfort"] .section p {
  color: #111827;
}

:root[data-theme="light-comfort"] .badge {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.36);
  color: #991b1b;
}

:root[data-theme="light-comfort"] .meta-item {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(148, 163, 184, 0.36);
}

:root[data-theme="light-comfort"] .meta-item span {
  color: #64748b;
}

:root[data-theme="light-comfort"] .meta-item strong {
  color: #0f172a;
}

:root[data-theme="light-comfort"] .check-list {
  color: #334155;
}

:root[data-theme="light-comfort"] .btn {
  color: #991b1b;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(239, 68, 68, 0.58);
}

:root[data-theme="light-comfort"] .btn:hover {
  color: #7f1d1d;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.66);
}

:root[data-theme="light-comfort"] .nav-menu #login-nav-btn {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(239, 68, 68, 0.58);
  color: #991b1b;
}

:root[data-theme="light-comfort"] .nav-menu #login-nav-btn:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.7);
  color: #7f1d1d;
}

:root[data-theme="light-comfort"] .nav-menu #login-nav-btn[aria-expanded="true"] {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.76);
  color: #7f1d1d;
}

:root[data-theme="light-comfort"] .btn-outline {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.42);
}

:root[data-theme="light-comfort"] .btn-outline:hover {
  color: #7f1d1d;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.5);
}

:root[data-theme="light-comfort"] footer {
  color: #475569;
}

@keyframes floatRed {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(100px, 50px); }
}

@keyframes floatBlue {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-100px, -50px); }
}

@media (max-width: 980px) {
  nav {
    padding: 15px 25px;
  }

  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .burger {
    display: block;
  }

  .nav-menu-active ~ .burger {
    display: none;
  }

  .nav-menu {
    position: fixed;
    right: 15px;
    top: 15px;
    height: auto;
    max-height: calc(100vh - 30px);
    width: 260px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    transform: translateX(150%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    padding: 60px 20px 40px;
  }

  .nav-menu-active {
    transform: translateX(0);
  }

  .nav-menu a {
    width: 100%;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: #cbd5e1;
  }

  .nav-menu-active .close-menu {
    display: inline-flex;
  }

  #lang-select {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    border-radius: 15px;
    text-align: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
  }

  [dir="rtl"] .nav-menu {
    right: auto;
    left: 15px;
    transform: translateX(-150%);
  }

  [dir="rtl"] .nav-menu-active {
    transform: translateX(0);
  }

  [dir="rtl"] .nav-menu .close-menu {
    right: auto;
    left: 20px;
  }
}
