/* =============================================
   BAHANAJAR.CSS — Bahan Ajar Styles
   AkalApp — Platform Pembelajaran Digital
   ============================================= */

/* ================================================
   APP SHELL — Layout
   ================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  padding: var(--sp-6);
  overflow-y: auto;
  min-width: 0; /* fix flexbox overflow */
}

/* ================================================
   APP NAVBAR — Authenticated nav bar
   ================================================ */
.app-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  z-index: var(--z-navbar);
  background: var(--glass-bg-heavy);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: var(--glass-border);
}

.app-navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.app-navbar-left {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.app-navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
}

.app-navbar-links {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.app-navbar-links .nav-link {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: var(--sp-1-5);
}

.app-navbar-links .nav-link.active {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.app-nav-icon {
  font-size: var(--text-sm);
}

.app-navbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* User Menu */
.app-user-menu {
  position: relative;
}

.app-user-trigger {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1-5) var(--sp-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
  border: 1px solid transparent;
}

.app-user-trigger:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border);
}

.app-user-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-user-chevron {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  transition: transform var(--transition-fast);
}

/* User Dropdown */
.app-user-dropdown {
  position: absolute;
  top: calc(100% + var(--sp-2));
  right: 0;
  min-width: 240px;
  background: var(--color-bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--sp-3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transition: all var(--transition-base);
  z-index: var(--z-dropdown);
}

.app-user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.app-user-dropdown-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2);
}

.app-user-dropdown-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

.app-user-dropdown-type {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.app-user-dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--sp-3) 0;
}

.app-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3) var(--sp-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}

.app-user-dropdown-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.app-user-dropdown-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.app-user-dropdown-item:hover svg {
  opacity: 1;
}

.app-user-dropdown-item--logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.app-user-dropdown-item--logout:hover svg {
  stroke: #ef4444;
}

/* Mobile Menu */
.app-mobile-toggle {
  display: none;
}

.app-mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg-card);
  border-bottom: var(--glass-border);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-4);
  flex-direction: column;
}

.app-mobile-nav.open {
  display: flex;
}

.app-mobile-nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.app-mobile-nav-item.active {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.app-mobile-nav-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.app-mobile-nav-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--sp-2) 0;
}

@media (max-width: 767px) {
  .app-navbar-links,
  .app-user-menu {
    display: none;
  }
  .app-mobile-toggle {
    display: flex;
  }
}

/* ================================================
   DASHBOARD STYLES
   ================================================ */
.dashboard-welcome {
  padding: var(--sp-8);
  border-radius: var(--radius-xl);
  margin-bottom: var(--sp-6);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  position: relative;
  overflow: hidden;
}

.dashboard-welcome::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--color-blue-glow) 0%, transparent 70%);
  pointer-events: none;
}

.dashboard-welcome-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--sp-3);
  position: relative;
}

.dashboard-welcome-badges {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
  position: relative;
}

.dashboard-welcome-sub {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  position: relative;
}

/* Dashboard Banners */
.dashboard-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  padding: var(--sp-6);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-6);
  background: var(--color-bg-card);
  border: var(--glass-border);
  animation: fadeSlideIn 0.5s ease;
}

.dashboard-banner-guest {
  border-left: 3px solid var(--color-success);
}

.dashboard-banner-profile {
  border-left: 3px solid var(--color-warning);
}

.dashboard-banner-icon {
  font-size: var(--text-4xl);
  flex-shrink: 0;
}

.dashboard-banner-content h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--sp-1);
}

.dashboard-banner-content p {
  font-size: var(--text-sm);
}

/* Feature Cards Grid */
.dashboard-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-6);
  margin-top: var(--sp-6);
}

.dashboard-feature-card {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: all var(--transition-base);
  animation: fadeSlideIn 0.5s ease both;
}

.dashboard-feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.dashboard-feature-accent {
  border-left: 3px solid transparent;
  border-image: var(--gradient-primary) 1;
}

.dashboard-feature-icon {
  font-size: var(--text-4xl);
  position: relative;
}

