/* =========================================================
   100L LEARNING
   Main Website Styles
   Responsive and Mobile Learning Improvements
   ========================================================= */

:root {
  --primary: #1e3a8a;
  --primary-dark: #172554;
  --primary-light: #eff6ff;
  --gold: #d4af37;
  --gold-dark: #b8921f;
  --white: #ffffff;
  --black: #111827;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --background: #f8fafc;
  --success: #15803d;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  --container: 1180px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
}

body {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

img {
  max-width: 100%;
  display: block;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* =========================================================
   LAYOUT
   ========================================================= */

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.page {
  min-height: 70vh;
}

.section {
  padding: 70px 0;
}

.section-sm {
  padding: 40px 0;
}

/* =========================================================
   HEADER
   ========================================================= */

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--primary);
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--white);
  display: grid;
  place-items: center;
  font-weight: 800;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a,
.nav-links button {
  border: none;
  background: transparent;
  color: var(--text);
  padding: 9px 13px;
  border-radius: 8px;
  font-weight: 600;
}

.nav-links a:hover,
.nav-links button:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.mobile-menu-btn {
  display: none;
  border: 1px solid var(--border);
  background: var(--white);
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 20px;
  min-height: 44px;
  flex-shrink: 0;
}

/* =========================================================
   HERO
   ========================================================= */

.hero {
  background:
    linear-gradient(
      135deg,
      var(--primary-dark),
      var(--primary)
    );
  color: var(--white);
  padding: 90px 0;
}

.hero-content {
  max-width: 760px;
}

.hero h1 {
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.08;
  margin-bottom: 20px;
}

.hero p {
  font-size: 19px;
  color: rgba(255, 255, 255, 0.88);
  max-width: 650px;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* =========================================================
   TYPOGRAPHY
   ========================================================= */

.page-title {
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.15;
  margin-bottom: 12px;
  color: var(--black);
}

.page-subtitle {
  color: var(--muted);
  max-width: 700px;
}

.section-title {
  font-size: 32px;
  line-height: 1.2;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}

.section-heading {
  margin-bottom: 35px;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-gold {
  background: var(--gold);
  color: #111827;
}

.btn-gold:hover {
  background: var(--gold-dark);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-white {
  background: var(--white);
  color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-block {
  width: 100%;
}

/* =========================================================
   CARDS
   ========================================================= */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

.card-body {
  padding: 22px;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.course-card {
  overflow: hidden;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.12);
}

.course-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--primary-light);
}

.course-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--primary);
  color: var(--white);
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 800;
}

.course-title {
  font-size: 20px;
  line-height: 1.3;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.course-meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}

.course-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
}

/* =========================================================
   COURSE PAGE
   Desktop: course details and included resources on the
   left, purchase card on the right.
   Tablet/mobile: details, purchase card, included resources.
   ========================================================= */

.course-header {
  background: var(--white);
  padding: 55px 0;
  border-bottom: 1px solid var(--border);
}

.course-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  grid-template-areas:
    "main sidebar"
    "included sidebar";
  gap: 35px;
  align-items: start;
}

.course-layout > * {
  min-width: 0;
}

.course-layout > .course-main {
  grid-area: main;
}

.course-layout > .course-sidebar {
  grid-area: sidebar;
}

.course-layout > .course-included {
  grid-area: included;
}

.course-sidebar {
  position: sticky;
  top: 95px;
}

.course-description {
  margin-top: 20px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.course-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.price-box {
  padding: 25px;
}

.price-box .price {
  font-size: 34px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 18px;
}

/* =========================================================
   RESOURCES
   ========================================================= */

.resource-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.resource-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-width: 0;
}

.resource-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.resource-icon {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 800;
}

.resource-title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.resource-type {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.resource-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================================================
   FORMS
   ========================================================= */

.form-container {
  width: min(100%, 620px);
  margin: 60px auto;
}

.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
  font-size: 14px;
}

