/**
 * AMWAG Student Experience Design System
 * Clean, modern, mobile-first educational portal styles
 */

:root {
  /* AMWAG Standard Design Tokens & Brand Differentiation */
  --amwag-primary: #105c81;
  --amwag-primary-hover: #0c4765;
  --amwag-primary-light: #e0f2fe;
  --amwag-primary-subtle: #f0f9ff;
  --amwag-navy: #102f55;
  --amwag-navy2: #163f70;
  --amwag-sky: #0284c7;

  /* Aliases for Student Experience backwards compatibility */
  --std-primary: var(--amwag-primary);
  --std-primary-hover: var(--amwag-primary-hover);
  --std-primary-light: var(--amwag-primary-light);
  --std-primary-subtle: var(--amwag-primary-subtle);
  --std-navy: var(--amwag-navy);
  --std-navy2: var(--amwag-navy2);
  --std-sky: var(--amwag-sky);

  /* Neutrals & Surfaces */
  --surface-page: #f8fafc;
  --surface-card: #ffffff;
  --surface-subtle: #f1f5f9;
  --border-light: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-focus: #0284c7;

  /* Typography & High-Contrast Colors */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --text-inverse: #ffffff;

  --std-text-main: var(--text-main);
  --std-text-muted: var(--text-muted);
  --std-text-light: var(--text-light);
  --std-border: var(--border-light);
  --std-border-subtle: var(--border-subtle);
  --std-bg: var(--surface-page);
  --std-card-bg: var(--surface-card);

  /* Semantics */
  --std-emerald: #10b981;
  --std-emerald-bg: #ecfdf5;
  --std-amber: #f59e0b;
  --std-amber-bg: #fffbeb;
  --std-rose: #f43f5e;
  --std-rose-bg: #fff1f2;
  --std-indigo: #6366f1;
  --std-indigo-bg: #eef2ff;

  /* Radii & Shadows */
  --std-radius-sm: 8px;
  --std-radius-md: 14px;
  --std-radius-lg: 20px;
  --std-radius-full: 9999px;
  --std-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --std-shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --std-shadow-hover: 0 10px 25px -4px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}

body.amwag-student-body {
  margin: 0;
  font-family: "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--std-text-main);
  background-color: var(--std-bg);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  overflow-x: clip;
  max-width: 100%;
  padding-bottom: 76px; /* Space for mobile bottom nav */
}

@media (min-width: 1024px) {
  body.amwag-student-body {
    padding-bottom: 32px;
  }
}

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

.std-container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding-inline: 16px;
}

@media (min-width: 640px) {
  .std-container { padding-inline: 20px; }
}

@media (min-width: 1024px) {
  .std-container { padding-inline: 24px; }
}

/* ==========================================================================
   1. Compact Header & Brand Navigation
   ========================================================================== */
.std-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--std-border);
  height: 62px;
  display: flex;
  align-items: center;
}

.std-header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}

@media (max-width: 480px) {
  .std-header-wrap {
    gap: 8px;
  }
  .std-brand {
    min-width: 0;
    gap: 8px;
    flex: 1 1 auto;
  }
  .std-brand-logo {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: var(--std-radius-sm);
    flex-shrink: 0;
  }
  .std-brand-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .std-brand-title {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--std-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: none;
  }
  .std-brand-tag {
    display: none;
  }
  .std-user-actions {
    gap: 6px;
    flex-shrink: 0;
  }
  .std-user-chip {
    padding: 3px 8px 3px 6px;
    font-size: 11.5px;
    max-width: 100px;
    gap: 5px;
  }
  .std-user-avatar {
    width: 24px;
    height: 24px;
    font-size: 11px;
    flex-shrink: 0;
  }
  .std-user-name {
    display: inline-block;
    max-width: 60px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }
  .std-btn-logout {
    min-height: 44px;
    min-width: 44px;
    padding: 6px 10px;
    font-size: 11.5px;
  }
}

@media (max-width: 360px) {
  .std-header-wrap {
    gap: 6px;
  }
  .std-brand {
    gap: 6px;
  }
  .std-brand-logo {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }
  .std-brand-title {
    font-size: 12.5px;
  }
  .std-user-name {
    display: none;
  }
  .std-user-chip {
    padding: 4px;
    border-radius: var(--std-radius-full);
  }
}

.std-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.std-brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: var(--std-radius-sm);
}

.std-brand-info {
  display: flex;
  flex-direction: column;
}

.std-brand-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--std-navy);
  line-height: 1.2;
}

