/*
Theme Name: Play-List
Theme URI: https://play-list.net
Description: قالب حرفه‌ای پلی‌لیست با طراحی مدرن و پشتیبانی کامل از RTL
Version: 1.0.0
Author: Play-List Team
Author URI: https://play-list.net
Text Domain: play-list
Domain Path: /languages
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: music, playlist, rtl, modern, dark, responsive, custom-colors, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, sticky-post, theme-options, threaded-comments, translation-ready
*/

/* ===== CSS Variables ===== */
:root {
  --bg: #071a1e;        /* deep teal */
  --card: #0d2227;      /* petrol */
  --muted: #a7c1c7;     /* cool gray-teal */
  --text: #eaf5f7;      /* near white with blue tint */
  --white: #fff;
  --glass: rgba(255,255,255,.06);
  --stroke: rgba(255,255,255,.10);
  --accent1: #00e5ff;   /* neon cyan */
  --accent2: #00ffa3;   /* mint/green */
  --accent3: #37b6ff;   /* sky blue */
  --danger: #ff3b6b;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --blur: 18px;
  --ring: 0 0 0 3px rgba(0,229,255,.25);
}

/* ===== Reset & Base ===== */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(800px 600px at 80% -10%, rgba(0,229,255,.18), transparent 60%),
    radial-gradient(700px 520px at -10% 20%, rgba(0,255,163,.18), transparent 60%),
    radial-gradient(900px 700px at 70% 120%, rgba(55,182,255,.16), transparent 60%),
    linear-gradient(115deg, #06171b 0%, #0a242a 40%, #061418 100%);
  font-family: "Vazirmatn", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Poppins", sans-serif;
  color: var(--text);
  overflow-x: hidden;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 1rem;
  line-height: 1.2;
}

p {
  margin: 0 0 1rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(var(--blur));
  background: linear-gradient(180deg, rgba(15,16,22,.95), rgba(15,16,22,.85));
  border-bottom: 1px solid var(--stroke);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 90px;
  padding: 0 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.3s ease;
}

.brand:hover {
  transform: scale(1.02);
}

.logo {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,255,255,.75));
  box-shadow: 0 10px 35px rgba(0,229,255,.14), inset 0 0 0 1px rgba(0,0,0,.08);
  transition: all 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 45px rgba(255,255,255,.25), inset 0 0 0 1px rgba(0,0,0,.1);
}

.logo svg {
  width: 26px;
  height: 26px;
}

.brand-title {
  line-height: 2;
  transition: all 0.3s ease;
}

.brand-title .fa {
  font-weight: 900;
  font-size: 24px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 10px rgba(0,229,255,.3);
}

.brand-title .en {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 13px;
  opacity: .9;
  color: var(--muted);
  margin-top: 2px;
}

.nav-items {
  display: flex;
  align-items: center;
  gap: 18px;
  /* Ensure menu is always visible on desktop */
  visibility: visible;
  opacity: 1;
}

.menu {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--glass);
  border: 1px solid var(--stroke);
  padding: 8px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  /* Ensure menu is always visible */
  visibility: visible;
  opacity: 1;
}

.menu a {
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  position: relative;
  overflow: hidden;
}

.menu a::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(100%);
  background: linear-gradient(135deg, rgba(0,229,255,.25), rgba(0,255,163,.25));
  transition: transform .35s ease;
}

.menu a:hover::after {
  transform: translateX(0);
}

