/* ==========================================================================
   Design System & Base Theme: Modern Educational Dashboard
   Project: คลังสื่อการเรียนรู้ผลงานต้นแบบ
   ========================================================================== */

:root {
  /* Primary & Accent Color Palette */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-500: #6366f1;
  --primary-600: #4f46e5; /* Main Brand Indigo */
  --primary-700: #4338ca;
  --primary-900: #1e1b4b; /* Deep Indigo / Blue */

  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  /* Neutral Surface & Background Colors */
  --bg-slate: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;

  /* Elevation Shadows & Glassmorphism */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.3);

  /* Border Radii */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global Base Settings */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Prompt', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-slate);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Container Utilities */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Utility Typography & Helpers */
.gradient-text {
  background: linear-gradient(135deg, #a5b4fc 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-indigo { color: var(--primary-600); }
.text-amber { color: var(--accent-amber); }
.text-cyan { color: var(--accent-cyan); }
.text-rose { color: var(--accent-rose); }
.text-emerald { color: var(--accent-emerald); }
.text-light { color: var(--text-light); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }

.hidden { display: none !important; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.pb-0 { padding-bottom: 0 !important; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.d-block { display: block; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

/* Buttons & Interactive Elements */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
  gap: 0.4rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(79, 70, 229, 0.4);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background-color: var(--primary-50);
  border-color: var(--primary-500);
  color: var(--primary-600);
}

/* Unified Glassmorphism Navbar Button Styles */
.btn-outline-nav,
.btn-outline-checklist,
.btn-admin {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-radius: var(--radius-full);
  font-weight: 500;
  backdrop-filter: blur(8px);
  box-shadow: none;
}

.btn-outline-nav:hover,
.btn-outline-checklist:hover,
.btn-admin:hover {
  background: #ffffff;
  color: var(--primary-900);
  border-color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Unified Admin Toolbar Button Style */
.btn-admin-tool {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.55rem 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.btn-admin-tool:hover {
  background: var(--primary-600);
  color: #ffffff;
  border-color: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-admin-tool:hover i {
  color: #ffffff !important;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background-color: var(--primary-50);
  color: var(--primary-600);
}

.btn-emerald {
  background-color: #059669;
  color: #ffffff;
}
.btn-emerald:hover {
  background-color: #047857;
}

.btn-success {
  background-color: var(--accent-emerald);
  color: #ffffff;
}
.btn-success:hover {
  background-color: #059669;
  transform: translateY(-1px);
}

.btn-light {
  background-color: #ffffff;
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-light:hover {
  background-color: var(--bg-slate);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.825rem;
  border-radius: var(--radius-sm);
}

/* Navbar Layout */
.navbar {
  background-color: var(--primary-900);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: #ffffff;
}

.brand-icon {
  width: 2.6rem;
  height: 2.6rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--primary-500));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Admin Banner */
.admin-banner {
  background: linear-gradient(90deg, #312e81, #4338ca);
  color: #ffffff;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}

/* Hero Section */
.hero-section {
  position: relative;
  background: radial-gradient(circle at 50% 0%, #2e1065 0%, #1e1b4b 70%, #0f172a 100%);
  color: #ffffff;
  padding: 4rem 0 3.5rem 0;
  text-align: center;
  overflow: hidden;
}

.hero-bg-accent {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 350px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(6, 182, 212, 0) 70%);
  pointer-events: none;
}

.hero-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
  max-width: 900px;
}

.hero-description {
  font-size: 1.05rem;
  color: #cbd5e1;
  max-width: 750px;
  font-weight: 300;
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.stat-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
}

.stat-chip.clickable-chip:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}

.stat-chip.highlight-chip {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
}
.stat-chip.highlight-chip:hover {
  background: rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
}

.stat-chip span {
  font-weight: 700;
  font-size: 1.05rem;
}

/* Average Rating Summary Breakdown Modal */
.rating-overall-hero {
  background: linear-gradient(135deg, var(--primary-900), #1e1b4b);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.big-score-num {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.big-score-stars {
  font-size: 1.2rem;
  color: var(--accent-amber);
  margin-top: 0.25rem;
}

.dim-score-card {
  background: var(--bg-slate);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
}

.dim-score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.925rem;
}

.dim-score-badge {
  font-weight: 700;
  background: #ffffff;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background-color: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}
.fill-indigo { background: var(--primary-600); }
.fill-amber { background: var(--accent-amber); }
.fill-rose { background: var(--accent-rose); }

.top-rated-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.top-rated-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-slate);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  transition: var(--transition-fast);
}
.top-rated-item:hover {
  background: #ffffff;
  border-color: var(--primary-500);
  transform: translateX(4px);
}

.top-rated-rank {
  font-size: 1.4rem;
  margin-right: 0.75rem;
}

.top-rated-info {
  flex-grow: 1;
  font-size: 0.9rem;
}

.top-rated-score {
  font-weight: 700;
  font-size: 1rem;
}

/* Controls Section (Search & Filter) */
.controls-section {
  margin-top: -1.75rem;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 10;
}

.search-bar-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.75rem 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  max-width: 800px;
  margin: 0 auto 1.5rem auto;
  transition: var(--transition-normal);
}

.search-bar-wrapper:focus-within {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), var(--shadow-lg);
}

.search-icon {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-right: 0.75rem;
}

.search-bar-wrapper input {
  border: none;
  outline: none;
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-main);
  background: transparent;
}

.btn-clear {
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
}
.btn-clear:hover { color: var(--text-main); }

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-normal);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
  background-color: var(--primary-50);
  border-color: var(--primary-500);
  color: var(--primary-600);
}

.filter-btn.active {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Admin Toolbar */
.admin-toolbar {
  background: #ffffff;
  border: 1px dashed var(--primary-500);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.admin-toolbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-toolbar-header h2 {
  font-size: 1.15rem;
  color: var(--primary-900);
}

.admin-toolbar-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Media Section Grid & Cards */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
}

.count-badge {
  background-color: var(--primary-50);
  color: var(--primary-700);
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  border: 1px solid var(--primary-100);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

/* Card Styling */
.media-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
}

.media-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-500);
}

