/* RESET & UTAMA */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  background: #f4f7fe;
  min-height: 100vh;
  color: #2c3e50;
  transition: background 0.3s ease;
}

h1, h2, h3, h4, .logo {
  font-family: 'Outfit', sans-serif;
}

.hidden {
  display: none !important;
}

/* AUTH SCREEN */
.auth-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.1) 0%, rgba(244, 247, 254, 1) 90%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eef2ff;
  color: #4f46e5;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.auth-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 8px;
}

.btn-google-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.google-icon {
  width: 20px;
  height: 20px;
}

/* GLASSMORPHISM */
.app-wrapper {
  padding-bottom: 50px;
}

.glass {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 4%;
  margin: 15px auto;
  width: 90%;
  max-width: 1200px;
  position: sticky;
  top: 15px;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  color: #4f46e5;
}

.logo span {
  color: #ff4757;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 15px;
}

.nav-links a {
  text-decoration: none;
  color: #475569;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 12px;
}

.nav-links a.active {
  background: #4f46e5;
  color: white;
}

.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  padding: 6px 12px 6px 6px;
  border-radius: 30px;
  border: 1px solid #e2e8f0;
}

.user-profile-pill img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  font-weight: bold;
}

.btn-primary {
  background: #4f46e5;
  color: white;
  padding: 10px 20px;
}

.btn-admin {
  background: #10b981;
  color: white;
  padding: 8px 16px;
}

.btn-danger {
  background: #ef4444;
  color: white;
  padding: 8px 16px;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 20px auto;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.hero {
  padding: 40px 35px;
  margin-bottom: 20px;
}

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

.hero-icon {
  font-size: 7rem;
  color: #4f46e5;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  margin-bottom: 20px;
}

.select-filter, .input-select {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-weight: 700;
  background: white;
}

.admin-form {
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-form input, .admin-form textarea, .admin-form select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  background: #ffffff;
}

.score-badge {
  font-size: 2rem;
  font-weight: 800;
  color: #10b981;
}

.timer-box {
  background: #ef4444;
  color: white;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.admin-only {
  display: none !important;
}

body.is-admin .admin-only {
  display: block !important;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-body {
  padding: 18px;
}

.badge-mapel {
  background: #ff4757;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
}

/* SLIDER DI HALAMAN UTAMA (CARD) */
.card .image-slider-container {
  position: relative;
  width: 100%;
  height: 180px;
  background: #e2e8f0;
  overflow: hidden;
}

.image-slider {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  height: 100%;
}

.card .image-slider img {
  min-width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.6);
  color: white;
  padding: 8px 12px;
  border-radius: 50%;
  z-index: 5;
}

.slide-btn.left { left: 8px; }
.slide-btn.right { right: 8px; }

/* MODAL / POPUP UTAMA */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  position: relative;
  border-radius: 20px;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 10;
}

/* SLIDER DI DALAM POPUP MATERI */
.modal-content .image-slider-container {
  width: 100%;
  height: 480px;
  position: relative;
  background: #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin: 15px 0;
}

.modal-content .image-slider {
  display: flex;
  width: 100%;
  height: 100%;
  gap: 0 !important;
  scroll-snap-type: x mandatory;
}

.modal-content .image-slider img {
  min-width: 100% !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain;
  scroll-snap-align: start;
  flex-shrink: 0;
  background-color: #f1f5f9;
}

/* WADAH VIDEO RESPONSIP (ASPECT RATIO 16:9) */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  margin-top: 15px;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}