.menu a.active,
.menu a:hover {
  color: var(--white);
  background: linear-gradient(135deg, rgba(0,229,255,.18), rgba(0,255,163,.18));
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  padding: 12px 16px;
  border-radius: 18px;
  width: min(450px, 60vw);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.search:focus-within {
  border-color: var(--accent1);
  box-shadow: 0 0 0 3px rgba(0,229,255,.1);
  transform: scale(1.02);
}

.search input {
  all: unset;
  width: 100%;
  font-size: 14px;
  color: var(--text);
}

.search .kbd {
  font-family: "Poppins", monospace;
  font-size: 11px;
  border: 1px solid var(--stroke);
  padding: 2px 6px;
  border-radius: 8px;
  color: var(--muted);
}

/* Compact floating search (collapses to icon and expands on focus) */
.search.compact {
  width: 44px;
  padding: 8px;
  gap: 0;
  justify-content: center;
  overflow: hidden;
  transition: width .25s ease, padding .25s ease, box-shadow .25s ease;
}
.search.compact svg { flex: 0 0 auto; }
.search.compact input {
  width: 0;
  opacity: 0;
  pointer-events: none;
  transition: width .25s ease, opacity .25s ease;
}
.search.compact:focus-within {
  width: 280px;
  gap: 10px;
  padding: 12px 16px;
}
.search.compact:focus-within input {
  width: 100%;
  opacity: 1;
  pointer-events: auto;
}
.search.compact .kbd { display: none; }

/* Ensure full width inside mobile overlay */
@media (max-width: 760px) {
  .nav-items.mobile-open .search.compact {
    width: 100%;
    max-width: 300px;
    gap: 10px;
    padding: 12px 16px;
  }
  .nav-items.mobile-open .search.compact input {
    width: 100%;
    opacity: 1;
    pointer-events: auto;
  }
}

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

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  border-radius: 16px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  /* Ensure buttons are visible and clickable on mobile */
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: #06171b;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  box-shadow: 0 8px 25px rgba(0,229,255,.3);
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  border-radius: 16px;
  z-index: -1;
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(135deg, rgba(255,255,255,.2), rgba(255,255,255,0));
  transition: transform 0.4s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(0,229,255,.4);
}

.btn-primary:hover::after {
  transform: translateX(0);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--stroke);
  color: var(--text);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: rgba(255,255,255,.1);
  border-color: var(--accent1);
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(0,229,255,.15);
}

.btn-ghost:active {
  transform: translateY(0);
}

.hamburger {
  display: none;
  background: var(--glass);
  border: 1px solid var(--stroke);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 60;
}

.hamburger:hover {
  background: rgba(255,255,255,.1);
  border-color: var(--accent1);
}

.hamburger.active {
  background: var(--accent1);
  border-color: var(--accent1);
}

.hamburger.active svg {
  stroke: #06171b;
}

/* ===== Categories ===== */
.categories {
  position: relative;
  padding: 10px 0;
  border-bottom: 1px solid var(--stroke);
  background: rgba(255,255,255,.02);
}

.chips {
  display: flex;
  gap: 8px;
  overflow: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--stroke);
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  transition: .25s transform ease, .35s background ease;
}

.chip.active,
.chip:hover {
  color: #06171b;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  border-color: transparent;
  transform: translateY(-1px);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 64px 0 96px;
  overflow: hidden;
}

/* Hero polish */
.headline {
  position: relative;
  text-wrap: balance;
}
.headline::after {
  content: "";
  display: block;
  width: 68px;
  height: 4px;
  border-radius: 999px;
  margin-top: 10px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  box-shadow: 0 4px 12px rgba(0,229,255,.35);
}
.sub {
  max-width: 58ch;
}

/* Decorative soft glow */
.hero::after {
  content: "";
  position: absolute;
  top: -40px;
  inset-inline-start: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(closest-side, rgba(0,229,255,.2), transparent 70%);
  filter: blur(18px);
  opacity: .25;
  pointer-events: none;
}

/* CTA icons alignment */
.cta .btn svg {
  width: 18px;
  height: 18px;
}
[dir="rtl"] .cta .btn { flex-direction: row-reverse; }

/* Stats with icons */
.stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.stat .val { font-weight: 900; color: var(--white); }
.stat svg { opacity: .9; }

.hero::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(600px 400px at 20% 10%, rgba(0,229,255,.16), transparent 60%), radial-gradient(600px 400px at 80% 20%, rgba(0,255,163,.12), transparent 60%);
  pointer-events: none;
  filter: blur(20px);
}

.wave {
  position: absolute;
  inset: auto 0 -1px 0;
  height: 160px;
  z-index: -1;
}

.wave svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
  align-items: center;
}

.headline {
  font-size: 48px;
  line-height: 1.15;
  margin: 0 0 14px;
  font-weight: 900;
}

.sub {
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 22px;
}

.cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stats {
  display: flex;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.stat {
  background: var(--glass);
  border: 1px solid var(--stroke);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* Mockup card */
.mock {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--stroke);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: linear-gradient(135deg, rgba(0,229,255,.12), rgba(0,255,163,.10));
  border-bottom: 1px solid var(--stroke);
}

.pill {
  background: rgba(255,255,255,.12);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.mock-body {
  padding: 16px;
}

.tracks {
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--stroke);
  padding: 10px;
  border-radius: 12px;
  transition: .25s transform ease, .35s box-shadow ease;
}

.row:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,229,255,.12);
}