.dashboard-feature-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  position: relative;
}

.dashboard-feature-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  position: relative;
}

.dashboard-feature-arrow {
  font-size: var(--text-sm);
  color: var(--color-blue);
  font-weight: var(--weight-medium);
  margin-top: auto;
  position: relative;
  transition: transform var(--transition-fast);
}

.dashboard-feature-card:hover .dashboard-feature-arrow {
  transform: translateX(4px);
}

/* Stats Row */
.dashboard-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.dashboard-stat-card {
  padding: var(--sp-5);
  text-align: center;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
}

.dashboard-stat-icon {
  font-size: var(--text-2xl);
  margin-bottom: var(--sp-2);
}

.dashboard-stat-value {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--sp-1);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

@media (max-width: 639px) {
  .dashboard-stats-row {
    grid-template-columns: 1fr;
  }
  .dashboard-banner {
    flex-direction: column;
    text-align: center;
  }
}

/* ================================================
   BAHAN AJAR — Page Headers
   ================================================ */
.bahan-page-header {
  margin-bottom: var(--sp-8);
}

.bahan-page-header h2 {
  font-size: var(--text-3xl);
  margin-bottom: var(--sp-2);
}

/* Breadcrumb */
.bahan-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}

.bahan-breadcrumb a {
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.bahan-breadcrumb a:hover {
  color: var(--color-blue);
}

.bahan-breadcrumb-sep {
  color: var(--color-text-muted);
  opacity: 0.5;
}

/* ================================================
   SUBJECT CATALOG
   ================================================ */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-6);
}

.subject-card {
  padding: var(--sp-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-4);
  transition: all var(--transition-base);
  border-left: 3px solid transparent;
  animation: fadeSlideIn 0.5s ease both;
}

.subject-card:not(.subject-card-coming) {
  border-image: var(--gradient-primary) 1;
}

.subject-card:not(.subject-card-coming):hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), var(--shadow-glow-blue);
}

.subject-card-coming {
  cursor: default;
  opacity: 0.6;
}

.subject-card-coming:hover {
  transform: none;
  box-shadow: none;
}

.subject-card-icon {
  font-size: 3rem;
  line-height: 1;
}

.subject-card-name {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  position: relative;
}

.subject-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  position: relative;
}

.subject-card-arrow {
  font-size: var(--text-sm);
  color: var(--color-blue);
  font-weight: var(--weight-medium);
  margin-top: auto;
  position: relative;
  transition: transform var(--transition-fast);
}

.subject-card:hover .subject-card-arrow {
  transform: translateX(4px);
}

/* ================================================
   CHAPTER LIST
   ================================================ */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-5);
}

.chapter-card {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: all var(--transition-base);
  animation: fadeSlideIn 0.4s ease both;
}

.chapter-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.chapter-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.chapter-card-bab-num {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-blue-light);
  position: relative;
}

.chapter-card-icon {
  font-size: var(--text-lg);
}

.chapter-card-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  position: relative;
}

.chapter-card-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  position: relative;
}

.chapter-card-arrow {
  font-size: var(--text-sm);
  color: var(--color-blue);
  font-weight: var(--weight-medium);
  margin-top: auto;
  position: relative;
  transition: transform var(--transition-fast);
}

.chapter-card:hover .chapter-card-arrow {
  transform: translateX(4px);
}

/* Chapter Progress */
.chapter-progress {
  height: 4px;
  background: var(--color-bg-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--sp-2);
  position: relative;
}

.chapter-progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
}

.chapter-progress-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--sp-1);
  position: relative;
}

.chapter-badge {
  position: relative;
}

/* ================================================
   SUB-CHAPTER LIST
   ================================================ */
.subchapter-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.subchapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  animation: fadeSlideIn 0.3s ease both;
}

.subchapter-item:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-hover);
  transform: translateX(4px);
}

.subchapter-item-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
  min-width: 0;
}

.subchapter-item-icon {
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.subchapter-item-info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-0-5);
  min-width: 0;
}