.std-brand-tag {
  font-size: 11px;
  color: var(--std-text-muted);
  font-weight: 500;
}

/* Desktop Navigation Pills */
.std-nav-pills {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--std-border-subtle);
  padding: 4px;
  border-radius: var(--std-radius-full);
}

@media (min-width: 1024px) {
  .std-nav-pills { display: flex; }
}

.std-nav-pill {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--std-text-muted);
  border-radius: var(--std-radius-full);
  transition: all 0.15s ease;
}

.std-nav-pill:hover {
  color: var(--std-text-main);
  background: rgba(255, 255, 255, 0.7);
}

.std-nav-pill.active {
  color: var(--std-primary);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

/* User Badge & Actions */
.std-user-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.std-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  background: var(--std-border-subtle);
  border: 1px solid var(--std-border);
  border-radius: var(--std-radius-full);
  font-size: 13px;
  font-weight: 700;
  color: var(--std-navy);
}

.std-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--std-radius-full);
  background: var(--std-primary);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.std-btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #ef4444;
  background: transparent;
  border: 1px solid #fecaca;
  border-radius: var(--std-radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.std-btn-logout:hover {
  background: #fef2f2;
}

/* ==========================================================================
   2. Welcome Banner & Overview Status
   ========================================================================== */
.std-welcome-hero {
  margin-top: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  border: 1px solid #bae6fd;
  border-radius: var(--std-radius-lg);
  padding: 24px;
  box-shadow: var(--std-shadow-card);
}

@media (min-width: 768px) {
  .std-welcome-hero {
    padding: 28px 32px;
  }
}

.std-welcome-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 768px) {
  .std-welcome-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.std-welcome-title-group h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--std-navy);
  letter-spacing: -0.3px;
}

@media (min-width: 768px) {
  .std-welcome-title-group h1 { font-size: 26px; }
}

.std-welcome-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--std-text-muted);
}

.std-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.std-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: var(--std-radius-full);
}

.std-chip-primary {
  background: var(--std-primary-light);
  color: var(--std-primary);
}

.std-chip-emerald {
  background: var(--std-emerald-bg);
  color: var(--std-emerald);
}

.std-chip-device {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid var(--std-border);
}

/* ==========================================================================
   3. HERO FEATURE: Continue Learning (أكمل منين؟)
   ========================================================================== */
.std-hero-continue {
  margin-top: 24px;
  background: #ffffff;
  border: 2px solid #bae6fd;
  border-radius: var(--std-radius-lg);
  padding: 24px;
  box-shadow: 0 10px 30px -5px rgba(16, 92, 129, 0.08);
  position: relative;
  overflow: hidden;
}

.std-hero-continue::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--std-primary) 0%, #38bdf8 100%);
}

.std-continue-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .std-continue-layout {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.std-continue-details {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.std-continue-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--std-radius-md);
  object-fit: cover;
  background: var(--std-primary-subtle);
  flex-shrink: 0;
  border: 1px solid var(--std-border);
}

@media (min-width: 640px) {
  .std-continue-thumb {
    width: 84px;
    height: 84px;
  }
}

.std-continue-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.std-continue-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--std-primary);
  text-transform: uppercase;
}

.std-continue-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--std-navy);
  line-height: 1.3;
}

.std-continue-lesson {
  margin: 0;
  font-size: 13.5px;
  color: var(--std-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.std-continue-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  max-width: 320px;
}

.std-progress-bar-bg {
  flex: 1;
  height: 7px;
  background: #e2e8f0;
  border-radius: var(--std-radius-full);
  overflow: hidden;
}

.std-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8 0%, var(--std-primary) 100%);
  border-radius: var(--std-radius-full);
  transition: width 0.4s ease;
}

.std-progress-val {
  font-size: 12px;
  font-weight: 800;
  color: var(--std-primary);
  min-width: 36px;
}

.std-continue-action {
  flex-shrink: 0;
}

.std-btn-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  background: var(--std-primary);
  border: none;
  border-radius: var(--std-radius-md);
  box-shadow: 0 4px 14px rgba(16, 92, 129, 0.25);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

@media (min-width: 768px) {
  .std-btn-hero { width: auto; }
}

.std-btn-hero:hover {
  background: var(--std-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 92, 129, 0.3);
}

/* ==========================================================================
   4. Section Headers
   ========================================================================== */
.std-section-header {
  margin-top: 36px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.std-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.std-section-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--std-radius-sm);
  background: var(--std-primary-light);
  color: var(--std-primary);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.std-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--std-navy);
}