.cover {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #0d2227;
}

.title {
  font-weight: 800;
}

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

.time {
  font-family: "Poppins", monospace;
  font-weight: 700;
  color: var(--muted);
}

/* ===== Playlists section ===== */
.section {
  padding: 20px 0 90px;
  position: relative;
}

/* ===== Single Playlist ===== */
.single-playlist .playlist-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: center;
  margin: 14px 0 18px;
}
.single-playlist .playlist-cover img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.single-playlist .entry-title {
  font-weight: 900;
  font-size: 30px;
  margin: 0 0 6px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.single-playlist .playlist-meta { color: var(--muted); display:flex; gap:10px; margin: 6px 0 10px; }
.single-playlist .meta-chips { display:flex; flex-wrap:wrap; gap:8px; }
.single-playlist .meta-chips .chip { padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.06); border:1px solid var(--stroke); font-size: 12px; color: var(--muted); }
.single-playlist .platform-links { display:flex; gap:8px; margin-top: 12px; }

@media (max-width: 760px) {
  .single-playlist .playlist-hero { grid-template-columns: 1fr; }
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title {
  font-weight: 900;
  font-size: 22px;
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  padding: 8px 10px;
  border-radius: 12px;
}

.control input,
.control select {
  all: unset;
  font-size: 14px;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0,1fr));
}

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid var(--stroke);
  border-radius: 18px;
  overflow: hidden;
  transition: .3s transform ease, .4s box-shadow ease, .35s border-color ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,229,255,.12), rgba(0,255,163,.12));
  opacity: 0;
  transition: .35s opacity ease;
}

.card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 20px 44px rgba(0,229,255,.18);
  border-color: rgba(0,229,255,.35);
}

.card:hover::before {
  opacity: 1;
}

.thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #062328;
  font-size: 22px;
}

.card-body {
  padding: 12px;
}

.card-title {
  font-weight: 800;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--stroke);
}

.card-meta {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

/* ===== Footer ===== */
.footer {
  padding: 20px 0;
  border-top: 1px solid var(--stroke);
  color: var(--muted);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,.1));
  position: relative;
}

/* ===== Global Site Player ===== */
.site-player {
  position: sticky;
  bottom: 0;
  inset-inline: 0;
  z-index: 50;
  border-top: 1px solid var(--stroke);
  background: rgba(7,26,30,.9);
  backdrop-filter: blur(10px);
}
.site-player .player-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: grid;
  grid-template-columns: auto 1fr minmax(120px, 240px);
  gap: 12px;
  align-items: center;
}
.site-player .player-meta { color: var(--muted); font-size: 13px; }
.site-player .player-title { color: var(--white); font-weight: 800; }
.site-player .player-progress { height: 6px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.site-player .player-progress .bar { width: 20%; height: 100%; background: linear-gradient(135deg, var(--accent1), var(--accent2)); }

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent1), transparent);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  text-align: center;
}

.footer-copyright {
  font-size: 14px;
  opacity: .8;
}

.footer-credits {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dev-credit {
  font-size: 13px;
  opacity: .7;
  display: flex;
  align-items: center;
  gap: 6px;
}

.codingo-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent1);
  font-weight: 600;
  transition: all 0.3s ease;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(0,229,255,.1);
  border: 1px solid transparent;
}

.codingo-link:hover {
  color: var(--white);
  background: rgba(0,229,255,.2);
  border-color: var(--accent1);
  transform: translateY(-1px);
}

.codingo-text {
  font-weight: 700;
}

.codingo-icon {
  transition: transform 0.3s ease;
}

.codingo-link:hover .codingo-icon {
  transform: translate(2px, -2px);
}

/* ===== WordPress Specific ===== */
/* Accessibility: screen reader text */
.screen-reader-text {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}
.screen-reader-text:focus {
  position: static !important;
  height: auto;
  width: auto;
  clip: auto !important;
  clip-path: none;
  white-space: normal;
  background: #f1f1f1;
  color: #21759b;
  padding: 15px 23px 14px;
  margin: 15px 0;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0,0,0,.6);
  z-index: 100000;
}
.wp-block-navigation {
  display: flex;
  align-items: center;
  gap: 14px;
}