.subchapter-item-code {
  font-size: var(--text-xs);
  color: var(--color-blue-light);
  font-weight: var(--weight-semibold);
  font-family: var(--font-mono);
}

.subchapter-item-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subchapter-item-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.subchapter-item-duration {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.subchapter-item-chevron {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  transition: transform var(--transition-fast);
}

.subchapter-item:hover .subchapter-item-chevron {
  transform: translateX(2px);
  color: var(--color-blue);
}

.subchapter-item-lock {
  font-size: var(--text-sm);
  opacity: 0.7;
}

/* Locked sub-chapter */
.subchapter-locked {
  opacity: 0.5;
  cursor: pointer;
}

.subchapter-locked:hover {
  opacity: 0.7;
  transform: none;
  border-color: var(--color-warning);
}

/* Bookmark dot */
.subchapter-bookmark-dot {
  color: #fbbf24;
  font-size: var(--text-xs);
}

/* ================================================
   BAHAN AJAR SIDEBAR
   ================================================ */
.bahan-sidebar {
  width: 280px;
  min-height: calc(100vh - var(--navbar-height));
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: var(--glass-border);
  flex-shrink: 0;
  overflow-y: auto;
  position: sticky;
  top: var(--navbar-height);
  height: calc(100vh - var(--navbar-height));
}

.bahan-sidebar-header {
  padding: var(--sp-5) var(--sp-4);
  border-bottom: var(--glass-border);
}

.bahan-sidebar-back {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.bahan-sidebar-back:hover {
  color: var(--color-blue);
}

.bahan-sidebar-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  margin-top: var(--sp-2);
  color: var(--color-text);
}

.bahan-sidebar-nav {
  padding: var(--sp-2);
}

/* Sidebar items */
.bahan-sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2-5) var(--sp-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.bahan-sidebar-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.bahan-sidebar-item.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-blue-light);
  font-weight: var(--weight-medium);
}

.bahan-sidebar-item.locked {
  opacity: 0.4;
  cursor: default;
}

.bahan-sidebar-chapter-title {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
}

.bahan-sidebar-bab-num {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  min-width: 40px;
}

.bahan-sidebar-bab-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bahan-sidebar-chevron {
  margin-left: auto;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.bahan-sidebar-chapter.expanded .bahan-sidebar-chevron {
  transform: rotate(90deg);
}

.bahan-sidebar-subs {
  display: none;
  padding-left: var(--sp-4);
}

.bahan-sidebar-subs.open {
  display: block;
}

.bahan-sidebar-sub {
  font-size: var(--text-xs);
  padding: var(--sp-2) var(--sp-3);
}

.bahan-sidebar-sub-code {
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  font-size: 10px;
  min-width: 24px;
}

.bahan-sidebar-sub-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bahan-sidebar-lock {
  font-size: 10px;
  margin-left: auto;
}

@media (max-width: 899px) {
  .bahan-sidebar {
    display: none;
  }
}

/* ================================================
   CONTENT VIEWER
   ================================================ */
.content-viewer {
  max-width: var(--container-narrow);
  margin: 0 auto;
}

.content-header {
  margin-bottom: var(--sp-6);
}

.content-header-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.content-title {
  font-size: var(--text-2xl);
}

.content-header-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

/* Content Tabs */
.content-tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--sp-6);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.content-tabs::-webkit-scrollbar {
  display: none;
}

.content-tab {
  display: flex;
  align-items: center;
  gap: var(--sp-1-5);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
}

.content-tab:hover {
  color: var(--color-text-secondary);
}

.content-tab.active {
  color: var(--color-blue-light);
  border-bottom-color: var(--color-blue);
}

.content-tab.locked {
  opacity: 0.4;
}

.content-tab.locked:hover {
  opacity: 0.6;
}

.content-tab-lock-icon {
  font-size: 10px;
}

/* Content Panels */
.content-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.content-panel.active {
  display: block;
}

