@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght@300;400;500&display=swap");

:root {
  color-scheme: dark;
  --bg: #05010a;
  --card: rgba(15, 10, 30, 0.75);
  --card-strong: rgba(21, 14, 40, 0.9);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f7f4ff;
  --muted: rgba(255, 255, 255, 0.7);
  --accent: #a855f7;
  --accent-2: #f97316;
  --accent-3: #0ea5e9;
  --yellow-muted: rgba(234, 179, 8, 0.4);
  --yellow-glow: rgba(234, 179, 8, 0.2);
  --yellow-bright: #fbbf24;
  --radius: 28px; /* نرم‌تر کردن گوشه‌ها */
  --blur: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: "IRANSans", "Vazirmatn", "Space Grotesk", sans-serif;
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(248, 113, 113, 0.18), transparent),
    radial-gradient(circle at 80% 0%, rgba(129, 140, 248, 0.25), transparent),
    radial-gradient(circle at 60% 80%, rgba(16, 185, 129, 0.2), transparent),
    radial-gradient(circle at 50% 50%, var(--yellow-muted), transparent 60%),
    var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.8;
  overflow-x: hidden;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  color: var(--muted);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 8px);
}

.theme-body {
  position: relative;
  padding: 0 5vw 10vh;
}

.glow-layer {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 10% 20%, rgba(248, 113, 113, 0.12), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(129, 140, 248, 0.12), transparent 50%);
  filter: blur(120px);
  pointer-events: none;
  z-index: -1;
}

.site-header {
  position: sticky;
  top: 1rem; /* فاصله از بالا برای حالت شناور */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem; /* پدینگ داخلی برای فاصله محتوا از لبه‌ها */
  backdrop-filter: blur(12px);
  background: rgba(5, 1, 10, 0.75); /* کمی تیره‌تر برای خوانایی بهتر */
  z-index: 100; /* افزایش z-index */
  border-radius: 50px; /* گرد کردن کامل گوشه‌ها (حالت کپسولی) */
  border: 1px solid var(--border); /* اضافه کردن بوردر */
  margin-bottom: 2rem; /* فاصله از محتوای پایین */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); /* سایه برای جدا شدن از پس‌زمینه */
  transition: all 0.3s ease;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1rem;
}

.logo-mark .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent);
}

.main-nav {
  display: flex;
  gap: 1.2rem;
}

.main-nav.open {
  display: flex;
}

.main-nav a {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  transition: background 0.3s ease;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.auth-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.6rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.btn.cta {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 15px 35px rgba(168, 85, 247, 0.25);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.full {
  width: 100%;
  text-align: center;
}

.btn-yellow {
  background: linear-gradient(135deg, var(--yellow-bright), var(--yellow-muted));
  color: var(--bg);
  box-shadow: 0 8px 20px var(--yellow-glow);
}

.btn-yellow:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px var(--yellow-bright), 0 0 40px var(--yellow-glow);
  animation: yellowShimmer 1.5s infinite;
}

.btn:hover {
  transform: translateY(-2px);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
}

.hero-card,
.hero-visual {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3rem;
  font-size: 0.75rem;
  color: var(--accent-3);
}

.hero-card h1 {
  font-size: clamp(2.6rem, 4vw, 3.8rem);
  margin: 0.8rem 0;
  font-weight: 700;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
}

.hero-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--muted);
}

.hero-visual {
  display: grid;
  gap: 1.4rem;
  background: radial-gradient(circle at 30% 10%, rgba(248, 113, 113, 0.15), transparent),
    var(--card-strong);
}

.orb {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  filter: blur(5px);
}

.orb-one {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.9), transparent);
}

.orb-two {
  background: radial-gradient(circle, rgba(14, 165, 233, 0.8), transparent);
  margin-left: auto;
}

.floating-card {
  background: rgba(9, 9, 22, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
}

.chip-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.chip-row span,
.chip {
  border-radius: 999px;
  padding: 0.2rem 0.9rem;
  border: 1px solid var(--border);
  font-size: 0.8rem;
}

.metric-stack {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.metric {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  min-width: 140px;
}

[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.metric strong {
  display: block;
  font-size: 1.8rem;
  color: var(--accent);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 4rem 0 1.5rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 700;
}

.spotlight-grid,
.cards-grid,
.blog-grid {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.spotlight-card,
.course-card,
.blog-card,
.contact-card,
.contact-form form,
.auth-card,
.page-hero,
.page-section,
.article-page,
.course-page {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  backdrop-filter: blur(var(--blur));
}

.spotlight-card {
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--accent);
}

.spotlight-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, transparent, rgba(255, 255, 255, 0.05));
}

.spotlight-card h3 {
  margin-top: 0;
  color: var(--accent);
  font-weight: 600;
}

.resume-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
}

.timeline {
  position: relative;
  padding-right: 1rem;
}

.timeline::before {
  content: "";
  position: absolute;
  right: 0.8rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--accent), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-right: 1.2rem;
}

.timeline-dot {
  position: absolute;
  right: -0.3rem;
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
}