.wp-block-navigation .wp-block-navigation-item__content {
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  position: relative;
  overflow: hidden;
}

.wp-block-navigation .wp-block-navigation-item__content::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(100%);
  background: linear-gradient(135deg, rgba(0,229,255,.25), rgba(0,255,163,.25));
  transition: transform .35s ease;
}

.wp-block-navigation .wp-block-navigation-item__content:hover::after {
  transform: translateX(0);
}

.wp-block-navigation .wp-block-navigation-item__content:hover {
  color: var(--white);
  background: linear-gradient(135deg, rgba(0,229,255,.18), rgba(0,255,163,.18));
}

.wp-block-site-title a {
  color: inherit;
  text-decoration: none;
}

.wp-block-site-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
}

/* Global RTL (Persian) */
html[lang="fa"],
body[dir="rtl"] {
  direction: rtl;
  unicode-bidi: plaintext;
}

body[dir="rtl"] .nav { direction: rtl; }
body[dir="rtl"] .brand { direction: rtl; }
body[dir="rtl"] .brand-title { text-align: right; }
body[dir="rtl"] .menu a { text-align: right; }
body[dir="rtl"] .search { direction: rtl; }
body[dir="rtl"] .search input { text-align: right; }

/* Header RTL alignment */
[dir="rtl"] .header { text-align: right; }
[dir="rtl"] .nav {
  flex-direction: row-reverse;
  justify-content: flex-start;
}
[dir="rtl"] .nav-items { margin-right: 18px; }
[dir="rtl"] .menu a { text-align: right; }
[dir="rtl"] .brand-title { text-align: right; }

/* Place close button on the opposite side for RTL */
@media (max-width: 760px) {
  [dir="rtl"] .mobile-close {
    left: 30px;
    right: auto;
  }
}

/* ===== Responsive (Desktop/Tablet ensure visible) ===== */
@media (min-width: 761px) {
  .nav-items {
    display: flex;
    position: static;
    right: auto;
    width: auto;
    height: auto;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding: 0;
    gap: 18px;
    background: transparent;
    backdrop-filter: none;
    overflow: visible;
  }
  .nav-items .menu,
  .nav-items .search,
  .nav-items .actions {
    display: flex;
  }
  .hamburger { display: none; }
}

/* Tablet Styles */
@media (max-width: 1180px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0,1fr));
  }
}

@media (max-width: 880px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

/* Mobile Menu Styles */
@media (max-width: 760px) {
  .kbd { display: none; }
  .hamburger {
    display: inline-grid;
    place-items: center;
  }
  
  /* Hide primary navigation elements on mobile */
  .nav-items {
    display: none;
  }

  /* Mobile menu overlay styles (active when .mobile-open is present) */
  .nav-items.mobile-open {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, rgba(7,26,30,.98), rgba(13,34,39,.98));
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 100px 20px 40px;
    gap: 30px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9990;
    overflow-y: auto;
    display: flex; /* Show the overlay */
  }

  .nav-items.mobile-open .menu,
  .nav-items.mobile-open .search,
  .nav-items.mobile-open .actions {
    display: flex;
    visibility: visible;
    opacity: 1;
  }

  .nav-items.mobile-open .menu {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    background: transparent;
    border: none;
    padding: 0;
    gap: 0;
  }

  .nav-items.mobile-open .menu a {
    width: 100%;
    text-align: center;
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 8px;
    background: var(--glass);
    border: 1px solid var(--stroke);
    font-size: 16px;
  }

  .nav-items.mobile-open .search {
    width: 100%;
    max-width: 300px;
    margin: 20px 0;
  }

  .nav-items.mobile-open .actions {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    gap: 16px;
    align-items: center;
  }

  .nav-items.mobile-open .actions .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
    padding: 16px 24px;
    font-size: 16px;
    border-radius: 18px;
    font-weight: 700;
    text-align: center;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
  }

  .nav-items.mobile-open .actions .btn-primary {
    background: linear-gradient(135deg, #00e5ff, #00ffa3);
    color: #06171b;
    box-shadow: 0 8px 25px rgba(0,229,255,.3);
  }

  .nav-items.mobile-open .actions .btn-ghost {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    color: #eaf5f7;
  }

  /* Mobile Menu Close Button (real element) */
  .mobile-close {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 24px;
    color: var(--muted);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    transition: all 0.3s ease;
    z-index: 60;
  }

  .mobile-close:hover {
    color: var(--white);
    background: rgba(255,255,255,.1);
    border-color: var(--accent1);
  }

  /* Stack hero on mobile */
  .hero-grid {
    grid-template-columns: 1fr;
  }

  /* Body scroll lock when menu is open */
  body.menu-open {
    overflow: hidden;
  }

  /* Hamburger animation */
  .hamburger svg {
    transition: all 0.3s ease;
  }

  .hamburger.active svg {
    transform: rotate(90deg);
  }
}

