/* ===============================
   فونت و تنظیمات پایه
=============================== */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn.woff2") format("woff2"),
       url("../fonts/Vazirmatn.woff") format("woff");
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Vazirmatn", sans-serif;
  direction: rtl;
  background-color: #f6f8fb;
  color: #1f2937;
  line-height: 1.8;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ===============================
   کانتینر
=============================== */
.container {
  width: min(1200px, 90%);
  margin: 0 auto;
}

/* ===============================
   هدر
=============================== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ffffffd9;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 3px 20px rgba(0, 0, 0, 0.05);
  width: 100%;
}

.container.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  position: relative;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: #111827;
  cursor: pointer;
}

.header nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.header nav a {
  font-weight: 600;
  font-size: 1rem;
  color: #374151;
  position: relative;
  transition: all 0.3s ease;
  padding-bottom: 2px;
}

.header nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  transition: width 0.3s ease;
}

.header nav a:hover {
  color: #0f172a;
}

.header nav a:hover::after {
  width: 100%;
}

.menu-btn {
  display: none;
  border: none;
  background: none;
  font-size: 2rem;
  color: #111827;
  cursor: pointer;
  transition: color 0.3s ease;
}

.menu-btn:hover {
  color: #2563eb;
}

/* ===============================
   Hero Section for Courses Page
=============================== */
.hero {
  background: linear-gradient(180deg, #ffffff, #f3f4f6);
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: #111827;
  font-weight: 900;
}

.hero p {
  font-size: 1.1rem;
  color: #4b5563;
  margin-top: 10px; /* Added margin as per HTML */
}

/* Override padding for this specific hero on courses page */
.hero[style*="padding:60px 0;"] {
  padding: 60px 0;
}


/* ===============================
   Courses Grid
=============================== */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Default for large screens */
  gap: 25px;
  padding: 80px 0; /* Added padding as per HTML */
}

.course-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 28px 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 240px; /* Ensures cards have a minimum height */
}

.course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

.course-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 12px;
}

.course-card p {
  color: #4b5563;
  font-size: 0.98rem;
  margin-bottom: 22px;
  flex: 1; /* Allows paragraph to take available space */
}

/* Re-using btn-primary style from main page */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(37, 99, 235, 0.25);
  width: fit-content; /* Button only takes necessary width */
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.35);
}

/* ===============================
   CTA Section
=============================== */
.cta {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  padding: 80px 0;
  text-align: center;
  margin-top: 40px; /* Added margin as per HTML */
}

.cta h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 900;
  margin-bottom: 10px;
}

.cta p {
  color: rgba(255, 255, 255, 0.9);
  margin: 15px 0; /* Added margin as per HTML */
}

.cta .btn-primary {
  background: white;
  color: #2563eb;
  box-shadow: 0 10px 20px rgba(255, 255, 255, 0.18);
}

.cta .btn-primary:hover {
  background: #f9fafb;
  transform: translateY(-2px);
}

/* ===============================
   Footer
=============================== */
.footer {
  background: #0f172a;
  color: #cbd5e1;
  text-align: center;
  padding: 25px 0;
  font-size: 0.95rem;
}

/* ===============================
   Responsive Adjustments
=============================== */
@media (max-width: 1024px) {
  .courses-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .header nav {
    display: none; /* Initially hidden */
    position: absolute;
    top: 70px; /* Position below header */
    right: 0;
    left: 0;
    flex-direction: column;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    border-radius: 0 0 14px 14px;
    z-index: 1000;
  }

  .header nav.active {
    display: flex; /* Show when menu-btn is clicked */
  }

  .header nav a {
    padding: 12px 0;
    text-align: center;
  }

  .menu-btn {
    display: block; /* Show hamburger icon */
  }

  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    padding: 50px 0 !important; /* Adjust hero padding for smaller screens */
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.4rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }
  .hero p {
    font-size: 0.95rem;
  }

  .courses-grid {
    grid-template-columns: 1fr; /* Single column on very small screens */
  }

  .course-card {
    padding: 22px 18px;
  }

  .cta {
    padding: 60px 0;
  }
  .cta h2 {
    font-size: 1.8rem;
  }
}

