/* ==========================================================================
   Trading Psychology Platform - Main Stylesheet
   Modern, Professional, RTL, Responsive
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
  /* Core palette – deep navy + soft professional blue */
  --primary: #0B1220;          /* almost black-navy */
  --secondary: #152033;        /* slightly lighter navy */
  --accent: #2563EB;           /* professional blue */
  --accent-hover: #1D4ED8;
  --accent-soft: #EFF6FF;      /* very light blue for backgrounds */

  --success: #059669;
  --warning: #D97706;
  --danger: #DC2626;

  --bg: #F1F5F9;               /* soft cool gray */
  --bg-card: #FFFFFF;
  --text: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;

  /* Refined radius & shadows */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-xl: 0 12px 28px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --navbar-h: 68px;
  --font: 'Vazirmatn', system-ui, -apple-system, sans-serif;
}

/* Dark mode ready (future) */
[data-theme="dark"] {
  --bg: #0F172A;
  --bg-card: #1E293B;
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --border: #334155;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  direction: rtl;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--primary);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

.section-title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 4rem 0;
}

.section-alt {
  background: linear-gradient(135deg, #EEF2FF 0%, #F8FAFC 100%);
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: var(--navbar-h);
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05);
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(11, 18, 32, 0.97);
  box-shadow: var(--shadow-lg);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
}

.navbar-brand span {
  color: var(--accent);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.05rem;
}

.nav-link {
  color: #94A3B8;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(37, 99, 235, 0.18);
}

.nav-link.btn-nav {
  background: var(--accent);
  color: #fff;
  margin-right: 0.5rem;
}

.nav-link.btn-nav:hover {
  background: var(--accent-hover);
  color: #fff;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--navbar-h);
  right: 0;
  left: 0;
  background: var(--primary);
  padding: 0.5rem 0.75rem;
  flex-direction: column;
  gap: 0.1rem;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.mobile-menu.open {
  max-height: 500px;
  display: flex;
}

.mobile-menu .nav-link {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

.btn-secondary:hover {
  background: #334155;
  color: #fff;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #059669;
  color: #fff;
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: #CBD5E1;
}

.card-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    box-sizing: border-box;
}

.card-img img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}
.card-body {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.card-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.card-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: #F8FAFC;
}

.price {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent);
}