/* Content Sections */
.content-section {
  margin-bottom: var(--sp-8);
}

.content-section-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--sp-4);
  color: var(--color-text);
}

.content-section-icon {
  font-size: var(--text-lg);
}

.content-section-body {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

.content-section-body p {
  margin-bottom: var(--sp-3);
}

/* Lists */
.content-numbered-list {
  list-style: decimal;
  padding-left: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.content-numbered-list li {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  padding-left: var(--sp-2);
}

.content-numbered-list li::marker {
  color: var(--color-blue-light);
  font-weight: var(--weight-semibold);
}

.content-bullet-list {
  padding-left: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.content-bullet-list li {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  position: relative;
  list-style: none;
  padding-left: var(--sp-4);
}

.content-bullet-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--color-blue);
  font-size: var(--text-xs);
  top: 4px;
}

/* Info Boxes */
.content-infobox {
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  margin: var(--sp-4) 0;
  border: 1px solid var(--color-border);
}

.content-analogi {
  background: rgba(59, 130, 246, 0.05);
  border-left: 3px solid var(--color-blue);
}

.content-definisi {
  background: rgba(139, 92, 246, 0.05);
  border-left: 3px solid var(--color-purple);
}

.content-infobox-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.content-infobox-icon {
  font-size: var(--text-lg);
}

.content-infobox-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.content-infobox-body {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

/* Konsep */
.content-konsep {
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--color-border);
  animation: fadeSlideIn 0.4s ease both;
}

.content-konsep:last-child {
  border-bottom: none;
}

.content-konsep-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--sp-4);
  color: var(--color-text);
}

.content-penjelasan p {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--sp-3);
}

/* Math Block */
.math-block {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  margin: var(--sp-4) 0;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  color: var(--color-text);
  text-align: center;
  overflow-x: auto;
}

.content-formula {
  margin: var(--sp-4) 0;
}

.content-formula-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--sp-2);
}

.content-formula-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--sp-2);
}

/* Table */
.content-table-wrapper {
  overflow-x: auto;
  margin: var(--sp-4) 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.content-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.content-table th {
  background: var(--color-bg-elevated);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.content-table td {
  padding: var(--sp-3) var(--sp-4);
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
}

.content-table tr:last-child td {
  border-bottom: none;
}

.content-table tr:hover td {
  background: var(--color-bg-hover);
}

/* Simulation Placeholder */
.content-simulation-placeholder {
  text-align: center;
  padding: var(--sp-10);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  margin: var(--sp-4) 0;
}

.content-simulation-icon {
  font-size: var(--text-5xl);
  margin-bottom: var(--sp-3);
}

.content-simulation-placeholder h4 {
  font-size: var(--text-lg);
  margin-bottom: var(--sp-2);
}

.content-simulation-placeholder p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Example / Collapsible */
.content-example {
  margin: var(--sp-4) 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.content-example-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-bg-elevated);
  border: none;
  cursor: pointer;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transition: background var(--transition-fast);
}

.content-example-toggle:hover {
  background: var(--color-bg-hover);
}

.content-example-body {
  padding: var(--sp-4);
  border-top: 1px solid var(--color-border);
}

.content-example-question,
.content-example-solution,
.content-example-answer {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--sp-3);
}

.content-example-answer {
  color: var(--color-success-light);
  font-weight: var(--weight-medium);
}

/* Exercise items */
.content-exercises {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.content-exercise-item {
  display: flex;
  gap: var(--sp-4);
}

.content-exercise-num {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
}

.content-exercise-body {
  flex: 1;
}

.content-exercise-question {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--sp-2);
}