.std-section-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--std-primary);
  transition: color 0.15s ease;
}

.std-section-link:hover {
  color: var(--std-primary-hover);
  text-decoration: underline;
}

/* ==========================================================================
   5. Course Cards Grid (كورساتي)
   ========================================================================== */
.std-courses-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 640px) {
  .std-courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .std-courses-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
  }
}

.std-course-card {
  background: #ffffff;
  border: 1px solid var(--std-border);
  border-radius: var(--std-radius-lg);
  overflow: hidden;
  box-shadow: var(--std-shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.std-course-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--std-shadow-hover);
  border-color: #cbd5e1;
}

.std-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #e2e8f0;
  overflow: hidden;
}

.std-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.std-course-card:hover .std-card-img {
  transform: scale(1.03);
}

.std-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  border-radius: var(--std-radius-full);
  backdrop-filter: blur(8px);
}

.std-badge-in-progress {
  background: rgba(245, 158, 11, 0.9);
  color: #ffffff;
}

.std-badge-completed {
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff;
}

.std-badge-new {
  background: rgba(16, 92, 129, 0.9);
  color: #ffffff;
}

.std-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.std-card-title {
  margin: 0 0 8px;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--std-navy);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.std-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--std-text-muted);
  margin-bottom: 14px;
}

.std-card-progress {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--std-border-subtle);
}

.std-card-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--std-text-muted);
  margin-bottom: 6px;
}

.std-card-footer {
  margin-top: 14px;
}

.std-btn-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 800;
  border-radius: var(--std-radius-md);
  transition: all 0.15s ease;
  border: none;
  cursor: pointer;
}

.std-btn-card-primary {
  background: var(--std-primary);
  color: #ffffff;
}

.std-btn-card-primary:hover {
  background: var(--std-primary-hover);
}

.std-btn-card-outline {
  background: transparent;
  color: var(--std-primary);
  border: 1.5px solid var(--std-primary);
}

.std-btn-card-outline:hover {
  background: var(--std-primary-subtle);
}

/* ==========================================================================
   6. Batches & Live Learning
   ========================================================================== */
.std-batches-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.std-batch-card {
  background: #ffffff;
  border: 1px solid var(--std-border);
  border-radius: var(--std-radius-lg);
  padding: 20px;
  box-shadow: var(--std-shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (min-width: 768px) {
  .std-batch-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.std-batch-details h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: var(--std-navy);
}

.std-batch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--std-text-muted);
}

/* ==========================================================================
   7. Certificates Gallery
   ========================================================================== */
.std-certs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .std-certs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.std-cert-card {
  background: #ffffff;
  border: 1px solid #fde68a;
  border-radius: var(--std-radius-lg);
  padding: 20px;
  box-shadow: var(--std-shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.std-cert-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.std-cert-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--std-radius-md);
  background: #fffbeb;
  color: #d97706;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.std-cert-info h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
  color: var(--std-navy);
}

.std-cert-date {
  margin: 0;
  font-size: 12px;
  color: var(--std-text-muted);
}

/* ==========================================================================
   8. Orders, Vouchers & Device Protection
   ========================================================================== */
.std-account-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 1024px) {
  .std-account-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.std-sub-card {
  background: #ffffff;
  border: 1px solid var(--std-border);
  border-radius: var(--std-radius-lg);
  padding: 20px;
  box-shadow: var(--std-shadow-card);
}

.std-sub-card h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 800;
  color: var(--std-navy);
}

/* Voucher Form */
.std-voucher-box {
  display: flex;
  gap: 8px;
}

.std-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 8px 14px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--std-border);
  border-radius: var(--std-radius-md);
  background: #ffffff;
  color: var(--std-text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.std-input:focus {
  border-color: var(--std-primary);
  box-shadow: 0 0 0 3px var(--std-primary-light);
}

.std-btn-voucher {
  height: 44px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  background: var(--std-navy);
  color: #ffffff;
  border: none;
  border-radius: var(--std-radius-md);
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.std-btn-voucher:hover {
  background: #163f70;
}

@media (max-width: 480px) {
  .std-voucher-box {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .std-btn-voucher {
    width: 100%;
    min-height: 44px;
  }
}

@media (max-width: 360px) {
  .std-sub-card {
    padding: 14px;
  }
}

/* Orders List */
.std-orders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.std-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--std-border-subtle);
  border-radius: var(--std-radius-md);
  font-size: 13px;
}

.std-order-desc {
  font-weight: 700;
  color: var(--std-navy);
}

.std-order-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--std-radius-full);
}

