/* Study Ace Portal Styles */

:root {
  --bg: #070d18;
  --surface: #0e1726;
  --surface-2: #162238;
  --surface-3: #1e2d48;
  --border: #233350;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent-blue: #0080ff;
  --accent-green: #00c988;
  --accent-gold: #f59e0b;
  --radius-md: 12px;
  --radius-lg: 16px;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;
  --border: #cbd5e1;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(14, 23, 38, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.85);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-title {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 201, 136, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 201, 136, 0.3);
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.telegram-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 36px;
  padding: 0 0.85rem;
  border-radius: 10px;
  background: #229ed9;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 12px rgba(34, 158, 217, 0.25);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.telegram-btn:hover {
  background: #1b8ec6;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(34, 158, 217, 0.35);
}

.telegram-btn:active {
  transform: scale(0.97);
}

@media (max-width: 480px) {
  .brand-badge {
    display: none;
  }
  .telegram-btn {
    padding: 0 0.65rem;
    font-size: 0.75rem;
  }
}

.icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  border-color: var(--primary);
  background: var(--surface-3);
}

/* Breadcrumbs */
.breadcrumbs-bar {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
}

.breadcrumbs-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.crumb {
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}

.crumb:hover {
  color: var(--text-main);
}

.crumb.active {
  color: var(--text-main);
  font-weight: 600;
  cursor: default;
}

/* Main Layout */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
}

/* Filter Bar */
.filter-section {
  margin-bottom: 1.5rem;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
}

#searchInput {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.75rem 2.5rem 0.75rem 2.6rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

#searchInput:focus {
  border-color: var(--primary);
}

.clear-btn {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
}

.batch-stats {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Grids & Cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.15rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.card-thumb-link {
  display: block;
  position: relative;
  text-decoration: none;
}

.card-enrolled-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.94);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}

.card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--primary);
}

.card-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.45rem;
}

.card-title-link {
  text-decoration: none;
  color: inherit;
}

.card-title-link:hover .card-title {
  color: var(--primary);
}

.card-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge-primary {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

/* Section Headers & Tabs */
.page-header {
  margin-bottom: 1.25rem;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tab-btn {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: var(--text-main);
  border-color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* List Items (Topics, Videos) */
.list-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.item-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: border-color 0.15s;
}

.item-row:hover {
  border-color: var(--primary);
}

.item-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.item-video-thumb {
  width: 112px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  flex-shrink: 0;
  position: relative;
}

.item-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.item-title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Notes 4-Column Grid & Card UX */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 1024px) {
  .notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .notes-grid {
    grid-template-columns: 1fr;
  }
}

.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 145px;
  transition:
    border-color 0.2s,
    transform 0.2s;
}

.note-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.note-card-top {
  margin-bottom: 0.75rem;
}

.note-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  display: block;
}

.note-card-actions {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.note-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.note-action-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
  background: var(--surface-3);
}

/* Load More Button */
.load-more-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
  padding-bottom: 0.5rem;
}

.btn-load-more {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 140px;
}

.btn-load-more:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--surface-2);
}

.btn-load-more:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

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

.btn-blue {
  background: var(--accent-blue);
  color: #fff;
  height: 44px;
  border-radius: 10px;
}

.btn-blue:hover {
  background: #0070e0;
}

.btn-green {
  background: var(--accent-green);
  color: #fff;
  height: 44px;
  border-radius: 10px;
}

.btn-green:hover {
  background: #00b57a;
}

/* Video Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.video-modal-card {
  width: 100%;
  max-width: 800px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.video-player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-player-container video {
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  display: block;
}

.video-spinner {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  gap: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
}

/* Player Toolbar */
.player-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
}

.player-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.player-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

/* Quality & Speed Controls */
.player-control-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.player-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.player-select {
  background: var(--surface-2);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
  cursor: pointer;
  outline: none;
}

.player-select:focus {
  border-color: var(--primary);
}

.speed-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.speed-btn {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.speed-btn:hover {
  color: var(--text-main);
}

.speed-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.player-duration-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.toolbar-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-main);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toolbar-link-btn:hover {
  background: var(--surface-3);
  color: var(--primary);
  border-color: var(--primary);
}