.price.free {
  color: var(--success);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary { background: #DBEAFE; color: #1D4ED8; }
.badge-success { background: #D1FAE5; color: #047857; }
.badge-warning { background: #FEF3C7; color: #B45309; }
.badge-secondary { background: #E2E8F0; color: #475569; }

/* ---------- Hero ---------- */
/* ---------- Hero ---------- */

.hero {
  width: 100%;
  max-width: 100%;
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding-top: var(--navbar-h);
  background: #0F172A;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 700px;
  min-width: 0;
}

.hero h1 {
  color: #fff;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.hero p {
  color: #CBD5E1;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat .number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.hero-stat .label {
  font-size: 0.85rem;
  color: #94A3B8;
}


/* ---------- Services Grid ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
}

.service-card {
  text-align: center;
  padding: 2.5rem 1.75rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent);
}

.service-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, var(--accent), #60A5FA);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #fff;
}

/* ---------- Benefits ---------- */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.benefit-item:hover {
  border-color: var(--accent);
  transform: translateX(-4px);
}

.benefit-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: #DBEAFE;
  color: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

/* ---------- Instructor ---------- */
.instructor-section {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  align-items: center;
}

.instructor-avatar {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: #fff;
  box-shadow: var(--shadow-xl);
}

.instructor-content h2 {
  margin-bottom: 1rem;
}

.instructor-content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ---------- Testimonials Slider ---------- */
.testimonials-wrapper {
  position: relative;
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}

.testimonials-track {
  display: flex;
  transition: transform 0.5s ease;
}

.testimonial-card {
  min-width: 100%;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  border: 1px solid var(--border);
}

.testimonial-text {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.8;
  font-style: italic;
}

.testimonial-author {
  font-weight: 700;
  color: var(--primary);
}

.testimonial-role {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #CBD5E1;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.slider-dot.active {
  background: var(--accent);
  width: 28px;
  border-radius: 5px;
}

/* ---------- FAQ Accordion ---------- */
.accordion {
  max-width: 800px;
  margin: 0 auto;
}

.accordion-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  padding: 1.15rem 1.5rem;
  background: none;
  border: none;
  text-align: right;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--primary);
  transition: var(--transition);
}

.accordion-header:hover {
  background: #F1F5F9;
}

.accordion-header .icon {
  transition: var(--transition);
  font-size: 1.2rem;
}

.accordion-item.open .accordion-header .icon {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  padding: 0 1.5rem;
  color: var(--text-muted);
}

.accordion-item.open .accordion-body {
  max-height: 300px;
  padding-bottom: 1.25rem;
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: var(--transition);
  color: var(--text);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-control.is-invalid {
  border-color: var(--danger);
}

.invalid-feedback {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

.auth-card {
  max-width: 480px;
  margin: 2rem auto;
  padding: 2.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Dashboard & Club ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  background: linear-gradient(135deg, var(--accent), #60A5FA);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

.progress-bar-wrapper {
  background: #E2E8F0;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* ---------- Tables ---------- */
.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  padding: 1rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}

tr:hover td {
  background: #F8FAFC;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--primary);
  color: #94A3B8;
  padding: 4rem 0 1.75rem;
  margin-top: 5rem;
  border-top: 1px solid #1E293B;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);   /* force 4 equal columns on one line */
  gap: 2rem;
  margin-bottom: 2.5rem;
  align-items: start;
}
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
.footer-about {
  font-size: 0.9rem;
  line-height: 1.8;
  color: #94A3B8;
  text-align: justify;
  text-justify: inter-word;   /* better for Persian */
}
.footer h4 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer a {
  color: #94A3B8;
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.footer a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: #64748B;
}

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.35s ease;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast.success { background: var(--success); }
.toast.danger { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--accent); }

@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------- Flash Messages ---------- */
.flash-messages {
  position: fixed;
  top: calc(var(--navbar-h) + 1rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  width: 90%;
  max-width: 500px;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
  animation: fadeInDown 0.4s ease;
}

.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Page Header ---------- */
.page-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: calc(var(--navbar-h) + 3rem) 0 3rem;
  text-align: center;
}

.page-header h1 {
  color: #fff;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: #94A3B8;
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- Contact Info ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.contact-info-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-info-icon {
  width: 48px;
  height: 48px;
  background: #DBEAFE;
  color: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.map-placeholder {
  background: #E2E8F0;
  border-radius: var(--radius);
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ---------- Loading ---------- */
.loader {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-loader {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.page-loader.active {
  opacity: 1;
  visibility: visible;
}

/* ---------- Admin Sidebar ---------- */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - var(--navbar-h));
  margin-top: var(--navbar-h);
}

.admin-sidebar {
  background: var(--primary);
  padding: 1.5rem 1rem;
  color: #CBD5E1;
}

.admin-sidebar a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: #94A3B8;
  margin-bottom: 0.25rem;
  transition: var(--transition);
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
  background: rgba(59, 130, 246, 0.2);
  color: #fff;
}

.admin-content {
  padding: 2rem;
  background: var(--bg);
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }

.main-content {
  padding-top: var(--navbar-h);
  min-height: calc(100vh - 200px);
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .instructor-section {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .navbar-nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-menu {
    display: flex;
  }

  .hero {
    min-height: auto;
    padding: calc(var(--navbar-h) + 3rem) 0 4rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .section {
    padding: 3rem 0;
  }
}

@media (max-width: 480px) {
  .card-footer {
    flex-direction: column;
    gap: 0.75rem;
  }
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
}
/* ---------- User Sidebar (Desktop only when logged in) ---------- */
.user-sidebar {
  display: none;                     /* hidden by default */
  position: fixed;
  top: var(--navbar-h);
  right: 0;                          /* RTL → right side */
  width: 260px;
  height: calc(100vh - var(--navbar-h));
  background: var(--primary);
  color: #CBD5E1;
  padding: 1.25rem 0.75rem;
  z-index: 900;
  overflow-y: auto;
  box-shadow: -4px 0 15px rgba(0,0,0,0.15);
  transition: var(--transition);
}

.sidebar-header {
  padding: 0.75rem 1rem 1.25rem;
  border-bottom: 1px solid #334155;
  margin-bottom: 1rem;
}

.sidebar-user {
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: #94A3B8;
  font-size: 0.95rem;
  transition: var(--transition);
}

.sidebar-link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(59, 130, 246, 0.2);
  color: #fff;
}

.sidebar-link.logout {
  margin-top: 1.5rem;
  border-top: 1px solid #334155;
  padding-top: 1rem;
  color: #F87171;
}

.sidebar-link.logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #FCA5A5;
}

/* Push main content when sidebar is present (desktop) */
.main-content.has-sidebar {
  margin-right: 0;                   /* default for mobile */
}

/* Desktop only */
@media (min-width: 769px) {
  .user-sidebar {
    display: block;
  }

  .main-content.has-sidebar {
    margin-right: 260px;             /* push content to the left of the sidebar */
  }

  /* Optional: make footer also respect the sidebar */
  .footer {
    margin-right: 0;
  }
  body:has(.user-sidebar) .footer {
    margin-right: 260px;
  }
}
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 15px;
}

.social-links a {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    text-decoration: none;
    box-sizing: border-box;
    overflow: hidden;

    flex: 0 0 32px;
    margin: 0;

    transition: transform .25s ease;
}

.social-links a:hover {
    transform: translateY(-2px);
}

/* Icon size */
.social-links i {
    font-size: 16px;
    line-height: 1;
}

/* Brand colors */
.social-links .instagram {
    background: #E4405F;
    color: #fff;
}

.social-links .telegram {
    background: #229ED9;
    color: #fff;
}

.social-links .youtube {
    background: #FF0000;
    color: #fff;
}

.social-links .linkedin {
    background: #0A66C2;
    color: #fff;
}

.social-links .twitter {
    background: #000;
    color: #fff;
}

/* Footer navigation links only */
.footer-grid > div:nth-child(2) a,
.footer-grid > div:nth-child(3) a {
    color: #94A3B8;
    display: block;
    margin-bottom: .5rem;
    font-size: .9rem;
}
/* ---------- AI Chat ---------- */
#chat-widget-root {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 9999;
    font-family: Vazirmatn, Tahoma, sans-serif;
  }
  #chat-fab {
    width: 56px; height: 56px; border-radius: 50%;
    border: none; cursor: pointer;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff; font-size: 1.5rem;
    box-shadow: 0 8px 24px rgba(37,99,235,0.35);
  }
  #chat-fab:hover { transform: scale(1.05); }
  #chat-panel {
    position: absolute;
    bottom: 68px; left: 0;
    width: min(360px, calc(100vw - 2rem));
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(15,23,42,0.18);
    overflow: hidden;
    display: flex; flex-direction: column;
  }
  #chat-panel[hidden] { display: none !important; }
  .chat-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1rem;
    background: #0f172a; color: #fff;
  }
  #chat-close {
    background: none; border: none; color: #fff;
    font-size: 1.4rem; cursor: pointer; line-height: 1;
  }
  .chat-panel-body { padding: 0.85rem 1rem 1rem; }
  #chat-messages {
    height: 260px; overflow-y: auto;
    margin-bottom: 0.65rem;
    display: flex; flex-direction: column; gap: 0.5rem;
  }
  .chat-bubble {
    max-width: 88%; padding: 0.55rem 0.75rem;
    border-radius: 10px; font-size: 0.88rem; line-height: 1.65;
    white-space: pre-wrap;
  }
  .chat-bubble.user {
    align-self: flex-start;
    background: #e2e8f0; color: #0f172a;
  }
  .chat-bubble.bot {
    align-self: flex-end;
    background: #dbeafe; color: #1e3a8a;
  }
  .chat-input-row { display: flex; gap: 0.4rem; }
  #chat-input {
    flex: 1; border: 1px solid #cbd5e1; border-radius: 8px;
    padding: 0.5rem 0.65rem; font-size: 0.9rem;
  }
  #chat-send-btn {
    border: none; border-radius: 8px; padding: 0.5rem 0.85rem;
    background: #2563eb; color: #fff; cursor: pointer; font-size: 0.85rem;
  }