/* ================================================================
   main.css — AI Training Day | مرحباً بالذكاء الاصطناعي
   Ahmed Farouk / askfarouk.net
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;900&display=swap');

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --sidebar-w: 288px;

  /* Palette */
  --bg:           #0c1420;
  --bg-2:         #111d2e;
  --bg-3:         #162035;
  --sidebar-bg:   #080f1a;
  --sidebar-border: rgba(201,160,84,0.12);

  --gold:         #c9a054;
  --gold-light:   #e8c070;
  --gold-dim:     rgba(201,160,84,0.12);
  --gold-glow:    rgba(201,160,84,0.25);

  --teal:         #3db8b0;
  --teal-dim:     rgba(61,184,176,0.12);

  --rose:         #e05c6a;
  --rose-dim:     rgba(224,92,106,0.12);

  --sage:         #5cb87a;
  --sage-dim:     rgba(92,184,122,0.12);

  --text:         #dce4ee;
  --text-muted:   #8494a8;
  --text-faint:   #4a5a6e;

  --border:       rgba(255,255,255,0.07);
  --border-gold:  rgba(201,160,84,0.25);

  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    16px;

  --shadow:       0 4px 24px rgba(0,0,0,0.35);
  --shadow-gold:  0 0 24px rgba(201,160,84,0.15);

  --transition:   0.2s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

img { max-width: 100%; display: block; }
ul, ol { padding-right: 1.4em; }

/* ── Layout ─────────────────────────────────────────────────── */
.layout {
  display: flex;
  flex-direction: row-reverse;   /* sidebar right, content left in RTL */
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-left: 1px solid var(--sidebar-border);
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
  transition: transform 0.3s ease;
}

#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }

/* Sidebar Header */
.sidebar-header {
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.3;
}

.sidebar-logo-text span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 1px;
}

.sidebar-day-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gold-light);
}

.sidebar-day-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-faint);
  text-transform: uppercase;
  padding: 14px 20px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  cursor: pointer;
  border-right: 3px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  position: relative;
}

.sidebar-item:hover {
  background: rgba(255,255,255,0.04);
  border-right-color: var(--gold-dim);
}

.sidebar-item.active {
  background: var(--gold-dim);
  border-right-color: var(--gold);
}

.sidebar-item.active .si-title {
  color: var(--gold-light);
  font-weight: 700;
}

.si-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: background var(--transition);
}

.si-icon.type-intro   { background: rgba(255,255,255,0.06); }
.si-icon.type-lesson  { background: var(--teal-dim); }
.si-icon.type-activity{ background: var(--gold-dim); }
.si-icon.type-break   { background: rgba(255,255,255,0.04); }

.sidebar-item.active .si-icon { background: rgba(201,160,84,0.2); }

.si-body { flex: 1; min-width: 0; }

.si-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.si-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.si-type-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
}

.si-type-tag.lesson   { background: var(--teal-dim); color: var(--teal); }
.si-type-tag.activity { background: var(--gold-dim); color: var(--gold); }
.si-type-tag.intro    { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.si-type-tag.break    { background: rgba(255,255,255,0.04); color: var(--text-faint); }

.si-duration {
  font-size: 10px;
  color: var(--text-faint);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.sidebar-progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}

.sidebar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Mobile toggle button */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  width: 42px;
  height: 42px;
  background: var(--sidebar-bg);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  transition: background var(--transition);
}

.sidebar-toggle:hover { background: var(--bg-2); }

.toggle-bar {
  width: 100%;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
  transition: all var(--transition);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
}

/* ── Main Content ────────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-right: var(--sidebar-w);
  min-width: 0;
  padding: 0 0 80px;
}

/* ── Page Hero ──────────────────────────────────────────────── */
.page-hero {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 48px 56px 40px;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  left: -60px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero .breadcrumb {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-hero .breadcrumb span { color: var(--gold); }

.page-hero h1 {
  font-size: 30px;
  font-weight: 900;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 10px;
}

.page-hero p.lead {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.75;
}

.hero-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
}

.hero-tag.gold  { background: var(--gold-dim); border-color: var(--border-gold); color: var(--gold-light); }
.hero-tag.teal  { background: var(--teal-dim); border-color: rgba(61,184,176,0.3); color: var(--teal); }
.hero-tag.rose  { background: var(--rose-dim); border-color: rgba(224,92,106,0.3); color: var(--rose); }
.hero-tag.sage  { background: var(--sage-dim); border-color: rgba(92,184,122,0.3); color: var(--sage); }

/* ── Content Area ────────────────────────────────────────────── */
.content-area {
  padding: 40px 56px;
  max-width: 860px;
}

/* ── Section headings ───────────────────────────────────────── */
.content-area h2 {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  margin: 36px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.content-area h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.content-area h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 10px;
}

.content-area p {
  margin-bottom: 14px;
  color: var(--text);
  line-height: 1.8;
}

/* ── Cards ──────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.card-icon {
  font-size: 24px;
  margin-bottom: 10px;
}

.card h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.card p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0;
}

.card.gold-accent { border-color: var(--border-gold); background: linear-gradient(135deg, var(--bg-2), #16200a00); }
.card.gold-accent::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 3px; height: 100%;
  background: var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── Info Boxes ─────────────────────────────────────────────── */
.info-box {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  border-right: 4px solid;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.info-box .ib-icon { font-size: 20px; flex-shrink: 0; padding-top: 2px; }
.info-box .ib-body { flex: 1; }
.info-box .ib-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.info-box .ib-text  { font-size: 13px; line-height: 1.7; color: var(--text-muted); margin-bottom: 0; }

.info-box.note    { background: var(--gold-dim);  border-color: var(--gold);  }
.info-box.note .ib-title    { color: var(--gold-light); }

.info-box.tip     { background: var(--teal-dim);  border-color: var(--teal);  }
.info-box.tip .ib-title     { color: var(--teal); }

.info-box.warning { background: var(--rose-dim);  border-color: var(--rose);  }
.info-box.warning .ib-title { color: var(--rose); }

.info-box.success { background: var(--sage-dim);  border-color: var(--sage);  }
.info-box.success .ib-title { color: var(--sage); }

/* ── Activity Box ────────────────────────────────────────────── */
.activity-box {
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
}

.activity-box::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--gold), var(--gold-light));
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.activity-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.activity-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold);
}

