/* =============================
   Global Variables & Reset
============================= */
:root {
  --color-primary: #007bff;
  --color-secondary: #0a2a43;
  --color-accent: #00bfff;
  --bg-light: #f9f9fb;
  --text-dark: #222;
  --radius: 10px;
  --transition: all 0.3s ease;
  --shadow: 0 4px 15px rgba(0,0,0,0.1);
  font-family: 'Vazirmatn', sans-serif;
}

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

body {
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.7;
  min-height: 100vh;
}


/* =============================
   Auth Pages (Login/Register)
============================= */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.register-container {
  background: #fff;
  padding: 2rem 2.5rem;
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: fadeIn 0.4s ease;
}

h1 {
  text-align: center;
  color: var(--color-secondary);
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
}

.input-group {
  margin-bottom: 1rem;
}
.input-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.3rem;
}
.input-group input {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ccd1e4;
  border-radius: var(--radius);
  transition: 0.3s;
}
.input-group input:focus {
  border-color: var(--color-primary);
  outline: none;
}

.checkbox-group {
  margin: 1rem 0;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}
.checkbox-group input {
  margin-right: 0.4rem;
}

.btn-primary {
  width: 100%;
  background: var(--color-secondary);
  color: #fff;
  padding: 0.8rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary:hover {
  background: #142e52;
}

.alert {
  padding: 0.8rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  text-align: center;
}
.alert.error { background: #ffe5e5; color: #b20000; }
.alert.success { background: #e5ffe8; color: #006600; }

.switch-auth {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.switch-auth a {
  color: var(--color-primary);
  text-decoration: none;
}

/* =============================
   Modal (Terms)
============================= */
.modal {
  display: none;
  position: fixed;
  z-index: 10;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: #fff;
  margin: 8% auto;
  padding: 2rem;
  border-radius: var(--radius);
  width: 90%;
  max-width: 550px;
  position: relative;
  animation: fadeIn 0.3s ease;
}

.modal-content .close {
  position: absolute;
  right: 1rem;
  top: 0.8rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-secondary);
}

/* 🎓 دوره‌ها */.courses-wrapper {
  margin-top: 40px;
}

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

.course-card {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, box-shadow 0.3s;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.course-thumb {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.course-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale 0.4s;
}

.course-card:hover .course-thumb img {
  scale: 1.05;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #222;
  color: #fff;
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.badge.free {
  background: #00c853;
}
.badge.paid {
  background: #ff9800;
}

.course-body {
  padding: 16px 18px;
  flex-grow: 1;
}

.course-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-color, #222);
}

.course-body .desc {
  font-size: 0.9rem;
  color: var(--text-muted, #666);
  line-height: 1.5;
  margin-bottom: 12px;
}

.course-body .meta {
  font-size: 0.85rem;
  color: var(--text-muted, #777);
  display: flex;
  justify-content: space-between;
}

.course-footer {
  padding: 12px 18px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.btn-primary,
.btn-outline,
.btn-secondary {
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: #1976d2;
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: #1565c0;
}

.btn-outline {
  border: 1px solid #1976d2;
  color: #1976d2;
  background: transparent;
}

.btn-outline:hover {
  background: #1976d2;
  color: #fff;
}

.btn-secondary {
  background: #9e9e9e;
  color: #fff;
  border: none;
}

.pagination {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  gap: 10px;
}

.pagination .page {
  background: #f2f2f2;
  padding: 8px 14px;
  border-radius: 6px;
  color: #333;
  text-decoration: none;
  transition: background 0.2s;
}

.pagination .page:hover {
  background: #1976d2;
  color: #fff;
}

.pagination .page.active {
  background: #1976d2;
  color: #fff;
}

/* 🌙 حالت تیره */
body.dark .course-card {
  background: #1f1f1f;
}
body.dark .course-body h3 {
  color: #fff;
}
body.dark .course-body .desc,
body.dark .course-body .meta {
  color: #bbb;
}
body.dark .pagination .page {
  background: #333;
  color: #ccc;
}
body.dark .pagination .page.active {
  background: #1976d2;
  color: #fff;
}

/* ===== صفحه جزئیات دوره ===== */
.course-detail-page {
  background: var(--bg, #fafafa);
  color: var(--text, #222);
}

.course-hero {
  position: relative;
  height: 320px;
  overflow: hidden;
  border-radius: 0 0 16px 16px;
}

.course-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(70%);
}

.course-hero .overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

.course-hero .hero-content {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  color: #fff;
  text-align: center;
}

.course-hero h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.course-hero .subtitle {
  font-size: 1rem;
  color: #e0e0e0;
  margin-bottom: 10px;
}

.course-hero .meta span {
  margin: 0 10px;
  font-size: 0.9rem;
  color: #ddd;
}

/* محتوا */
.course-main {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  padding: 40px 8%;
}

.course-content {
  flex: 2;
  min-width: 60%;
}

.course-content h2 {
  margin-top: 30px;
  font-size: 1.3rem;
  border-bottom: 2px solid #1976d2;
  display: inline-block;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.course-content p {
  line-height: 1.8;
  font-size: 1rem;
  color: var(--text-muted, #555);
}

.section {
  background: var(--card-bg, #fff);
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* سایدبار */
.course-sidebar {
  flex: 1;
  min-width: 260px;
}

.sidebar-box {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.sidebar-box h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.sidebar-box .price {
  font-size: 1.4rem;
  font-weight: bold;
  color: #1976d2;
  margin-bottom: 20px;
}

.sidebar-box .price .free {
  color: #00c853;
}

.course-info {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

.course-info li {
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text-muted, #666);
}

/* دوره‌های مشابه */
.related-courses {
  margin: 50px 8%;
}

.related-courses h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
  border-bottom: 2px solid #1976d2;
  display: inline-block;
}

.course-card.small {
  text-align: center;
  padding: 10px;
  background: var(--card-bg, #fff);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.course-card.small img {
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 10px;
}

/* حالت تیره */
body.dark .course-hero img {
  filter: brightness(60%);
}
body.dark .course-content p,
body.dark .course-info li {
  color: #ccc;
}
/* =============================
   Animations
============================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

