/* صفحات قديمة — مربوطة بنظام التصميم الموحّد */
@import url("brand-tokens.css");

:root {
  --bg: var(--h-bg);
  --card: var(--h-surface);
  --gold: var(--h-gold);
  --text: var(--h-text);
  --muted: var(--h-muted);
  --border: var(--h-line);
  --header-bg: var(--h-nav);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--h-font);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(179, 147, 89, 0.1), transparent 55%),
    radial-gradient(ellipse 60% 40% at -5% 100%, rgba(56, 184, 181, 0.05), transparent 50%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(196, 164, 106, 0.06), transparent 55%),
    radial-gradient(ellipse 60% 40% at -5% 100%, rgba(56, 184, 181, 0.04), transparent 50%),
    var(--bg);
}

:focus-visible {
  outline: var(--h-focus);
  outline-offset: var(--h-focus-offset);
}

.skip-link {
  position: absolute;
  top: -100px;
  right: 1rem;
  z-index: 10000;
  background: var(--gold);
  color: #1a140c;
  padding: 0.65rem 1rem;
  border-radius: var(--h-radius-sm);
  font-weight: 700;
  text-decoration: none;
  min-height: var(--h-touch);
  display: inline-flex;
  align-items: center;
}
.skip-link:focus { top: 1rem; }

header {
  padding: 25px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-group {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 700;
  transition: color 0.3s;
  min-height: var(--h-touch);
  display: inline-flex;
  align-items: center;
}

.nav-link:hover, .nav-link.active {
  color: var(--gold);
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  cursor: pointer;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dropdown-content {
  display: block;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  position: absolute;
  background-color: var(--card);
  border: 1px solid var(--border);
  min-width: 180px;
  box-shadow: var(--h-shadow);
  z-index: 1;
  border-radius: var(--h-radius-sm);
  padding: 8px 0;
  margin-top: 10px;
  left: 50%;
  transform: translateX(-50%);
}

.dropdown-content a {
  color: var(--muted);
  padding: 10px 20px;
  text-decoration: none;
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  transition: 0.2s;
  white-space: nowrap;
}

.dropdown-content a:hover {
  background-color: rgba(179, 147, 89, 0.1);
  color: var(--gold);
}

.dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
}

.lbl {
  font-size: 0.6rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 15px;
  display: block;
}

.title {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
}

.tv-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border: 3px solid rgba(179, 147, 89, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 0;
}
@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

#logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--h-display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
#logo::before {
  content: "";
  width: 2.15rem;
  height: 2.15rem;
  flex: 0 0 2.15rem;
  border-radius: 0.55rem;
  background: var(--text) url("/favicon.svg") center / contain no-repeat;
  box-shadow: 0 0 0 1px rgba(179, 147, 89, 0.35);
}
.logo-highlight { color: var(--gold); }
.text-gold { color: var(--gold); }
.text-blue { color: #38bdf8; }
.text-green { color: #34d399; }
.text-red { color: #ef4444; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

#nav-builder { color: var(--gold); }
.advisor-back-btn {
  text-decoration: none;
  border-color: #38bdf8;
  color: #38bdf8;
}
.builder-back-btn { text-decoration: none; }
