/* تنظیمات پایه */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: sans-serif;
    background: #020617;
    color: #e5e7eb;
    overflow-x: hidden;
}

/* پس‌زمینه ستاره‌ها */
#stars {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at bottom, #020617 0, #000 60%);
}

/* هدر */
header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.logo span {
    font-weight: 700;
    color: #38bdf8;
}

/* ناوبری */
.nav {
    display: flex;
    align-items: center;
}

.nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
}

.nav a {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav a:hover {
    color: #38bdf8;
}

/* دکمه زبان */
#langBtn {
    margin-right: 1rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #38bdf8;
    background: transparent;
    color: #e5e7eb;
    cursor: pointer;
    font-size: 0.8rem;
}

/* دکمه منوی موبایل */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    margin-left: 1rem;
}

.nav-toggle span {
    width: 20px;
    height: 2px;
    background: #e5e7eb;
}

/* قهرمان / hero */
.hero {
    padding: 4rem 1.5rem 3rem;
    text-align: center;
}

.hero h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.hero p {
    max-width: 600px;
    margin: 0.5rem auto 0;
    line-height: 1.7;
}

/* کانتینر زمین و شبیه‌ساز */
#earth-container {
    padding: 2rem 1.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* زمین */
.earth-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.earth {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #4ade80, #0ea5e9 40%, #082f49);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
    animation: spin 20s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* سکشن‌ها */
.section {
    padding: 2.5rem 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.section h2 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.section p {
    line-height: 1.7;
    color: #e5e7eb;
}

/* گرید پروژه‌ها */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.project-card {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 1rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.8);
}

.project-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    color: #38bdf8;
}

.project-card p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* شبیه‌ساز مدار */
#orbit-sim {
    width: 100%;
    max-width: 600px;
    margin: 1.5rem auto 0;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    padding: 1rem 1.2rem 1.3rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.8);
}

#orbit-sim h2 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: #38bdf8;
}

#orbitForm {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-row label {
    font-size: 0.8rem;
}

.form-row input {
    padding: 0.25rem 0.4rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: #020617;
    color: #e5e7eb;
    font-size: 0.8rem;
}

#btnSim {
    grid-column: 1 / -1;
    margin-top: 0.3rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(90deg, #22c55e, #38bdf8);
    color: #020617;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
}

#orbitStatus {
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
}

#orbitCanvas {
    display: none;
    margin: 0.5rem auto 0.5rem;
    background: radial-gradient(circle at center, #020617 0, #000 60%);
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.6);
}

#orbitInfo {
    font-size: 0.8rem;
    line-height: 1.6;
}

/* فوتر */
.footer {
    text-align: center;
    padding: 1.5rem 1rem 2rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

/* موبایل */
@media (max-width: 768px) {
    .nav ul {
        position: absolute;
        top: 56px;
        right: 0;
        background: rgba(15, 23, 42, 0.98);
        flex-direction: column;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        display: none;
    }

    .nav ul.open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }
}
/* ✅ ADDED 3D VIEW */
#orbit3d-container {
    width: 100%;
    max-width: 600px;
    margin: 0.5rem auto 1rem;
}

#threeContainer {
    width: 100%;
    height: 400px;
    background: #000;
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
}

/* === Side Navigation === */
.sidenav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  left: 20px; /* change to right:20px for RTL preference */

  background: rgba(10, 15, 30, 0.75);
  backdrop-filter: blur(10px);

  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;

  padding: 12px 10px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);

  z-index: 1000;
}

/* Links */
.sidenav a {
  display: block;
  color: #cbd5f5;
  text-decoration: none;
  font-size: 14px;
  padding: 8px 14px;
  margin: 4px 0;

  border-radius: 8px;
  transition: all 0.25s ease;
  position: relative;
}

/* Hover effect */
.sidenav a:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  transform: translateX(4px);
}

/* Active / selected (optional class) */
.sidenav a.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  box-shadow: inset 0 0 10px rgba(56, 189, 248, 0.2);
}

/* Subtle glow line on hover */
.sidenav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 0%;
  width: 3px;
  background: #38bdf8;
  border-radius: 2px;
  transition: height 0.3s ease;
}

.sidenav a:hover::before {
  height: 70%;
}

/* RTL support (for Persian) */
html[dir="rtl"] .sidenav {
  left: auto;
  right: 20px;
}

html[dir="rtl"] .sidenav a:hover {
  transform: translateX(-4px);
}

html[dir="rtl"] .sidenav a::before {
  left: auto;
  right: 0;
}

/* === Brand / Logo === */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Logo image */
.logo {
  height: 100px;
  width: auto;
  object-fit: contain;

  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5));
  transition: transform 0.3s ease, filter 0.3s ease;
}

/* Logo image */
.logoText {
  height: 42px;
  width: auto;
  object-fit: contain;

  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5));
  transition: transform 0.3s ease, filter 0.3s ease;
}

/* Hover glow effect */
.logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.9));
}

/* Brand text */
.brand-name {
  font-size: 20px;
  font-weight: 500;
  color: #cbd5f5;
  letter-spacing: 1px;
}

/* Optional: hide text on small screens */
@media (max-width: 600px) {
  .brand-name {
    display: none;
  }
}

/* .brand {
  position: absolute;
  top: 20px;
  left: 30px;
  z-index: 1000;
}

html[dir="rtl"] .brand {
  left: auto;
  right: 30px;
} */