.timeline-card {
  background: rgba(255, 255, 255, 0.02);
  border-radius: calc(var(--radius) - 8px);
  border: 1px solid var(--border);
  padding: 1.3rem;
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

.skills-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.skill-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.skill {
  padding: 1rem;
  border-radius: calc(var(--radius) - 8px);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.skill .level {
  font-size: 1.4rem;
  color: var(--accent-2);
}

.recognitions .badge {
  display: block;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.7rem;
}

.courses-section ul {
  padding: 0;
  list-style: none;
}

.course-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  border-top: 3px solid var(--accent);
}

.course-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blog-card {
  border-top: 3px solid rgba(255, 255, 255, 0.1);
}

.tag-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--accent-3);
}

.contact-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 4rem 0;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.form-grid textarea {
  grid-column: 1 / -1;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-form input,
.contact-form textarea,
.auth-card input,
.auth-card textarea,
.filter-bar input,
.filter-bar select {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-family: inherit;
  margin-bottom: 1rem;
}

.contact-form textarea {
  min-height: 150px;
}

.filter-bar form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.blog-grid.archive {
  margin-bottom: 2rem;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  align-items: center;
}

.pagination a {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.auth-card {
  max-width: 450px;
  margin: 4rem auto;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.article-hero,
.course-hero {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  background: rgba(10, 8, 22, 0.8);
  border-top: 3px solid var(--accent);
}

.article-content,
.course-content {
  margin-top: 2rem;
  line-height: 1.9;
}

.course-video {
  margin-top: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.course-video iframe {
  width: 100%;
  min-height: 360px;
}

.article-content h2,
.article-content h3,
.course-content h2 {
  color: white;
  margin-top: 2rem;
  font-weight: 600;
}

.article-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}

.related-section {
  margin: 4rem 0;
}

.site-footer {
  margin-top: 5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.flash-messages {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
}

.flash {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: white;
}

@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .main-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .resume-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main-nav {
    display: none;
    flex-direction: column;
    width: 100%;
  }

  .main-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }
  .theme-body {
    padding: 0 1rem 6rem;
  }

  .hero-card,
  .hero-visual {
    padding: 1.6rem;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* انیمیشن ستاره‌ای ونگوگ - متحرک */
.starry-night-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.star {
  position: absolute;
  background: var(--yellow-bright);
  border-radius: 50%;
  animation: twinkle 3s infinite ease-in-out;
  box-shadow: 0 0 6px var(--yellow-glow), 0 0 12px var(--yellow-glow);
}

.star::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, var(--yellow-bright) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse 2s infinite ease-in-out;
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.8;
  }
}

/* انیمیشن نقاشی ونگوگ - چرخش و حرکت */
.van-gogh-brush {
  position: absolute;
  width: 4px;
  height: 40px;
  background: linear-gradient(to bottom, var(--yellow-bright), var(--yellow-muted));
  border-radius: 2px;
  opacity: 0.6;
  animation: brushStroke 4s infinite ease-in-out;
  transform-origin: center;
}

@keyframes brushStroke {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.3;
  }
  25% {
    transform: translateY(-20px) rotate(15deg);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-40px) rotate(-10deg);
    opacity: 0.8;
  }
  75% {
    transform: translateY(-20px) rotate(5deg);
    opacity: 0.6;
  }
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.3;
  }
}

/* انیمیشن‌های متحرک برای المان‌ها */
.animated-element {
  animation: float 6s infinite ease-in-out;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-10px) rotate(2deg);
  }
  66% {
    transform: translateY(-5px) rotate(-2deg);
  }
}

/* انیمیشن درخشش زرد */
.yellow-glow {
  position: relative;
}

.yellow-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: radial-gradient(circle, var(--yellow-glow), transparent 70%);
  border-radius: inherit;
  opacity: 0;
  animation: glowPulse 3s infinite ease-in-out;
  z-index: -1;
}

@keyframes glowPulse {
  0%, 100% {
    opacity: 0;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

/* بهبود RTL برای همه المان‌ها */
html[dir="rtl"] * {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .main-nav,
html[dir="rtl"] .footer-links,
html[dir="rtl"] .socials,
html[dir="rtl"] .hero-cta,
html[dir="rtl"] .auth-actions {
  direction: rtl;
  flex-direction: row;
}

html[dir="rtl"] .form-grid {
  direction: rtl;
}

[dir="ltr"] {
  direction: ltr;
  text-align: left;
}

/* انیمیشن ورود برای کارت‌ها */
.card-animate {
  animation: slideInRTL 0.6s ease-out;
}

@keyframes slideInRTL {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* انیمیشن hover برای دکمه‌ها با رنگ زرد */
.btn-yellow {
  background: linear-gradient(135deg, var(--yellow-bright), var(--yellow-muted));
  color: var(--bg);
  transition: all 0.3s ease;
}

.btn-yellow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--yellow-glow);
  animation: yellowShimmer 1.5s infinite;
}

@keyframes yellowShimmer {
  0%, 100% {
    box-shadow: 0 8px 20px var(--yellow-glow);
  }
  50% {
    box-shadow: 0 8px 30px var(--yellow-bright), 0 0 40px var(--yellow-glow);
  }
}