/* Extra Small Mobile - Adjustments for the open menu */
@media (max-width: 480px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .nav-items.mobile-open {
    padding: 8px;
    gap: 12px;
  }

  .nav-items.mobile-open .menu a {
    padding: 10px 14px;
    font-size: 14px;
  }

  .nav-items.mobile-open .search {
    max-width: 250px;
  }

  .nav-items.mobile-open .actions .btn {
    padding: 14px 20px;
    font-size: 14px;
    max-width: 260px;
    min-height: 48px;
    border-radius: 16px;
  }

  .nav-items.mobile-open .actions .btn-primary {
    background: linear-gradient(135deg, #00e5ff, #00ffa3);
    color: #06171b;
    box-shadow: 0 6px 20px rgba(0,229,255,.25);
  }

  .nav-items.mobile-open .actions .btn-ghost {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    color: #eaf5f7;
  }
}

/* Fancy animated gradient ring behind logo */
.logo-wrap {
  position: relative;
}

.logo-wrap::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 20px;
  padding: 2px;
  background: conic-gradient(from 0deg, var(--accent1), var(--accent3), var(--accent2), var(--accent1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin 6s linear infinite;
  opacity: .35;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

/* ===== Mobile Nav Fallback Close (pseudo) ===== */
@media (max-width: 760px) {
  /* Keep hamburger visible */
  .hamburger { display: inline-grid; place-items: center; }

  /* Fallback close if real .mobile-close is not present */
  .nav-items.mobile-open::before {
    content: "✕";
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 24px;
    color: var(--muted);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    transition: all 0.3s ease;
    z-index: 60;
  }
  .nav-items.mobile-open::before:hover {
    color: var(--white);
    background: rgba(255,255,255,.1);
    border-color: var(--accent1);
  }

  /* RTL adjust for pseudo close */
  [dir="rtl"] .nav-items.mobile-open::before { left: 30px; right: auto; }
}

/* ===== Header Layout Improvements (RTL/LTR safe) ===== */
.nav {
  justify-content: flex-start;
}

.nav-items {
  margin-inline-start: auto;
}

/* Keep main axis direction consistent in RTL */
[dir="rtl"] .nav {
  flex-direction: row;
}

/* In RTL put logo to the right, title to the left */
[dir="rtl"] .brand {
  flex-direction: row; /* logo first (right), then text */
}

/* Make custom logo image fit nicely inside the .logo box */
.logo img,
.logo .custom-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* ===== Floating Search Overlay ===== */
.search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  color: var(--text);
  cursor: pointer;
  transition: all .25s ease;
}
.search-toggle:hover {
  background: rgba(255,255,255,.1);
  border-color: var(--accent1);
}

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 23, 27, .72);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 120px 20px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 10000;
}
.search-overlay.open { opacity: 1; pointer-events: auto; }

.search-modal { position: relative; width: 100%; max-width: 720px; }

.overlay-close {
  position: absolute;
  top: -60px;
  right: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--muted);
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  cursor: pointer;
  transition: all .25s ease;
}
.overlay-close:hover { color: var(--white); border-color: var(--accent1); }
[dir="rtl"] .overlay-close { right: auto; left: 0; }

.search-overlay-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  padding: 14px 16px;
  border-radius: 18px;
}
.search-overlay-form input {
  all: unset;
  flex: 1 1 auto;
  font-size: 16px;
  color: var(--text);
}
[dir="rtl"] .search-overlay-form input { text-align: right; }

@media (max-width: 760px) {
  .search-modal { max-width: 92vw; }
  .overlay-close { top: -54px; }
}
