:root {
  --bg: #10141c; --bg-2: #0b0e14; --surface: #171d29; --surface-2: #1e2635;
  --border: #2a3345; --gold: #e7b95b; --gold-soft: rgba(231, 185, 91, .16);
  --teal: #4fada5; --teal-soft: rgba(79, 173, 165, .18);
  --text: #f3efe6; --text-muted: #93a0b4; --error: #e2604f;
  --radius-lg: 22px; --radius-md: 14px; --radius-sm: 10px;
  --shadow-card: 0 30px 80px -30px rgba(0,0,0,.65), 0 2px 0 rgba(255,255,255,.02) inset;
  --ease: cubic-bezier(.22,1,.36,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; background: radial-gradient(120% 140% at 50% -10%, #1a2130 0%, var(--bg) 50%, var(--bg-2) 100%); color: var(--text); font-family: 'Vazirmatn', sans-serif; overflow-x: hidden; scroll-behavior: smooth; }
#constellation { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.eyebrow { color: var(--gold); font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px; display: inline-block; }
.section-block { position: relative; z-index: 2; max-width: 1400px; margin: 0 auto; padding: 100px 40px; }
.section-header { text-align: center; max-width: 600px; margin: 0 auto 60px auto; }
.section-title { font-size: 36px; font-weight: 800; margin: 0 0 16px 0; background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.75) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.section-hint { color: var(--text-muted); font-size: 16px; margin: 0; line-height: 1.6; }
.btn-primary, .btn-ghost { font-family: inherit; font-size: 15px; font-weight: 600; padding: 12px 28px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.3s var(--ease); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn-primary:active, .btn-ghost:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--gold) 0%, #d4a343 100%); color: #0b0e14; border: none; box-shadow: 0 4px 20px rgba(231, 185, 91, 0.2); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(231, 185, 91, 0.35); }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--text-muted); background: rgba(255,255,255,0.03); }
.btn-large { padding: 16px 36px; font-size: 16px; }
.main-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(16, 20, 28, 0.65); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(42, 51, 69, 0.4); }
.header-container { max-width: 1400px; margin: 0 auto; padding: 20px 40px; display: flex; align-items: center; justify-content: space-between; }
.brand-header { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: flex; gap: 4px; }
.brand-node { width: 8px; height: 8px; background: var(--gold); border-radius: 50%; box-shadow: 0 0 12px 2px var(--gold-soft); animation: pulse-node 2.4s var(--ease) infinite; }
.brand-node:nth-child(2) { background: var(--teal); box-shadow: 0 0 12px 2px var(--teal-soft); animation-delay: .3s; }
@keyframes pulse-node { 0%, 100% { opacity: .4; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
.brand-title { font-size: 18px; font-weight: 800; margin: 0; }
.main-nav { display: flex; align-items: center; gap: 8px; background: rgba(23, 29, 41, 0.4); padding: 6px; border-radius: 30px; border: 1px solid rgba(42, 51, 69, 0.5); }
.nav-link { font-family: inherit; background: transparent; border: none; color: var(--text-muted); font-size: 14px; font-weight: 500; padding: 8px 18px; border-radius: 20px; cursor: pointer; transition: all 0.25s var(--ease); }
.nav-link:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.user-name-display { color: var(--gold); font-weight: 600; font-size: 14px; }
.btn-cta-header { font-family: inherit; background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(231, 185, 91, 0.3); padding: 8px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.25s var(--ease); }
.btn-cta-header:hover { background: var(--gold); color: #0b0e14; }
.hero-section { position: relative; z-index: 2; min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 160px 40px 100px 40px; }
.hero-content { max-width: 800px; }
.hero-brand { justify-content: center; margin-bottom: 24px; scale: 1.5; }
.hero-title { font-size: 56px; font-weight: 900; margin: 0 0 24px 0; line-height: 1.2; background: linear-gradient(180deg, #ffffff 0%, #baccde 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { color: var(--text-muted); font-size: 20px; line-height: 1.6; margin: 0 0 48px 0; }
.hero-buttons { display: flex; justify-content: center; gap: 16px; margin-bottom: 64px; }
.hero-stats { display: flex; justify-content: center; gap: 60px; border-top: 1px solid var(--border); padding-top: 40px; }
.stat-number { font-size: 32px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.stat-label { color: var(--text-muted); font-size: 14px; }
.course-tabs { display: flex; justify-content: center; gap: 12px; margin-bottom: 40px; }
.tab-btn { font-family: inherit; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); padding: 10px 24px; border-radius: 20px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.25s var(--ease); }
.tab-btn:hover { color: var(--text); border-color: var(--text-muted); }
.tab-btn.active { background: var(--gold); color: #0b0e14; border-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.auth-notice { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 60px 40px; text-align: center; max-width: 500px; margin: 40px auto; box-shadow: var(--shadow-card); }
.notice-icon { font-size: 48px; margin-bottom: 20px; }
.auth-notice h4 { font-size: 20px; font-weight: 700; margin: 0 0 12px 0; }
.auth-notice p { color: var(--text-muted); font-size: 15px; margin: 0 0 24px 0; line-height: 1.6; }
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px; }
.course-card { position: relative; background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 32px; display: flex; flex-direction: column; transition: all 0.3s var(--ease); cursor: pointer; }
.course-card:hover { transform: translateY(-4px); border-color: rgba(231, 185, 91, 0.3); box-shadow: var(--shadow-card); }
.badge { padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; display: inline-block; align-self: flex-start; margin-bottom: 14px; }
.badge-free { background: var(--teal-soft); color: var(--teal); border: 1px solid rgba(79, 173, 165, .3); }
.badge-paid { background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(231, 185, 91, .3); }
.course-card h4 { font-size: 20px; font-weight: 700; margin: 0 0 14px 0; }
.course-card p { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin: 0 0 0 0; flex-grow: 1; }
.course-thumbnail { width: 100%; height: 180px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid var(--border); }
.syllabus-wrapper { margin-bottom: 20px; }
.syllabus-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--teal); font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.25s var(--ease); }
.syllabus-toggle:hover { background: var(--surface-2); border-color: var(--teal); }
.syllabus-toggle svg { transition: transform 0.3s var(--ease); flex-shrink: 0; margin-right: 8px; }
.syllabus-toggle.is-open svg { transform: rotate(180deg); }
.course-syllabus { list-style: none; padding: 0; margin: 0; max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.4s var(--ease), opacity 0.3s var(--ease); border-top: 0px solid transparent; }
.course-syllabus.is-open { max-height: 500px; opacity: 1; padding-top: 16px; margin-top: 10px; border-top: 1px solid var(--border); }
.course-syllabus li { color: var(--teal); font-size: 13px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.course-syllabus li::before { content: '•'; font-size: 18px; line-height: 0; }
.course-meta { display: flex; justify-content: space-between; align-items: flex-end; border-top: 1px solid var(--border); padding-top: 16px; margin-top: auto; }
.course-schedule { color: var(--text-muted); font-size: 13px; line-height: 1.7; }
.course-price { font-size: 16px; font-weight: 700; color: var(--gold); }
.ai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.ai-card { background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 28px; cursor: pointer; transition: all 0.3s var(--ease); }
.ai-card:hover { background: var(--surface); border-color: rgba(79, 173, 165, 0.4); transform: translateY(-4px); box-shadow: 0 20px 40px -20px rgba(0,0,0,0.5); }
.ai-icon { font-size: 36px; margin-bottom: 16px; }
.ai-card h4 { font-size: 18px; font-weight: 700; margin: 0 0 10px 0; }
.ai-card p { color: var(--text-muted); font-size: 13px; line-height: 1.5; margin: 0 0 20px 0; height: 40px; overflow: hidden; }
.ai-price { font-size: 15px; font-weight: 700; color: var(--teal); }
.modal-overlay { position: fixed; inset: 0; background: rgba(11, 14, 20, 0.85); backdrop-filter: blur(16px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; animation: modalFadeIn 0.3s var(--ease); }
.modal-card { position: relative; width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 40px; box-shadow: var(--shadow-card); animation: modalSlideUp 0.4s var(--ease); }
.close-modal { position: absolute; top: 16px; left: 20px; background: transparent; border: none; color: var(--text-muted); font-size: 28px; cursor: pointer; transition: color 0.2s; line-height: 1; }
.close-modal:hover { color: var(--error); }
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.form-group input { font-family: inherit; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; color: var(--text); font-size: 15px; outline: none; transition: border-color 0.25s, box-shadow 0.25s; }
.form-group input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.form-group input::placeholder { color: rgba(255,255,255,0.15); }
.auth-success { text-align: center; padding: 20px 0; }
.success-icon { width: 64px; height: 64px; background: rgba(79, 173, 165, 0.15); color: var(--teal); font-size: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px auto; }
.auth-success h4 { font-size: 22px; font-weight: 700; margin: 0 0 8px 0; }
.auth-success p { color: var(--text-muted); margin: 0; }
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.main-footer { position: relative; z-index: 2; background: var(--bg-2); border-top: 1px solid var(--border); padding: 80px 40px 30px 40px; }
.footer-content { max-width: 1400px; margin: 0 auto 60px auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-brand h4 { font-size: 18px; font-weight: 800; margin: 16px 0 8px 0; }
.footer-brand p { color: var(--text-muted); font-size: 14px; margin: 0; }
.footer-links h5 { font-size: 15px; font-weight: 700; margin: 0 0 20px 0; color: var(--text); }
.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.footer-links a:hover { color: var(--gold); }
.trust-images { display: flex; gap: 10px; margin-top: 15px; }
.trust-img-box { width: 80px; height: 80px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 11px; text-align: center; padding: 5px; }
.map-container { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.footer-bottom { max-width: 1400px; margin: 0 auto; padding-top: 28px; border-top: 1px solid var(--border); text-align: center; }
.footer-bottom p { color: var(--text-muted); font-size: 14px; margin: 0; }
@media (max-width: 768px) {
  .header-container { flex-wrap: wrap; gap: 16px; padding: 16px 20px; }
  .main-nav { order: 3; width: 100%; justify-content: center; flex-wrap: wrap; }
  .nav-link { padding: 6px 12px; font-size: 13px; }
  .hero-title { font-size: 36px; }
  .hero-subtitle { font-size: 16px; }
  .hero-stats { gap: 30px; flex-wrap: wrap; }
  .footer-content { grid-template-columns: 1fr; gap: 32px; }
  .section-block { padding: 60px 20px; }
  .section-title { font-size: 28px; }
  .courses-grid, .ai-grid { grid-template-columns: 1fr; }
}
/* ============ صفحه جزئیات دوره (course.php) ============ */
.detail-back-bar { position: relative; z-index: 2; max-width: 1400px; margin: 100px auto 0 auto; padding: 0 40px; }
.detail-back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 600; transition: color 0.2s; }
.detail-back-link:hover { color: var(--gold); }
.course-hero { position: relative; z-index: 2; max-width: 1400px; margin: 24px auto 0 auto; border-radius: var(--radius-lg); overflow: hidden; min-height: 380px; display: flex; align-items: flex-end; background-color: var(--surface); background-size: cover; background-position: center; border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.course-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,14,20,.35) 0%, rgba(11,14,20,.75) 65%, var(--bg-2) 100%); }
.course-hero-inner { position: relative; z-index: 2; padding: 60px 48px 40px 48px; width: 100%; }
.course-hero-inner .badge { margin-bottom: 18px; }
.course-hero-title { font-size: 40px; font-weight: 900; margin: 0 0 14px 0; line-height: 1.25; color: #fff; }
.course-hero-desc { color: var(--text-muted); font-size: 16px; line-height: 1.8; max-width: 720px; margin: 0 0 26px 0; }
.course-hero-meta { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; }
.course-hero-meta .course-schedule { color: var(--text-muted); font-size: 14px; line-height: 1.8; }
.course-hero-meta .course-price { font-size: 20px; font-weight: 800; color: var(--gold); }

.lesson-section { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; padding: 80px 40px 100px 40px; }
.lesson-accordion { display: flex; flex-direction: column; gap: 16px; }
.lesson-item { background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: border-color 0.25s var(--ease); }
.lesson-item.is-open { border-color: rgba(79, 173, 165, 0.4); }
.lesson-item-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; cursor: pointer; background: none; border: none; width: 100%; text-align: right; font-family: inherit; }
.lesson-item-title-wrap { display: flex; align-items: center; gap: 14px; }
.lesson-num { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; }
.lesson-item-header h4 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.lesson-item-header svg { color: var(--text-muted); flex-shrink: 0; transition: transform 0.3s var(--ease); }
.lesson-item.is-open .lesson-item-header svg { transform: rotate(180deg); color: var(--teal); }
.lesson-item-body { max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.4s var(--ease), opacity 0.3s var(--ease); padding: 0 24px; }
.lesson-item.is-open .lesson-item-body { max-height: 700px; opacity: 1; padding: 0 24px 24px 24px; }
.lesson-video { width: 100%; max-height: 420px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 16px; background: #000; display: block; }
.lesson-description { color: var(--text-muted); font-size: 14.5px; line-height: 1.9; margin: 0; }
.lesson-no-video { color: var(--text-muted); font-size: 13px; font-style: italic; margin-bottom: 10px; }
.lesson-empty-state { text-align: center; color: var(--text-muted); padding: 60px 20px; }

@media (max-width: 768px) {
  .course-hero { min-height: 280px; margin: 16px 16px 0 16px; }
  .course-hero-inner { padding: 36px 24px 28px 24px; }
  .course-hero-title { font-size: 26px; }
  .lesson-section { padding: 50px 20px 70px 20px; }
  .detail-back-bar { padding: 0 20px; }
}