.std-order-paid {
  background: var(--std-emerald-bg);
  color: var(--std-emerald);
}

.std-order-pending {
  background: var(--std-amber-bg);
  color: #b45309;
}

/* Device Protection Box */
.std-device-box {
  background: #f8fafc;
  border: 1px dashed var(--std-border);
  border-radius: var(--std-radius-md);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.std-device-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.std-device-text p {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--std-text-muted);
  line-height: 1.5;
}

.std-device-code-chip {
  display: inline-block;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  background: #e2e8f0;
  color: var(--std-navy);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ==========================================================================
   9. Mobile Bottom Navigation Bar (Fixed)
   ========================================================================== */
.std-mobile-bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--std-border);
  z-index: 999;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.05);
}

@media (min-width: 1024px) {
  .std-mobile-bottom-nav { display: none; }
}

.std-bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  height: 100%;
  color: var(--std-text-muted);
  font-size: 11px;
  font-weight: 700;
  transition: all 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.std-bottom-icon {
  font-size: 18px;
  line-height: 1;
}

.std-bottom-tab.active {
  color: var(--std-primary);
}

.std-bottom-tab.active .std-bottom-icon {
  transform: translateY(-1px);
}

/* ==========================================================================
   10. Empty & Loading States
   ========================================================================== */
.std-empty-state {
  background: #ffffff;
  border: 1px dashed var(--std-border);
  border-radius: var(--std-radius-lg);
  padding: 36px 20px;
  text-align: center;
}

.std-empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.std-empty-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: var(--std-navy);
}

.std-empty-desc {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--std-text-muted);
}

/* ==========================================================================
   11. Desktop Fixed Extreme-Right Sidebar (Reference A Structure + Reference B Style)
   ========================================================================== */
.std-app-shell {
  width: 100%;
  min-width: 0;
}

.std-desktop-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .std-desktop-sidebar {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 260px !important;
    height: 100vh !important;
    background: #ffffff !important;
    border-left: 1px solid var(--std-border) !important;
    border-right: none !important;
    z-index: 1050 !important;
    overflow-y: auto !important;
    box-shadow: -2px 0 12px rgba(15, 47, 83, 0.03) !important;
    padding: 16px 12px !important;
    direction: rtl !important;
  }

  .std-app-shell {
    margin-right: 260px !important;
    width: calc(100% - 260px) !important;
    min-width: 0 !important;
  }

  /* When desktop extreme-right sidebar is visible, suppress header nav pills */
  .std-nav-pills {
    display: none !important;
  }
}

.std-sidebar-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.std-sidebar-top {
  display: flex;
  flex-direction: column;
}

.std-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px 14px;
  border-bottom: 1px solid var(--std-border);
  margin-bottom: 14px;
  text-decoration: none;
}

.std-sidebar-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}

.std-sidebar-brand-info {
  display: flex;
  flex-direction: column;
}

.std-sidebar-brand-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--std-navy);
  line-height: 1.2;
}

.std-sidebar-brand-tag {
  font-size: 11px;
  color: var(--std-text-muted);
  font-weight: 500;
}

.std-sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--std-border);
  border-radius: 12px;
  margin-bottom: 14px;
}

.std-sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--std-primary);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.std-sidebar-user {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.std-sidebar-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--std-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.std-sidebar-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--std-emerald);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.std-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.std-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  transition: all 0.15s ease;
  text-decoration: none;
  border: 1px solid transparent;
}

.std-sidebar-link:hover {
  background: #f1f5f9;
  color: var(--std-navy);
}

.std-sidebar-link.active {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  color: #0284c7;
  font-weight: 800;
  border: 1px solid #bae6fd;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.06);
}

.std-sidebar-icon {
  font-size: 16px;
  line-height: 1;
}

.std-sidebar-counter {
  margin-right: auto;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #475569;
}

.std-sidebar-link.active .std-sidebar-counter {
  background: #e0f2fe;
  color: #0369a1;
}

.std-sidebar-link-accent {
  margin-top: 8px;
  border: 1px dashed #bae6fd;
  color: #0284c7;
  background: #f0f9ff;
}

.std-sidebar-link-accent:hover {
  background: #e0f2fe;
}

.std-sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--std-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.std-sidebar-security {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--std-text-muted);
}

.std-security-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--std-emerald);
  display: inline-block;
}

.std-sidebar-logout-btn {
  display: block;
  text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #ef4444;
  background: #fef2f2;
  border: 1px solid #fecdd3;
  transition: all 0.2s ease;
  text-decoration: none;
}

