/* ========== ROOT VARIABLES ========== */
:root {
  --bg-primary: #0d0d1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --accent: #00d4ff;
  --accent-warm: #ff6b35;
  --text-primary: #e0e0f0;
  --text-secondary: #9090b0;
  --text-muted: #606080;
  --border: #2a2a4a;
  --nav-height: 70px;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(0, 212, 255, 0.08);
}

[data-theme="light"] {
  --bg-primary: #f0f4f8;
  --bg-secondary: #e2e8f0;
  --bg-card: #ffffff;
  --accent: #0077aa;
  --accent-warm: #e05a20;
  --text-primary: #1a1a2e;
  --text-secondary: #444466;
  --text-muted: #888aaa;
  --border: #c8d0e0;
  --shadow: 0 4px 20px rgba(0, 119, 170, 0.1);
}

/* ========== FONT: Thmanyah Sans — خط ثمانية (ترخيص رسمي مجاني) ========== */
@font-face { font-family: 'ThmanyahSans'; src: url('../fonts/thmanyahsans-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'ThmanyahSans'; src: url('../fonts/thmanyahsans-Medium.woff2')  format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'ThmanyahSans'; src: url('../fonts/thmanyahsans-Bold.woff2')    format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'ThmanyahSans'; src: url('../fonts/thmanyahsans-Black.woff2')   format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }

/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'ThmanyahSans', 'Segoe UI', 'Arial', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
}

body[dir="rtl"] { font-family: 'ThmanyahSans', 'Segoe UI', 'Tahoma', 'Arial', sans-serif; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ========== NAVBAR ========== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(13, 13, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1.5rem;
  transition: background 0.3s;
}

[data-theme="light"] .navbar {
  background: rgba(240, 244, 248, 0.92);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.navbar-brand .callsign-badge {
  background: var(--accent);
  color: var(--bg-primary);
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  flex: 1;
}

[dir="rtl"] .nav-links { margin-right: auto; }
[dir="ltr"] .nav-links { margin-left: auto; }

.nav-links a {
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1.4rem;
  padding: 0.25rem;
}

/* ========== MOBILE NAV ========== */
@media (max-width: 768px) {
  .hamburger { display: block; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 0.25rem;
    margin: 0;
  }

  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.65rem 1rem; }
}

/* ========== MAIN CONTENT ========== */
main { padding-top: var(--nav-height); }

.section {
  padding: 5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-sm { padding: 3rem 2rem; }

/* ========== HERO ========== */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(0, 212, 255, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 20%, rgba(255, 107, 53, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content { position: relative; max-width: 700px; }

.hero-badge {
  display: inline-block;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: var(--accent);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--accent);
  text-shadow: 0 0 40px rgba(0, 212, 255, 0.3);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 500px;
  margin-inline: auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.25rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--bg-primary);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background: rgba(0, 212, 255, 0.1);
  transform: translateY(-2px);
  text-decoration: none;
}

/* ========== CARDS ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ========== SECTION HEADER ========== */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.section-line {
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 0.75rem auto;
  border-radius: 2px;
}

/* ========== GRID ========== */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* ========== RADIO SIGNAL ANIMATION ========== */
.signal-rings {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 2rem;
}

.signal-rings::before,
.signal-rings::after {
  content: '';
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: signal-pulse 2s ease-out infinite;
}

.signal-rings::before {
  width: 100%; height: 100%;
  animation-delay: 0s;
}

.signal-rings::after {
  width: 140%; height: 140%;
  animation-delay: 0.5s;
}

.signal-dot {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--accent);
}

@keyframes signal-pulse {
  0% { opacity: 0.8; transform: scale(0.5); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* ========== ABOUT PAGE ========== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
}

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

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  margin: 0 auto 1rem;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  overflow: hidden;
}

.profile-callsign {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 2px;
}

.profile-name {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 1rem;
}

.badge {
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.25);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.info-list { list-style: none; text-align: start; margin-top: 1rem; }
.info-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.info-list li:last-child { border-bottom: none; }
.info-list .label { color: var(--text-muted); font-size: 0.8rem; min-width: 80px; }

.about-section { margin-bottom: 2.5rem; }
.about-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.equipment-list { list-style: none; }
.equipment-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.equipment-list li::before { content: '▸'; color: var(--accent); }

/* ========== LOGBOOK ========== */
.logbook-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  cursor: pointer;
}

.filter-select:focus { outline: none; border-color: var(--accent); }

.logbook-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.logbook-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.logbook-table th {
  background: var(--bg-secondary);
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  text-align: start;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.logbook-table td {
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.logbook-table tr:hover td { background: rgba(0, 212, 255, 0.04); }

.logbook-table .callsign-cell {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
}

.mode-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.mode-ssb { background: rgba(0, 212, 255, 0.15); color: var(--accent); }
.mode-cw  { background: rgba(255, 107, 53, 0.15); color: var(--accent-warm); }
.mode-ft8 { background: rgba(100, 255, 100, 0.15); color: #6f6; }
.mode-am  { background: rgba(200, 200, 0, 0.15); color: #dd0; }

.logbook-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.page-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.page-btn:hover, .page-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 255, 0.08);
}

/* ========== GALLERY ========== */
.gallery-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  aspect-ratio: 4/3;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-item:hover img,
.gallery-item:hover video { transform: scale(1.05); }

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.gallery-item:hover .gallery-overlay { opacity: 1; }

.gallery-caption {
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
}

.gallery-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
  gap: 0.5rem;
  position: absolute;
  inset: 0;
  transition: transform 0.3s;
}

.gallery-item:hover .gallery-placeholder { transform: scale(1.04); }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox.open { display: flex; }

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

/* ========== DOCUMENTS ========== */
.doc-categories {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.doc-list { display: flex; flex-direction: column; gap: 0.75rem; }

.doc-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text-primary);
}

.doc-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateX(4px);
  text-decoration: none;
  color: var(--text-primary);
}

[dir="rtl"] .doc-item:hover { transform: translateX(-4px); }

.doc-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 48px;
  text-align: center;
}

.doc-info { flex: 1; }

.doc-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.doc-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.doc-download {
  color: var(--accent);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ========== FOOTER ========== */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
}

.footer-inner {
  max-width: 700px;
  margin: 0 auto;
}

.footer-callsign {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.2s;
  text-decoration: none;
}

.footer-links a:hover { color: var(--accent); }

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

/* ========== UTILITY ========== */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
  .section { padding: 3rem 1.25rem; }
  .hero { padding: 3rem 1.25rem; }
  .hero-stats { gap: 1.25rem; }
  .about-grid { grid-template-columns: 1fr; }
  .profile-card { position: static; }
}