.form-control {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  outline: none;
  background: var(--white);
  color: var(--text);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

textarea.form-control {
  min-height: 130px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-actions {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================================================
   DASHBOARD
   ========================================================= */

.dashboard-header {
  padding: 50px 0 30px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.stat-card {
  padding: 24px;
}

.stat-label {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--primary);
  overflow-wrap: anywhere;
}

/* =========================================================
   ALERTS / MESSAGES
   ========================================================= */

.alert {
  padding: 13px 15px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* =========================================================
   EMPTY STATES
   ========================================================= */

.empty-state {
  padding: 60px 25px;
  text-align: center;
  background: var(--white);
  border: 1px dashed #d1d5db;
  border-radius: var(--radius);
}

.empty-state h3 {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.empty-state p {
  color: var(--muted);
  margin-bottom: 18px;
}

/* =========================================================
   LOADING
   ========================================================= */

.loading {
  padding: 50px 20px;
  text-align: center;
  color: var(--muted);
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 12px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
  margin-top: 80px;
  background: #111827;
  color: var(--white);
  padding: 45px 0 25px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 35px;
}

.footer-title {
  font-weight: 800;
  margin-bottom: 12px;
}

.footer-text {
  color: #9ca3af;
  max-width: 450px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: #d1d5db;
}

.footer-links a:hover {
  color: var(--white);
}

.footer-bottom {
  margin-top: 35px;
  padding-top: 20px;
  border-top: 1px solid #374151;
  color: #9ca3af;
  font-size: 14px;
}

/* =========================================================
   WHATSAPP SUPPORT BUTTON
   ========================================================= */

.whatsapp-support {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  color: var(--white);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  z-index: 2000;
}

.whatsapp-support:hover {
  transform: scale(1.05);
}

/* =========================================================
   ADMIN
   ========================================================= */

.admin-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}

.admin-sidebar {
  background: var(--primary-dark);
  color: var(--white);
  padding: 25px 15px;
}

.admin-sidebar a {
  display: block;
  padding: 11px 13px;
  border-radius: 8px;
  margin-bottom: 4px;
  color: #dbeafe;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.admin-main {
  padding: 35px;
  min-width: 0;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.admin-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

.admin-table th,
.admin-table td {
  padding: 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.admin-table th {
  background: #f8fafc;
  font-size: 13px;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

/* =========================================================
   SEARCH / FILTERS
   ========================================================= */

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.filters .form-control {
  max-width: 300px;
}

/* =========================================================
   LEARNING PAGE
   ========================================================= */

.learning-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 75vh;
  min-width: 0;
}

.learning-sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 25px;
  min-width: 0;
}

.learning-sidebar h2 {
  overflow-wrap: anywhere;
}

.learning-content {
  padding: 35px;
  min-width: 0;
}

#learning-viewer {
  width: 100%;
  min-width: 0;
  scroll-margin-top: 90px;
}

.learning-resource {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--white);
  min-width: 0;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

/*
 * Resource action buttons are individually clickable.
 * Keep the surrounding resource row from suggesting that
 * the entire card is a button.
 */

.learning-resource:hover {
  border-color: #cbd5e1;
}

.learning-resource.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.learning-resource strong {
  display: block;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.learning-resource .resource-type {
  margin-top: 4px;
}

.learning-resource button {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  min-height: 42px;
}

.learning-resource .resource-action-message {
  overflow-wrap: anywhere;
}

.learning-resource .resource-action-message:empty {
  display: none;
}

.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s ease;
}

/* =========================================================
   VIDEO
   ========================================================= */

.video-wrapper {
  width: 100%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.video-wrapper video {
  width: 100%;
  height: auto;
  max-height: 75vh;
  display: block;
  object-fit: contain;
  background: #000;
}

/* =========================================================
   PDF / FILE VIEWER
   Legacy rules retained for other uses.
   ========================================================= */

.file-viewer {
  width: 100%;
  min-height: 650px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  overflow: hidden;
}

.file-viewer iframe {
  display: block;
  width: 100%;
  height: 650px;
  border: 0;
}

/* =========================================================
   COURSE SHARE
   ========================================================= */

.share-box {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  min-width: 0;
}

.share-box input {
  flex: 1;
  min-width: 0;
}

/* =========================================================
   MEDIUM SCREENS
   ========================================================= */

@media (max-width: 1100px) {
  .learning-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .learning-sidebar {
    padding: 20px;
  }

  .learning-content {
    padding: 25px;
  }

  .course-layout {
    gap: 24px;
  }
}

/* =========================================================
   TABLETS
   ========================================================= */

@media (max-width: 900px) {
  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /*
   * On tablets, stack the course details first, purchase
   * card second, and What's included third.
   * Desktop grid positioning remains unchanged.
   */

  .course-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "main"
      "sidebar"
      "included";
    gap: 25px;
  }

  .course-sidebar {
    position: static;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  /*
   * Keep the admin navigation visible on tablets and
   * mobile devices. Arrange the links in two columns
   * above the main admin content.
   */

  .admin-sidebar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border-bottom: 1px solid var(--border);
  }

  .admin-sidebar a {
    display: flex;
    flex: 1 1 calc(50% - 8px);
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    margin-bottom: 0;
    padding: 10px 8px;
    border-radius: 8px;
    text-align: center;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  .learning-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .learning-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .learning-content {
    padding: 25px;
  }

  .file-viewer {
    min-height: 0;
  }

  .file-viewer iframe {
    height: 70vh;
    min-height: 450px;
  }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {
  .container {
    width: min(100% - 24px, var(--container));
  }

  .navbar {
    min-height: 64px;
    gap: 12px;
  }

  .brand {
    font-size: 17px;
    gap: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a,
  .nav-links button {
    width: 100%;
    text-align: left;
    min-height: 44px;
  }

  .hero {
    padding: 65px 0;
  }

  .hero h1 {
    font-size: clamp(34px, 9vw, 40px);
  }

  .hero p {
    font-size: 17px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .section {
    padding: 50px 0;
  }

  .section-title {
    font-size: 27px;
  }

  .page-title {
    font-size: clamp(29px, 7vw, 38px);
  }

  .course-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .form-container {
    margin: 30px auto;
  }

  .form-card {
    padding: 22px;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 25px;
  }

  .resource-item {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .resource-main {
    align-items: flex-start;
  }

  .resource-actions {
    width: 100%;
  }

  .resource-actions .btn {
    flex: 1 1 120px;
  }

  /* =======================================================
     MOBILE LEARNING INTERFACE
     ======================================================= */

  .learning-layout {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 0;
  }

  .learning-sidebar {
    padding: 18px 14px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .learning-sidebar h2 {
    font-size: 21px !important;
    line-height: 1.35;
  }

  .learning-content {
    padding: 22px 12px;
  }

  #learning-viewer {
    scroll-margin-top: 78px;
  }

  /*
   * Use one column for each resource on a phone.
   * This prevents long titles from squeezing the
   * Open and Download buttons into a narrow space.
   */

  .learning-resource {
    padding: 13px;
    margin-bottom: 10px;
    border-radius: 10px;
  }

  .learning-resource > div:first-child {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px !important;
  }

  .learning-resource > div:first-child > div:first-child {
    min-width: 0 !important;
    width: 100%;
  }

  .learning-resource > div:first-child > div:last-child {
    display: flex;
    width: 100%;
    gap: 8px !important;
    justify-content: flex-start;
    align-items: stretch;
  }

  .learning-resource-open,
  .learning-resource-download {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 9px 10px !important;
    font-size: 13px !important;
    line-height: 1.35;
  }

  .learning-resource strong {
    font-size: 14px;
  }

  .learning-resource .resource-type {
    font-size: 12px;
  }

  .learning-resource .resource-action-message {
    font-size: 12px;
  }

  /* Video sizing */

  .video-wrapper {
    border-radius: 8px;
  }

  .video-wrapper video {
    width: 100%;
    max-height: 65vh;
    object-fit: contain;
  }

  /* Legacy PDF sizing */

  .file-viewer {
    width: 100%;
    min-height: 0;
    border-radius: 8px;
  }

  .file-viewer iframe {
    width: 100%;
    height: 68vh;
    min-height: 400px;
    max-height: 680px;
  }

  /* Buttons under the viewer */

  #learning-viewer .btn {
    min-height: 44px;
  }

  .admin-main {
    padding: 20px 12px;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .share-box {
    flex-direction: column;
  }

  .share-box .btn {
    width: 100%;
  }

  .price-box {
    padding: 20px;
  }

  .empty-state {
    padding: 40px 18px;
  }

  .whatsapp-support {
    width: 52px;
    height: 52px;
    right: 14px;
    bottom: 14px;
  }
}

/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (max-width: 380px) {
  .container {
    width: min(100% - 20px, var(--container));
  }

  .brand {
    font-size: 15px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
  }

  .learning-sidebar {
    padding: 15px 10px;
  }

  .learning-content {
    padding: 18px 10px;
  }

  .learning-resource {
    padding: 11px;
  }

  .learning-resource > div:first-child > div:last-child {
    flex-direction: column;
  }

  .learning-resource-open,
  .learning-resource-download {
    width: 100%;
  }

  .file-viewer iframe {
    height: 65vh;
    min-height: 360px;
  }

  .form-card {
    padding: 17px;
  }
}

/* =========================================================
   TOUCH-SCREEN DEVICES
   ========================================================= */

@media (hover: none) {
  .btn:hover,
  .course-card:hover,
  .whatsapp-support:hover {
    transform: none;
  }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   MOBILE RESOURCE VIEWING EXPERIENCE
   ========================================================= */

.mobile-resource-navigation {
  display: none;
}

@media (max-width: 900px) {
  /*
   * When no resource is open, place the learning content
   * and its "Ready to learn?" placeholder above the list.
   *
   * When a resource is open, keep the viewer above the
   * materials list.
   *
   * These rules apply only to tablet/mobile layouts.
   */

  .learning-layout:not(.resource-opened) .learning-content {
    order: -1;
  }

  .learning-layout.resource-opened .learning-content {
    order: -1;
  }

  .learning-layout.resource-opened .learning-sidebar {
    order: 1;
  }

  .mobile-resource-navigation {
    display: block;
    margin-bottom: 16px;
  }

  .mobile-resource-navigation .btn {
    width: 100%;
    min-height: 46px;
    justify-content: flex-start;
    white-space: normal;
    text-align: left;
  }

  #learning-viewer {
    scroll-margin-top: 82px;
  }
}

/* =========================================================
   CUSTOM PDF.JS VIEWER
   Continuous vertical scrolling through all PDF pages.
   Zoom controls remain available; previous/next controls
   are not styled or required.
   ========================================================= */

.pdf-resource-description {
  margin-bottom: 18px;
}

.pdf-viewer-shell {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #e5e7eb;
}

.pdf-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.pdf-viewer-toolbar .btn {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
}

.pdf-page-status {
  min-width: 100px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.pdf-zoom-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.pdf-zoom-status {
  min-width: 48px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

/*
 * Keep the PDF viewer box at a readable height.
 * The user scrolls vertically inside this box to move
 * through the continuous stack of PDF pages.
 */

.pdf-canvas-container {
  display: block;
  width: 100%;
  height: min(78vh, 900px);
  min-height: 55vh;
  overflow-y: auto;
  overflow-x: auto;
  padding: 12px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

/* The pages are stacked vertically instead of displayed one at a time. */

.pdf-pages-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-width: 100%;
  width: max-content;
}

/* Individual PDF page container. */

.pdf-page-frame {
  flex: 0 0 auto;
  margin-inline: auto;
  background: var(--white);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.16);
}

/* Page label displayed above each PDF page. */

.pdf-page-label {
  padding: 5px 8px;
  background: #f8fafc;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

/* PDF.js canvas for each page. */

.pdf-page-canvas {
  display: block;
  max-width: none;
  background: var(--white);
  user-select: none;
  -webkit-user-select: none;
}

.pdf-page-frame:not(.pdf-page-rendered) .pdf-page-canvas {
  background: var(--white);
}

.pdf-viewer-error {
  margin: 0;
  padding: 0 14px;
  color: #991b1b;
  background: var(--white);
  font-size: 14px;
}

.pdf-viewer-error:not(:empty) {
  padding-top: 12px;
  padding-bottom: 12px;
}

.pdf-viewer-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

/* =========================================================
   MOBILE PDF VIEWER
   ========================================================= */

@media (max-width: 700px) {
  .pdf-viewer-toolbar {
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
  }

  .pdf-page-status {
    flex: 1 1 100%;
    text-align: center;
    order: -1;
  }

  .pdf-viewer-toolbar .btn {
    min-height: 42px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .pdf-zoom-controls {
    width: 100%;
  }

  .pdf-canvas-container {
    height: 70vh;
    min-height: 50vh;
    max-height: 76vh;
    padding: 8px;
  }

  .pdf-pages-container {
    gap: 10px;
  }
}