.std-sidebar-logout-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Scroll margin top for sections to guarantee headers never overlap */
#overview-heading,
#my-courses,
#my-batches,
#my-certificates,
#my-orders,
#my-account {
  scroll-margin-top: 90px;
}

/* ==========================================================================
   Interactive Component Enhancements & Standards (Touch Targets >= 44px)
   ========================================================================== */
.std-bottom-tab {
  min-height: 48px;
  min-width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.std-btn-card,
.std-btn-hero,
.std-btn-voucher {
  min-height: 44px;
}

.std-input {
  min-height: 44px;
  font-family: inherit;
  font-size: 14px;
  border-radius: var(--std-radius-md);
  padding: 8px 14px;
  border: 1px solid var(--border-light);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.std-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Empty State Standard Container */
.std-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  background: var(--surface-card);
  border: 1px dashed var(--border-light);
  border-radius: var(--std-radius-lg);
  margin: 16px 0;
}

.std-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.85;
}

.std-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 6px;
}

.std-empty-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 0 16px;
  line-height: 1.5;
}

.std-empty-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  background: var(--amwag-primary);
  border-radius: var(--std-radius-md);
  min-height: 44px;
  transition: background 0.15s ease;
}

.std-empty-action:hover {
  background: var(--amwag-primary-hover);
}

/* ==========================================================================
   AMWAG-04.02 / AMWAG-04.05: Accessibility & Keyboard Navigation Tokens
   ========================================================================== */

/* Universal high-contrast keyboard focus indicators */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--border-focus) !important;
  outline-offset: 2px !important;
}

/* Touch targets >= 44x44px safety guarantee */
.std-sidebar-link,
.std-nav-link,
.std-btn,
.std-btn-logout,
.std-tab-btn,
.std-empty-action {
  min-height: 44px;
}

/* Reduced Motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Iconography Standardization System (AMWAG-04.01.03) */
.amwag-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}

.amwag-icon-unicode {
  font-family: inherit;
  font-style: normal;
  font-size: 1.15em;
}

.amwag-icon-svg {
  width: 1.25em;
  height: 1.25em;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0;
}

.amwag-icon-sm { font-size: 0.875rem; width: 0.875rem; height: 0.875rem; }
.amwag-icon-md { font-size: 1.25rem; width: 1.25rem; height: 1.25rem; }
.amwag-icon-lg { font-size: 1.75rem; width: 1.75rem; height: 1.75rem; }

/* ==========================================================================
   13. Mobile Learning Polish & Viewport Safeguards (AMWAG-04.03.02 & AMWAG-04.03.03)
   ========================================================================== */
@media (max-width: 480px) {
  .std-hero-continue {
    padding: 16px;
    border-radius: var(--std-radius-md);
  }
  .std-continue-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .std-continue-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .std-continue-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: var(--std-radius-sm);
  }
  .std-continue-action {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }
  .std-continue-progress-row {
    max-width: 100%;
    width: 100%;
  }
}

/* Extra small viewports (320px - 375px): Zero horizontal overflow guarantee */
@media (max-width: 375px) {
  .std-container {
    padding-inline: 12px;
  }
  .std-welcome-title {
    font-size: 18px;
  }
  .std-continue-title {
    font-size: 16px;
  }
  .std-stat-pill {
    font-size: 11.5px;
    padding: 6px 10px;
  }
  .std-section-title {
    font-size: 16px;
  }
}

/* Strict zero horizontal overflow guard */
body.amwag-student-body,
.std-app-shell,
.std-container,
.std-hero-continue,
.std-courses-grid {
  max-width: 100vw;
  box-sizing: border-box;
}

/* AMWAG-02.03.03: RTL Math & Scientific Expression Styling */
.amwag-math-container {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  box-sizing: border-box;
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  color: var(--std-navy, #0f172a);
}

.amwag-math-fraction {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  font-size: 0.9em;
  padding: 0 4px;
}

.amwag-math-fraction .amwag-numerator {
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 1px;
}

.amwag-math-fraction .amwag-denominator {
  padding-top: 1px;
}

.amwag-math-sqrt {
  display: inline-block;
  padding: 0 2px;
}

.amwag-math-pow {
  font-size: 0.85em;
}

/* Educational Milestone Badges (AMWAG-14.01.01) */
.amwag-milestone-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--std-radius-full, 9999px);
  font-size: 12px;
  font-weight: 700;
  background-color: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}


