/* ==========================================================================
   STYLE SISTEM PENILAIAN PRESENTASI KKA (KODING & KECERDASAN ARTIFISIAL) SMK
   Theme: Fresh Cyber Emerald & Elegant Deep Slate
   Responsive: Mobile, Tablet, Laptop, Desktop (All Browsers)
   ========================================================================== */

:root {
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #d1fae5;
  --primary-dark: #064e3b;
  --accent: #0284c7;
  --accent-light: #e0f2fe;
  --secondary: #4f46e5;
  --dark: #0f172a;
  --dark-surface: #1e293b;
  --slate: #334155;
  --light-slate: #64748b;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --border-focus: #10b981;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 6px 12px -6px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.2);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* NAVBAR & HEADER */
.navbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--dark);
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #10b981 0%, #0284c7 100%);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: white;
}

.btn-accent:hover {
  background: #0284c7;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--slate);
}

.btn-outline:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--dark);
}

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}

.btn-danger:hover {
  background: #dc2626;
  color: white;
}

/* HERO SECTION */
.hero {
  background: radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.08) 0%, rgba(2, 132, 199, 0.05) 50%, transparent 80%);
  padding: 2.5rem 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.hero-container {
  max-width: 1280px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.25;
  margin-bottom: 0.6rem;
}

.hero-title span {
  background: linear-gradient(135deg, #059669 0%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 780px;
  margin-bottom: 1.5rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-info .stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.1;
}

.stat-info .stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* MAIN CONTENT */
.main-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  width: 100%;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-head h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--dark);
}

.section-head p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* GROUP CARDS GRID */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.group-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
}

.group-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.group-card-header {
  padding: 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.group-card-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
}

.group-topic {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  margin-top: 0.35rem;
  text-transform: capitalize;
}

.score-badge-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #10b981;
  color: white;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
  flex-shrink: 0;
}

.score-badge-circle .score-num {
  font-size: 1.05rem;
  line-height: 1;
}

.score-badge-circle .score-grade {
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.9;
}

.group-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-box {
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.825rem;
  border-left: 3px solid var(--primary);
}

.product-box strong {
  color: var(--dark);
  display: block;
  margin-bottom: 0.25rem;
}

.members-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.member-chip {
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.member-chip.lead {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: rgba(16, 185, 129, 0.3);
  font-weight: 600;
}

.group-card-footer {
  padding: 0.85rem 1.25rem;
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* TABLES & DATA GRIDS */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: white;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.table th {
  background: #f8fafc;
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--slate);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background-color: #f8fafc;
}

/* FORM ELEMENTS */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

textarea.form-control {
  min-height: 85px;
  resize: vertical;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 750px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  position: relative;
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-head {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

.modal-head h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--light-slate);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.modal-close:hover {
  background: #f1f5f9;
  color: var(--dark);
}

.modal-body {
  padding: 1.5rem;
}

.modal-foot {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #f8fafc;
}

/* AI VALIDATOR CALLOUT */
.ai-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(2, 132, 199, 0.06) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
}

.ai-box-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.6rem;
}

.ai-box-content {
  font-size: 0.875rem;
  color: var(--slate);
  line-height: 1.6;
}

/* TOAST NOTIFICATION */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--dark);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* FOOTER */
.footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.825rem;
  margin-top: auto;
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 768px) {
  .hero-title { font-size: 1.45rem; }
  .groups-grid { grid-template-columns: 1fr; }
  .nav-container { padding: 0.75rem 1rem; }
  .main-wrapper { padding: 1.25rem 1rem; }
  .hero { padding: 1.5rem 1rem 1rem; }
}


/* ==========================================================================
   MEDIA PREVIEW BOX & RESPONSIVE LIGHTBOX MODAL
   ========================================================================== */
.media-card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: #0f172a;
  cursor: pointer;
  border: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.media-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.media-card-preview:hover .media-card-img {
  transform: scale(1.04);
}

.media-hover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.75) 0%, transparent 60%);
  opacity: 0;
  display: flex;
  align-items: flex-end;
  padding: 0.75rem;
  transition: opacity 0.25s ease;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
}

.media-card-preview:hover .media-hover-overlay {
  opacity: 1;
}

.media-badge-tag {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
}

/* LIGHTBOX POP-UP FULLSCREEN */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.lightbox-backdrop.active {
  display: flex;
}

.lightbox-dialog {
  max-width: 92vw;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  animation: zoomIn 0.25s ease;
}

.lightbox-img-wrap {
  max-width: 90vw;
  max-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  background: #000;
}

.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
}

.lightbox-caption-bar {
  margin-top: 0.85rem;
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(6px);
  color: white;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  max-width: 780px;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
}

.lightbox-close-btn {
  position: absolute;
  top: -38px;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lightbox-close-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* RESPONSIVE VIDEO WRAPPER (16:9) */
.video-embed-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #000;
}

.video-embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoomIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
