/* دوره‌ها (student course catalog and «دوره‌های من») in the Asmeli "bold" look
 * (design approved 27 Nov 2026).
 *
 * Phone only, scoped to pages that show .student-course-grid (admin course pages use
 * other markup). A blue band behind the page title, frosted white course cards with a
 * deep blue cover, a white logo tile, a gold «ثبت‌نام‌شده» badge, a blue progress bar
 * and a glowing main button. Colours from tokens.css (--as-*); lite-mode.css (loaded
 * after) still removes blur and glow.
 */

@media (max-width: 899px) {
  html.app-glass body:has(.student-course-grid) {
    background-color: var(--as-canvas, #eef3ff) !important;
    background-image:
      radial-gradient(280px 280px at 0% 60px, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 70%),
      radial-gradient(300px 300px at 100% 620px, rgba(232, 194, 106, 0.35), rgba(232, 194, 106, 0) 70%),
      linear-gradient(180deg, #2f5bd8 0px, #6e95f2 230px, #cfddff 480px, var(--as-canvas, #eef3ff) 820px) !important;
    background-attachment: scroll !important;
  }

  /* Page title on the band. */
  html.app-glass body:has(.student-course-grid) .main-panel .page-header {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .page-header h1 {
    color: #ffffff !important;
    font-size: 22px !important;
    font-weight: 800 !important;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .page-header p {
    color: rgba(255, 255, 255, 0.88) !important;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .student-course-grid {
    display: grid !important;
    gap: 16px !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  /* Course card: strong frosted white with a deep blue shadow. */
  html.app-glass body:has(.student-course-grid) .main-panel .student-course-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.82)) !important;
    border: 1px solid #ffffff !important;
    border-radius: 30px !important;
    box-shadow: 0 26px 60px -14px rgba(16, 40, 120, 0.5), inset 0 1px 0 #ffffff !important;
    overflow: hidden !important;
    padding: 0 !important;
  }

  /* Cover: the course picture, or deep blue with a white logo tile when there is none. */
  html.app-glass body:has(.student-course-grid) .main-panel .student-course-card .student-course-thumbnail {
    aspect-ratio: auto !important;
    background: linear-gradient(150deg, #12245c, var(--as-primary, #2341a0) 55%, #4369d3) !important;
    border-radius: 0 !important;
    height: 130px !important;
    margin: 0 !important;
    max-height: 130px !important;
    min-height: 130px !important;
    padding: 0 !important;
    position: relative;
    width: 100% !important;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .student-course-card .student-course-thumbnail > img {
    border-radius: 0 !important;
    height: 100% !important;
    object-fit: cover !important;
    width: 100% !important;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .student-course-card .student-course-placeholder {
    background: transparent !important;
    display: grid !important;
    inset: 0;
    place-items: center;
    position: absolute;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .student-course-card .student-course-thumbnail > img ~ .student-course-placeholder {
    display: none !important;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .student-course-card .placeholder-logo {
    background: linear-gradient(145deg, #ffffff, #c8d9fe) !important;
    border-radius: 22px !important;
    box-shadow: 0 16px 30px -10px rgba(5, 14, 50, 0.7) !important;
    height: 72px !important;
    object-fit: contain !important;
    inset: auto !important;
    opacity: 1 !important;
    padding: 12px !important;
    position: static !important;
    width: 72px !important;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .student-course-copy {
    padding: 16px 18px 4px !important;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .student-course-title {
    color: var(--as-text, #10192b) !important;
    font-size: 19px !important;
    font-weight: 800 !important;
    line-height: 1.6 !important;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .student-course-description {
    color: var(--as-text-muted, #4a5468) !important;
  }

  /* Badges: soft blue pills; «ثبت‌نام‌شده» / completed in gold. */
  html.app-glass body:has(.student-course-grid) .main-panel .student-course-badge {
    background: #e3ecff !important;
    border: 0 !important;
    border-radius: 999px !important;
    color: var(--as-primary-strong, #1b337b) !important;
    font-weight: 800 !important;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .student-course-badge.success {
    background: var(--as-accent, #e8c26a) !important;
    color: #12172b !important;
  }

  /* Progress: thick rounded track with a blue gradient fill. */
  html.app-glass body:has(.student-course-grid) .main-panel .student-course-progress-track {
    background: #e3ecff !important;
    border-radius: 999px !important;
    box-shadow: inset 0 1px 2px rgba(16, 40, 120, 0.15) !important;
    height: 10px !important;
    overflow: hidden !important;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .student-course-progress-track > span {
    background: linear-gradient(90deg, #3b63e0, var(--as-primary, #2341a0)) !important;
    border-radius: 999px !important;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .student-course-progress-header strong {
    color: var(--as-primary, #2341a0) !important;
    font-weight: 800 !important;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .catalog-course-card > .student-course-actions {
    padding: 0 18px 18px !important;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .student-course-actions {
    gap: 10px !important;
  }

  /* Main action: saturated blue with a glow. */
  html.app-glass body:has(.student-course-grid) .main-panel .student-course-actions .primary-button:not(:disabled) {
    background: linear-gradient(180deg, #3b63e0, var(--as-primary, #2341a0)) !important;
    border: 0 !important;
    border-radius: 16px !important;
    box-shadow: 0 14px 28px -8px rgba(35, 65, 160, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    min-height: 48px;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .student-course-actions .primary-button:disabled {
    background: #e3ecff !important;
    border: 0 !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    color: var(--as-primary-strong, #1b337b) !important;
    font-weight: 800 !important;
    min-height: 48px;
    opacity: 1 !important;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .student-course-actions .secondary-button {
    background: #ffffff !important;
    border: 1px solid var(--as-border, #dae0ec) !important;
    border-radius: 16px !important;
    color: var(--as-text, #10192b) !important;
    font-weight: 800 !important;
    min-height: 48px;
  }

  html.app-glass body:has(.student-course-grid) .main-panel .student-course-grid > .empty-state {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px dashed #99a2b2 !important;
    border-radius: 22px !important;
    color: var(--as-text-muted, #4a5468) !important;
  }
}