/* Unplayable URL Overlay */
.video-unplayable-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(9, 13, 22, 0.94);
  z-index: 5;
}

.unplayable-card {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.unplayable-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: var(--accent-gold);
  font-weight: 800;
  font-size: 1rem;
  display: grid;
  place-items: center;
}

.unplayable-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.unplayable-reason {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.unplayable-url-box {
  width: 100%;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.2rem;
}

.unplayable-url-input {
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  padding: 0.5rem 0.65rem;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  outline: none;
}

.unplayable-url-input:focus {
  border-color: var(--primary);
}

.unplayable-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

/* PDF Modal (Specific Mobile-Safe Box) */
.pdf-modal-card {
  width: calc(100vw - 2rem);
  max-width: 340px;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.pdf-tag-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding-right: 2rem;
}

.pdf-badge {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-gold);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.pdf-top-title {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-title {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 2rem;
}

.modal-close-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: var(--surface-3);
}

.pdf-modal-body {
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pdf-golden-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(120, 53, 15, 0.35);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-gold);
  display: grid;
  place-items: center;
  margin-bottom: 0.9rem;
}

.pdf-main-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 0 0.25rem;
}

.pdf-filename-pill {
  margin-top: 0.5rem;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.7rem;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
  margin-top: 1.4rem;
}

/* Loading Skeletons & Spinners */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    var(--surface-3) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (max-width: 600px) {
  .item-row {
    flex-direction: column;
    align-items: stretch;
  }
  .item-video-thumb {
    width: 96px;
    height: 54px;
  }
  .btn {
    width: 100%;
  }
  .player-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Batch View Tabs (All Batches / My Batches) */
.batch-view-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.batch-view-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.batch-view-tab:hover {
  color: var(--text-main);
  border-color: var(--primary);
}

.batch-view-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.batch-tab-count {
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--surface-2);
  color: var(--text-muted);
}

.batch-view-tab.active .batch-tab-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* Batch Card Footer: Blue Price + 100% Free Badge + Study & Enroll Now Buttons */
.card-footer-actions {
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.batch-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.batch-price-free {
  font-size: 1.05rem;
  font-weight: 800;
  color: #3b82f6;
  letter-spacing: -0.01em;
}

[data-theme="light"] .batch-price-free {
  color: #2563eb;
}

.batch-price-strike {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: line-through;
}

.batch-free-pill {
  display: inline-block;
  align-self: flex-start;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
}

.batch-btn-study {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.62rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.batch-btn-study:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  color: #60a5fa;
}

[data-theme="light"] .batch-btn-study:hover {
  color: #2563eb;
}

.batch-btn-enroll {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.68rem 1rem;
  border-radius: 10px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.batch-btn-enroll:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.batch-btn-enroll:active {
  transform: scale(0.985);
}

.batch-btn-enroll.is-enrolled {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(59, 130, 246, 0.55);
  color: #60a5fa;
}

[data-theme="light"] .batch-btn-enroll.is-enrolled {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.batch-btn-enroll.is-enrolled:hover {
  background: rgba(37, 99, 235, 0.22);
}

/* Lecture Actions Group & Secondary Button */
.item-actions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: var(--surface-3);
}

/* Schedule Details View */
.schedule-back-row {
  margin-bottom: 1rem;
}

.schedule-hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.schedule-hero-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex: 1;
}

.schedule-hero-thumb {
  width: 140px;
  height: 80px;
}

.schedule-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.schedule-section {
  margin-top: 1.5rem;
}

.schedule-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

@media (max-width: 600px) {
  .item-actions-group {
    width: 100%;
    flex-direction: column;
  }
  .schedule-hero-card {
    flex-direction: column;
    align-items: stretch;
  }
  .schedule-hero-main {
    flex-direction: column;
    align-items: flex-start;
  }
  .schedule-hero-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

/* DPP Quiz Mode Modal */
.quiz-mode-card {
  width: calc(100vw - 2rem);
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65);
}

.quiz-mode-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.quiz-mode-list {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.quiz-mode-option {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.15rem;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.quiz-mode-option:hover {
  transform: translateY(-2px);
}

.quiz-mode-option.mode-practice {
  border-color: rgba(245, 158, 11, 0.65);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.03));
}

.quiz-mode-option.mode-quiz {
  border-color: rgba(59, 130, 246, 0.65);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.03));
}