.activity-duration {
  font-size: 12px;
  color: var(--text-faint);
  margin-right: auto;
}

.activity-box h3 {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 10px;
}

.activity-steps {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.65;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Agenda Timeline ─────────────────────────────────────────── */
.agenda {
  position: relative;
  padding-right: 28px;
  margin: 20px 0;
}

.agenda::before {
  content: '';
  position: absolute;
  top: 12px; bottom: 12px;
  right: 10px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold), var(--teal) 60%, transparent);
  border-radius: 1px;
}

.agenda-item {
  position: relative;
  padding: 12px 28px 12px 16px;
  margin-bottom: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 14px;
  align-items: center;
}

.agenda-item:hover { border-color: var(--border-gold); }

.agenda-item::before {
  content: '';
  position: absolute;
  right: -35px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--gold);
}

.agenda-item.type-break::before { border-color: var(--text-faint); }
.agenda-item.type-activity::before { border-color: var(--teal); background: var(--teal-dim); }

.agenda-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.agenda-item.type-break .agenda-time { color: var(--text-faint); }

.agenda-body {}

.agenda-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.agenda-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.agenda-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.agenda-tag.lesson   { background: var(--teal-dim); color: var(--teal); }
.agenda-tag.activity { background: var(--gold-dim); color: var(--gold); }
.agenda-tag.break    { background: rgba(255,255,255,0.04); color: var(--text-faint); }

/* ── Objectives List ─────────────────────────────────────────── */
.objectives {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.objective-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  transition: border-color var(--transition);
}

.objective-item:hover { border-color: var(--border-gold); }

.obj-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sage-dim);
  border: 1px solid rgba(92,184,122,0.3);
  color: var(--sage);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Concept Compare (2-column) ──────────────────────────────── */
.concept-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}

.concept-col {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.concept-col-header {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.concept-col-header.unsupervised { background: var(--teal-dim); color: var(--teal); }
.concept-col-header.supervised   { background: var(--gold-dim); color: var(--gold-light); }

.concept-col-body {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.75;
}

.concept-col-body strong { color: var(--text); display: block; margin-bottom: 4px; }

/* ── Stat Strip ─────────────────────────────────────────────── */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0;
}

.stat-item {
  background: var(--bg-2);
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 900;
  color: var(--gold-light);
  line-height: 1;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ── Table ───────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 16px 0;
}

.data-table th {
  background: var(--bg-3);
  color: var(--gold-light);
  font-weight: 700;
  padding: 11px 14px;
  text-align: right;
  border-bottom: 2px solid var(--border-gold);
  font-size: 12px;
  letter-spacing: 0.3px;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
  line-height: 1.6;
}

.data-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Divider ─────────────────────────────────────────────────── */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-hero, .content-area > * {
  animation: fadeInUp 0.4s ease both;
}

.content-area > *:nth-child(1) { animation-delay: 0.05s; }
.content-area > *:nth-child(2) { animation-delay: 0.10s; }
.content-area > *:nth-child(3) { animation-delay: 0.15s; }
.content-area > *:nth-child(4) { animation-delay: 0.20s; }
.content-area > *:nth-child(5) { animation-delay: 0.25s; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 860px) {
  #sidebar {
    transform: translateX(100%);
  }

  #sidebar.open {
    transform: translateX(0);
    box-shadow: -8px 0 40px rgba(0,0,0,0.5);
  }

  .sidebar-toggle {
    display: flex;
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .main-content {
    margin-right: 0;
  }

  .page-hero {
    padding: 48px 24px 32px;
  }

  .content-area {
    padding: 28px 24px;
  }

  .concept-compare { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .agenda-item { grid-template-columns: 60px 1fr; }
  .agenda-item .agenda-tag { display: none; }
}

@media (max-width: 480px) {
  .page-hero h1 { font-size: 22px; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .objectives { grid-template-columns: 1fr; }
}

/* ── Print ───────────────────────────────────────────────────── */
@media print {
  #sidebar, .sidebar-toggle { display: none !important; }
  .main-content { margin-right: 0; }
  .page-hero { padding: 20px; }
  .content-area { padding: 20px; }
  .card:hover { transform: none; box-shadow: none; }
  body { background: #fff; color: #000; }
}