.content-exercise-hint {
  padding: var(--sp-3);
  background: rgba(245, 158, 11, 0.05);
  border-left: 2px solid var(--color-warning);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* Key Points */
.content-key-points {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.content-key-point {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

.content-key-point-icon {
  color: var(--color-blue);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Concept Map */
.content-concept-map {
  padding: var(--sp-6);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.content-concept-map-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  justify-content: center;
}

.content-concept-node {
  padding: var(--sp-2) var(--sp-4);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-blue-light);
  font-weight: var(--weight-medium);
}

.content-concept-arrow {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
}

/* Nav Buttons */
.content-nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-top: var(--sp-10);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--color-border);
}

.content-nav-prev,
.content-nav-next {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================================================
   LOCK OVERLAY
   ================================================ */
.lock-overlay {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.lock-overlay-content {
  text-align: center;
  max-width: 400px;
  padding: var(--sp-8);
}

.lock-icon {
  font-size: 4rem;
  margin-bottom: var(--sp-4);
  animation: lockShake 2s ease-in-out infinite;
}

.lock-message-title {
  font-size: var(--text-xl);
  margin-bottom: var(--sp-2);
}

.lock-message-sub {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin-bottom: var(--sp-6);
}

.lock-cta {
  min-width: 200px;
}

/* Tab lock */
.content-tab-lock {
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
}

/* Blurred preview */
.content-blurred-preview {
  position: relative;
  max-height: 200px;
  overflow: hidden;
}

.content-blurred-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(transparent, var(--color-bg));
  pointer-events: none;
}

/* ================================================
   BOOKMARK STYLES
   ================================================ */
.bookmark-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.bookmark-btn-icon {
  font-size: var(--text-xl);
  opacity: 0.4;
  transition: all var(--transition-base);
}

.bookmark-btn:hover {
  border-color: var(--color-border-hover);
  background: var(--color-bg-hover);
}

.bookmark-btn:hover .bookmark-btn-icon {
  opacity: 0.7;
}

.bookmark-btn.active .bookmark-btn-icon {
  opacity: 1;
  filter: saturate(1.5) brightness(1.2);
}

.bookmark-btn.active {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}

/* Bookmark Page */
.bookmark-page-header {
  margin-bottom: var(--sp-6);
}

.bookmark-page-header h2 {
  font-size: var(--text-3xl);
  margin-bottom: var(--sp-1);
}

.bookmark-group {
  margin-bottom: var(--sp-6);
}

.bookmark-group-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--color-border);
}

.bookmark-group-items {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.bookmark-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  animation: fadeSlideIn 0.3s ease both;
}

.bookmark-item:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-sm);
}

.bookmark-item-color {
  width: 4px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  flex-shrink: 0;
}

.bookmark-item-content {
  flex: 1;
  min-width: 0;
}

.bookmark-item-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  margin-bottom: var(--sp-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-item-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.bookmark-item-date {
  opacity: 0.6;
}

.bookmark-item-delete {
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.bookmark-item:hover .bookmark-item-delete {
  opacity: 1;
}

/* Bookmark Empty State */
.bookmark-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 50vh;
  gap: var(--sp-3);
}

.bookmark-empty-icon {
  font-size: 4rem;
  opacity: 0.3;
}

.bookmark-empty h3 {
  font-size: var(--text-xl);
  color: var(--color-text);
}

.bookmark-empty p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 300px;
}

/* ================================================
   MICRO-ANIMATIONS
   ================================================ */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bookmarkBounce {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.3); }
  50% { transform: scale(0.9); }
  70% { transform: scale(1.1); }
}

.bookmark-bounce {
  animation: bookmarkBounce 0.4s ease;
}

@keyframes lockShake {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(-5deg); }
  20% { transform: rotate(5deg); }
  30% { transform: rotate(-3deg); }
  40% { transform: rotate(3deg); }
  50%, 100% { transform: rotate(0deg); }
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 639px) {
  .subject-grid {
    grid-template-columns: 1fr;
  }
  .chapter-grid {
    grid-template-columns: 1fr;
  }
  .content-nav-buttons {
    flex-direction: column;
  }
  .content-nav-prev,
  .content-nav-next {
    max-width: 100%;
    text-align: center;
  }
  .content-header-title-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .app-main {
    padding: var(--sp-4);
  }
  .dashboard-features-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 640px) and (max-width: 899px) {
  .subject-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .chapter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .subject-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