.card-thumbnail-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  background-color: #cbd5e1;
  overflow: hidden;
}

.card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.media-card:hover .card-thumbnail {
  transform: scale(1.05);
}

.card-overlay-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

/* Badges */
.badge {
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
}

.badge-website { background: #3b82f6; color: #ffffff; }
.badge-banner { background: #8b5cf6; color: #ffffff; }
.badge-video { background: #ef4444; color: #ffffff; }
.badge-document { background: #10b981; color: #ffffff; }

.badge-hall-of-fame {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-year-badge {
  font-size: 0.775rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.card-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags-wrapper {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tag-chip {
  background: var(--bg-slate);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* Rating Summary on Card */
.card-rating-box {
  background-color: var(--primary-50);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--primary-100);
}

.rating-score-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.rating-score-num {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-900);
}

.rating-stars-mini {
  color: var(--accent-amber);
  font-size: 0.85rem;
}

.rating-count-text {
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* Card Actions */
.card-footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-slate);
  border-top: 1px solid var(--border-color);
}

.card-admin-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.35rem;
  z-index: 5;
}

.btn-icon-admin {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}
.btn-icon-admin:hover { transform: scale(1.1); }
.btn-icon-admin.edit:hover { background: var(--primary-600); }
.btn-icon-admin.delete:hover { background: var(--accent-rose); }

/* Checklist Boxes in Modal */
.checklist-section-box {
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.checklist-section-box h4 {
  font-size: 1rem;
  color: var(--primary-900);
}

.checklist-question-box {
  background: var(--bg-slate);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.question-title {
  font-size: 1rem;
  font-weight: 700;
  display: block;
}

.question-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  margin-bottom: 0.6rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-color);
  max-width: 600px;
  margin: 2rem auto;
}

.empty-icon {
  font-size: 3rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* Table Custom */
.table-responsive {
  overflow-x: auto;
}

.table-custom {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.table-custom th,
.table-custom td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table-custom th {
  background-color: var(--bg-slate);
  color: var(--text-main);
  font-weight: 600;
}

.add-cat-form {
  background: var(--bg-slate);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

/* Modals & Popups */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  transition: opacity var(--transition-normal);
}

.modal-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-lg { max-width: 900px; }
.modal-sm { max-width: 420px; }

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

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--primary-600);
  font-weight: 500;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-light);
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}
.modal-close:hover {
  background: var(--bg-slate);
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-slate);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Forms in Modal */
.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.form-control {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-row {
  display: flex;
  gap: 1rem;
}
.col-6 { flex: 2; }
.col-3 { flex: 1; }

/* Interactive Star Rating Selector */
.rating-dimension {
  background: var(--bg-slate);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.dimension-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dimension-header label {
  font-size: 0.95rem;
  font-weight: 600;
}

.rating-val-badge {
  background: var(--primary-600);
  color: #ffffff;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
}

.dimension-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0.5rem 0;
}

.star-rating-selector {
  display: flex;
  gap: 0.4rem;
  font-size: 1.6rem;
  color: #cbd5e1;
}

.star-btn {
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
}

.star-btn:hover,
.star-btn.active {
  color: var(--accent-amber);
  transform: scale(1.15);
}

.rating-summary-box {
  background: linear-gradient(135deg, var(--primary-900), #312e81);
  color: #ffffff;
  padding: 1rem;
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 1rem;
}

.rating-score-highlight {
  font-size: 1.5rem;
  font-weight: 700;
  color: #38bdf8;
}

/* Rubric Info Card */
.rubric-card {
  display: flex;
  gap: 1rem;
  background: var(--bg-slate);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: var(--radius-md);
}

.rubric-icon {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #ffffff;
  flex-shrink: 0;
}

.icon-indigo { background: var(--primary-600); }
.icon-amber { background: var(--accent-amber); }
.icon-rose { background: var(--accent-rose); }

.rubric-detail h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.rubric-detail ul {
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Alert Boxes */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}
.alert-info {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.alert-danger {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--primary-900);
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  animation: toastSlideIn 0.3s ease;
  border-left: 4px solid var(--accent-cyan);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Media Viewer Embed */
.viewer-content {
  width: 100%;
  min-height: 350px;
  background-color: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-content iframe,
.viewer-content img {
  width: 100%;
  height: 420px;
  object-fit: contain;
  border: none;
}

/* Footer */
.footer {
  background: var(--primary-900);
  color: #a5b4fc;
  padding: 2.5rem 0;
  margin-top: 5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-title {
  font-weight: 700;
  color: #ffffff;
}

.footer-link-btn {
  background: transparent;
  border: none;
  color: #a5b4fc;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.footer-link-btn:hover,
.footer-link:hover { color: #ffffff; }

/* Responsive Rules */
@media (max-width: 768px) {
  .hero-title { font-size: 1.8rem; }
  .hero-stats { flex-direction: column; width: 100%; }
  .stat-chip { justify-content: center; }
  .nav-actions span { display: none; }
  .media-grid { grid-template-columns: 1fr; }
  .card-footer-actions { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; gap: 0; }
  .admin-toolbar-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
}
