/* ===== پایه و کلیات ===== */
body {
  font-family: 'Vazirmatn', sans-serif;
  margin: 0;
  background: linear-gradient(135deg, #f0f4ff, #ffffff);
  color: #222;
  transition: all 0.3s ease-in-out;
}

.dark-mode {
  background: linear-gradient(135deg, #0e0e0e, #1e1e1e);
  color: #eee;
}

/* ===== نوار بالا (Navbar) ===== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  padding: 12px 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 999;
}

.dark-mode .navbar {
  background: rgba(30, 30, 30, 0.9);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
}

.nav-links a {
  color: #333;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.dark-mode .nav-links a {
  color: #ddd;
}

.nav-links a:hover {
  color: #007bff;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #333;
}

.dark-mode .theme-toggle {
  color: #ddd;
}

/* ===== محتوای اصلی ===== */
.container {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

.avatar img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border: 4px solid #fff;
}

.subtitle {
  font-size: 16px;
  color: #555;
  margin-top: 15px;
  line-height: 1.8;
}

.dark-mode .subtitle {
  color: #ccc;
}

/* ===== باکس عمومی ===== */
section {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 25px 30px;
  margin-bottom: 25px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

section:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.dark-mode section {
  background: rgba(30, 30, 30, 0.85);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

/* ===== عنوان هر بخش ===== */
section h2 {
  color: #007bff;
  border-right: 5px solid #007bff;
  padding-right: 12px;
  margin-bottom: 15px;
  font-size: 20px;
}

.dark-mode section h2 {
  color: #61dafb;
  border-color: #61dafb;
}

/* ===== درباره من ===== */
.about p {
  text-align: justify;
  line-height: 2;
  color: #333;
}

.dark-mode .about p {
  color: #ccc;
}

/* ===== تماس با من ===== */
.contact ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact li {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact a {
  color: #007bff;
  text-decoration: none;
}

.contact a:hover {
  text-decoration: underline;
}

.dark-mode .contact a {
  color: #61dafb;
}

/* ===== مهارت‌ها ===== */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
}

.skill-card {
  background: linear-gradient(135deg, #e0eaff, #ffffff);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-5px);
}

.skill-card i {
  font-size: 28px;
  color: #007bff;
  margin-bottom: 10px;
}

.skill-card span {
  display: block;
  font-weight: 600;
  color: #333;
}

.dark-mode .skill-card {
  background: linear-gradient(135deg, #1f2937, #111827);
}

.dark-mode .skill-card i {
  color: #61dafb;
}

.dark-mode .skill-card span {
  color: #ddd;
}

/* ===== ویجت آمار بازدید ===== */
.visit-widget {
  position: fixed;
  bottom: 25px;
  left: 25px;
  background: #007bff;
  color: white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
  transition: all 0.3s ease;
}

.visit-widget:hover {
  transform: scale(1.1);
}

.dark-mode .visit-widget {
  background: #61dafb;
  color: #000;
}

.visit-stats {
  position: fixed;
  bottom: 90px;
  left: 25px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  width: 250px;
  display: none;
  z-index: 999;
}

.visit-stats.active {
  display: block;
  animation: fadeInUp 0.4s ease;
}

.dark-mode .visit-stats {
  background: rgba(20, 20, 20, 0.95);
  color: #ddd;
}

.visit-stats ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.visit-stats li {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== فوتر ===== */
footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
  color: #666;
  font-size: 14px;
}

.dark-mode footer {
  color: #aaa;
}

/* ===== انیمیشن‌ها ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== واکنش‌گرا ===== */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 10px;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  .container {
    padding: 10px;
  }
  section {
    padding: 20px;
  }
}

/* دکمه منوی موبایل */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 25px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 3px;
  background: #333;
  border-radius: 2px;
}

.dark-mode .menu-toggle span {
  background: #ddd;
}

/* حالت کشویی موبایل */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    position: absolute;
    top: 60px;
    left: 0;
    padding: 10px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(0,0,0,0.1);
    z-index: 999;
  }

  .nav-links.active {
    display: flex;
    animation: fadeInUp 0.3s ease;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
    margin: 5px 0;
  }

  .navbar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    position: relative;
  }

  .menu-toggle {
    display: flex;
  }
}

/* ===== انیمیشن دکمه منوی موبایل ===== */
.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.menu-toggle span {
  transition: all 0.3s ease;
}

/* ===== دکمه منوی موبایل ===== */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 25px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 3px;
  background: #333;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.dark-mode .menu-toggle span {
  background: #ddd;
}

/* حالت کشویی موبایل */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    position: absolute;
    top: 60px;
    left: 0;
    padding: 10px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(0,0,0,0.1);
    z-index: 999;
  }

  .nav-links.active {
    display: flex;
    animation: fadeInUp 0.3s ease;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
    margin: 5px 0;
  }

  .menu-toggle {
    display: flex;
  }
}

/* ===== انیمیشن چرخش منوی موبایل ===== */
.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.menu-toggle span {
  transition: all 0.3s ease;
}


/* ===== تنظیم اندازه لوگو ===== */
.logo-img {
  width: 120px;       /* عرض استاندارد لوگو */
  height: auto;       /* حفظ نسبت تصویر */
  display: block;
  object-fit: contain; /* جلوگیری از کشیدگی تصویر */
}

/* ===== واکنش‌گرایی لوگو ===== */
@media (max-width: 1024px) {
  .logo-img {
    width: 100px;
  }
}

@media (max-width: 768px) {
  .logo-img {
    width: 80px;       /* اندازه کوچکتر روی موبایل */
  }
}

@media (max-width: 480px) {
  .logo-img {
    width: 60px;       /* اندازه بسیار کوچک روی موبایل کوچک */
  }
}


/* ===== تنظیم اندازه لوگو ===== */
.logo-img {
  width: 120px;       /* عرض استاندارد لوگو */
  height: auto;       /* حفظ نسبت تصویر */
  display: block;
  object-fit: contain; /* جلوگیری از کشیدگی تصویر */
}

/* ===== واکنش‌گرایی لوگو ===== */
@media (max-width: 1024px) {
  .logo-img {
    width: 100px;
  }
}

@media (max-width: 768px) {
  .logo-img {
    width: 80px;       /* اندازه کوچکتر روی موبایل */
  }
}

@media (max-width: 480px) {
  .logo-img {
    width: 60px;       /* اندازه بسیار کوچک روی موبایل کوچک */
  }
}