.quiz-mode-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.quiz-mode-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.quiz-mode-arrow {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 800;
  flex-shrink: 0;
  color: #fff;
}

.mode-practice .quiz-mode-arrow {
  background: #f59e0b;
}

.mode-quiz .quiz-mode-arrow {
  background: #2563eb;
}

/* DPP Quiz Fullscreen Player */
.quiz-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.quiz-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.quiz-topbar-inner,
.quiz-bottombar-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.quiz-topbar-left,
.quiz-topbar-right,
.quiz-bottom-left,
.quiz-bottom-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quiz-timer-pill {
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.quiz-lang-select {
  background: var(--surface-2);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.38rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.btn-submit-dpp {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid var(--border);
  font-weight: 700;
}

[data-theme="light"] .btn-submit-dpp {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.quiz-body-container {
  flex: 1;
  overflow-y: auto;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.quiz-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.quiz-q-title {
  font-size: 1.05rem;
  font-weight: 800;
}

.quiz-q-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.quiz-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.quiz-badge-section {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.quiz-badge-diff {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.quiz-badge-pos {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.quiz-badge-neg {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.quiz-question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.15rem;
  font-size: 0.96rem;
  line-height: 1.65;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.quiz-question-card img,
.quiz-option-content img,
.quiz-solution-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0.4rem 0;
  background: #fff;
  padding: 0.25rem;
}

.quiz-options-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.quiz-option-btn {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.quiz-option-btn:hover {
  border-color: var(--primary);
}

.quiz-option-btn.selected {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
}

.quiz-option-btn.correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.14);
}

.quiz-option-btn.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.14);
}

.quiz-option-main {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.quiz-option-key {
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.quiz-option-content {
  font-size: 0.92rem;
  line-height: 1.5;
  min-width: 0;
  overflow-x: auto;
}

.quiz-option-indicator {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
}

.quiz-option-btn.selected .quiz-option-indicator {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.quiz-option-btn.correct .quiz-option-indicator {
  border-color: #10b981;
  background: #10b981;
  color: #fff;
}

.quiz-option-btn.wrong .quiz-option-indicator {
  border-color: #ef4444;
  background: #ef4444;
  color: #fff;
}

.quiz-numeric-box {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.quiz-numeric-input {
  flex: 1;
  min-width: 180px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-main);
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
}

.quiz-numeric-input:focus {
  border-color: var(--primary);
}

.quiz-solution-box {
  margin-top: 1.15rem;
  background: var(--surface);
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 12px;
  padding: 1rem;
}

.quiz-solution-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #34d399;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.quiz-solution-body {
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: auto;
}

.quiz-bottombar {
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.icon-btn.bookmarked {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
}

/* Question Palette Modal */
.quiz-palette-card {
  width: calc(100vw - 2rem);
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.quiz-palette-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.quiz-palette-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.dot-answered { background: #10b981; }
.dot-bookmark { background: #f59e0b; }
.dot-current { background: #3b82f6; }
.dot-unanswered { background: var(--surface-3); border: 1px solid var(--border); }

.quiz-palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  padding: 1rem;
  max-height: 55vh;
  overflow-y: auto;
}

.palette-num-btn {
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.palette-num-btn.answered {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
  color: #34d399;
}

.palette-num-btn.bookmarked {
  border-color: #f59e0b;
  box-shadow: inset 0 0 0 1px #f59e0b;
}

.palette-num-btn.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Quiz Result Summary */
.quiz-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}

.quiz-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  text-align: center;
}

.quiz-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
}

.quiz-stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.quiz-review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .quiz-topbar-inner,
  .quiz-bottombar-inner {
    padding: 0.55rem 0.75rem;
  }
  .quiz-bottom-left .btn,
  .quiz-bottom-right .btn {
    width: auto;
  }
}

/* App Footer */
.app-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--surface);
  padding: 1.25rem 1rem;
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
  font-weight: 700;
}

.footer-logo-img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.footer-telegram-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #38bdf8;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-telegram-link:hover {
  color: #0ea5e9;
  text-decoration: underline;
}

[data-theme="light"] .footer-telegram-link {
  color: #0284c7;
}



