/* ============================================================
   MRMIK Portal - Components CSS
   Buttons, Cards, Navbar, Accordion, Tabs, Progress, Badges
   ============================================================ */

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: 0.01em;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
  border: 2px solid transparent;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::before { opacity: 1; }

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

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: var(--shadow-sm), 0 0 0 0 rgba(59,130,196,0);
}

.btn-primary:hover {
  box-shadow: var(--shadow-md), 0 0 20px rgba(59,130,196,0.3);
  transform: translateY(-1px);
  color: white;
}

/* Secondary Button */
.btn-secondary {
  background: var(--bg-surface);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border);
}

/* Sizes */
.btn-sm {
  padding: 0.375rem var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.875rem var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

.btn-xl {
  padding: 1.125rem var(--space-10);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}

/* Pilar specific buttons */
.btn-pilar1 { background: linear-gradient(135deg, var(--pilar1), #60AEF7); color: white; }
.btn-pilar2 { background: linear-gradient(135deg, var(--pilar2), #4ADE80); color: white; }
.btn-pilar3 { background: linear-gradient(135deg, var(--pilar3), #A78BFA); color: white; }
.btn-pilar4 { background: linear-gradient(135deg, var(--pilar4), #FB923C); color: white; }

.btn-pilar1:hover, .btn-pilar2:hover, .btn-pilar3:hover, .btn-pilar4:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  overflow: hidden;
}

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

.card-body {
  padding: var(--space-6);
}

.card-header {
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--border-light);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-light);
  background: var(--bg-subtle);
}

/* Glass Card */
.card-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .card-glass {
  background: rgba(22, 34, 48, 0.8);
  border: 1px solid rgba(59, 130, 196, 0.1);
}

/* Pilar Cards */
.pilar-card {
  position: relative;
  padding: var(--space-8);
  border-radius: var(--radius-2xl);
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.pilar-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  border-radius: 50%;
  opacity: 0.1;
  transition: transform var(--transition-slow), opacity var(--transition-slow);
}

.pilar-card:hover::before {
  transform: scale(2);
  opacity: 0.15;
}

.pilar-card-1 {
  background: linear-gradient(135deg, var(--pilar1-light) 0%, white 100%);
  border-color: rgba(59, 130, 196, 0.2);
}
.pilar-card-1::before { background: var(--pilar1); top: -20px; right: -20px; }
.pilar-card-1:hover { border-color: var(--pilar1); box-shadow: 0 8px 40px var(--pilar1-glow); transform: translateY(-6px); }

.pilar-card-2 {
  background: linear-gradient(135deg, var(--pilar2-light) 0%, white 100%);
  border-color: rgba(22, 163, 74, 0.2);
}
.pilar-card-2::before { background: var(--pilar2); top: -20px; right: -20px; }
.pilar-card-2:hover { border-color: var(--pilar2); box-shadow: 0 8px 40px var(--pilar2-glow); transform: translateY(-6px); }

.pilar-card-3 {
  background: linear-gradient(135deg, var(--pilar3-light) 0%, white 100%);
  border-color: rgba(124, 58, 237, 0.2);
}
.pilar-card-3::before { background: var(--pilar3); top: -20px; right: -20px; }
.pilar-card-3:hover { border-color: var(--pilar3); box-shadow: 0 8px 40px var(--pilar3-glow); transform: translateY(-6px); }

.pilar-card-4 {
  background: linear-gradient(135deg, var(--pilar4-light) 0%, white 100%);
  border-color: rgba(234, 107, 14, 0.2);
}
.pilar-card-4::before { background: var(--pilar4); top: -20px; right: -20px; }
.pilar-card-4:hover { border-color: var(--pilar4); box-shadow: 0 8px 40px var(--pilar4-glow); transform: translateY(-6px); }

/* ============================================================
   PILAR ICON BADGES
   ============================================================ */
.pilar-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
  flex-shrink: 0;
}

.pilar-icon-1 { background: linear-gradient(135deg, var(--pilar1), #60AEF7); color: white; }
.pilar-icon-2 { background: linear-gradient(135deg, var(--pilar2), #4ADE80); color: white; }
.pilar-icon-3 { background: linear-gradient(135deg, var(--pilar3), #A78BFA); color: white; }
.pilar-icon-4 { background: linear-gradient(135deg, var(--pilar4), #FB923C); color: white; }

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge-primary { background: var(--sky-100); color: var(--primary-dark); }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-error   { background: #FEE2E2; color: #991B1B; }
.badge-purple  { background: #EDE9FE; color: #5B21B6; }
.badge-orange  { background: #FFEDD5; color: #9A3412; }
.badge-gray    { background: var(--gray-100); color: var(--gray-700); }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  z-index: var(--z-sticky);
  transition: all var(--transition-normal);
}

[data-theme="dark"] .navbar {
  background: rgba(15, 25, 35, 0.9);
  border-bottom-color: var(--border);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.navbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--sky-400) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  font-weight: 800;
  font-family: var(--font-heading);
}

.navbar-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.2;
}

.navbar-name span {
  display: block;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--text-muted);
}

/* Main Nav Links */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
  justify-content: center;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-glow);
}

.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-link svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.nav-item:hover .nav-link svg {
  transform: rotate(180deg);
}

/* Mega Menu */
.mega-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 480px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  pointer-events: none;
  z-index: var(--z-dropdown);
}

.nav-item:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

.mega-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.mega-item:hover {
  background: var(--bg-subtle);
}

.mega-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.mega-item-text strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.mega-item-text span {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

/* Navbar Actions */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-3);
  transition: all var(--transition-fast);
  width: 200px;
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  width: 260px;
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-size: var(--text-sm);
  color: var(--text-primary);
  width: 100%;
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-bar svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Theme Toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.theme-toggle:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all var(--transition-fast);
}

@media (max-width: 1024px) {
  .navbar-nav { display: none; }
  .search-bar { display: none; }
  .menu-toggle { display: flex; }
}

/* Mobile Nav Drawer */
.mobile-nav {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-surface);
  z-index: calc(var(--z-sticky) - 1);
  padding: var(--space-6);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
}

.mobile-nav.open {
  transform: translateX(0);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.mobile-nav-link:hover {
  background: var(--primary-glow);
  color: var(--primary);
}

/* ============================================================
   ACCORDION
   ============================================================ */
.accordion {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-surface);
}

.accordion-item {
  border-bottom: 1px solid var(--border-light);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-5) var(--space-6);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.accordion-trigger:hover {
  background: var(--bg-subtle);
}

.accordion-trigger.open {
  background: var(--primary-glow);
}

.accordion-number {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
  font-family: var(--font-heading);
}

.accordion-title {
  flex: 1;
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  font-family: var(--font-heading);
}

.accordion-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.accordion-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.accordion-trigger.open .accordion-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow) cubic-bezier(0, 1, 0, 1);
}

.accordion-content.open {
  max-height: 5000px;
  transition: max-height 1s ease-in-out;
}

.accordion-body {
  padding: var(--space-6);
  border-top: 1px solid var(--border-light);
}

/* ============================================================
   TABS
   ============================================================ */
.tabs-wrapper {
  width: 100%;
}

.tabs-nav {
  display: flex;
  gap: var(--space-1);
  background: var(--bg-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-1);
  margin-bottom: var(--space-6);
  overflow-x: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.5);
}

.tab-btn.active {
  color: var(--primary);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.tab-btn .tab-emoji {
  font-size: 1rem;
}

.tab-panel {
  display: none;
  animation: fadeSlideUp 0.3s ease;
}

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

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   PROGRESS ELEMENTS
   ============================================================ */
.progress-bar-wrap {
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
  height: 8px;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary) 0%, var(--sky-400) 100%);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40px;
  width: 40px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  from { transform: translateX(0); }
  to   { transform: translateX(400px); }
}

/* Progress Ring */
.progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-ring svg { transform: rotate(-90deg); }

.progress-ring-text {
  position: absolute;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 700;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-number {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  font-family: var(--font-heading);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================
   CHECKLIST ITEMS
   ============================================================ */
.checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.checklist-item:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.checklist-item.checked {
  background: #F0FDF4;
  border-color: var(--success);
}

[data-theme="dark"] .checklist-item.checked {
  background: rgba(22, 163, 74, 0.1);
}

.checklist-box {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  margin-top: 1px;
}

.checklist-item.checked .checklist-box {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.checklist-box svg {
  width: 13px;
  height: 13px;
  opacity: 0;
  transform: scale(0);
  transition: all var(--transition-fast);
}

.checklist-item.checked .checklist-box svg {
  opacity: 1;
  transform: scale(1);
}

.checklist-text {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

.checklist-item.checked .checklist-text {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* ============================================================
   FLIP CARDS (DOWS Wawancara)
   ============================================================ */
.flip-card-container {
  perspective: 1200px;
  height: 220px;
}

.flip-card {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
  cursor: pointer;
}

.flip-card-container:hover .flip-card,
.flip-card-container.flipped .flip-card {
  transform: rotateY(180deg);
}

.flip-front, .flip-back {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.flip-front {
  background: linear-gradient(135deg, var(--primary) 0%, var(--sky-400) 100%);
  color: white;
}

.flip-back {
  background: var(--bg-surface);
  border: 2px solid var(--primary);
  transform: rotateY(180deg);
  color: var(--text-primary);
}

/* ============================================================
   QUIZ ELEMENTS
   ============================================================ */
.quiz-question {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-surface);
  text-align: left;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.quiz-option:hover:not(.selected):not(.correct):not(.wrong) {
  border-color: var(--primary);
  background: var(--primary-glow);
  color: var(--primary);
}

.quiz-option.selected {
  border-color: var(--primary);
  background: var(--primary-glow);
  color: var(--primary);
}

.quiz-option.correct {
  border-color: var(--success);
  background: #F0FDF4;
  color: var(--success);
}

.quiz-option.wrong {
  border-color: var(--error);
  background: #FEF2F2;
  color: var(--error);
}

.quiz-option-letter {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.quiz-option.correct .quiz-option-letter { background: var(--success); color: white; }
.quiz-option.wrong   .quiz-option-letter { background: var(--error); color: white; }
.quiz-option.selected .quiz-option-letter { background: var(--primary); color: white; }

.quiz-feedback {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  display: none;
}

.quiz-feedback.show { display: block; }

.quiz-feedback.correct {
  background: #D1FAE5;
  color: #065F46;
  border-left: 4px solid var(--success);
}

.quiz-feedback.wrong {
  background: #FEE2E2;
  color: #991B1B;
  border-left: 4px solid var(--error);
}

/* ============================================================
   STEP INDICATORS
   ============================================================ */
.steps {
  display: flex;
  gap: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--border);
  z-index: 0;
  transition: background var(--transition-normal);
}

.step.completed::after {
  background: linear-gradient(90deg, var(--primary), var(--primary));
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  transition: all var(--transition-normal);
}

.step.active .step-number {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.step.completed .step-number {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-label {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

.step.active .step-label { color: var(--primary); }
.step.completed .step-label { color: var(--success); }

/* ============================================================
   TAGS / FILTERS
   ============================================================ */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  background: var(--bg-surface);
}

.tag:hover { border-color: var(--primary); color: var(--primary); }
.tag.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ============================================================
   INFO BOXES / ALERTS
   ============================================================ */
.info-box {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border-left: 4px solid;
}

.info-box-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.info-box-content {
  flex: 1;
}

.info-box-title {
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

.info-box-text {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.info-box.info {
  background: #EFF8FF;
  border-color: var(--primary);
  color: var(--primary-dark);
}

.info-box.warning {
  background: #FFFBEB;
  border-color: var(--warning);
  color: #92400E;
}

.info-box.success {
  background: #F0FDF4;
  border-color: var(--success);
  color: #065F46;
}

.info-box.danger {
  background: #FEF2F2;
  border-color: var(--error);
  color: #991B1B;
}

[data-theme="dark"] .info-box.info    { background: rgba(59,130,196,0.1); }
[data-theme="dark"] .info-box.warning { background: rgba(217,119,6,0.1); }
[data-theme="dark"] .info-box.success { background: rgba(22,163,74,0.1); }
[data-theme="dark"] .info-box.danger  { background: rgba(220,38,38,0.1); }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-bg-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-bg-shapes span {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

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

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

.footer-brand p {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
  max-width: 300px;
}

.footer-col h4 {
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover { color: var(--primary); }

.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-bottom p {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(16px);
  transition: all var(--transition-normal);
  z-index: var(--z-raised);
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* ============================================================
   PAGE HEADER (inner pages)
   ============================================================ */
.page-header {
  padding: calc(var(--nav-height) + var(--space-12)) 0 var(--space-12);
  position: relative;
  overflow: hidden;
}

.page-header-content {
  position: relative;
  z-index: 2;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

.breadcrumb-sep {
  opacity: 0.4;
}

/* ============================================================
   TABLE STYLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

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

thead {
  background: linear-gradient(90deg, var(--sky-50) 0%, var(--cream-100) 100%);
}

th {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

td {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: top;
}

tr:hover td {
  background: var(--bg-subtle);
}

/* ============================================================
   SEARCH INPUT
   ============================================================ */
.search-input-wrap {
  position: relative;
}

.search-input-wrap svg {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-10);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  font-size: var(--text-base);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ============================================================
   TOOLTIP
   ============================================================ */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-3);
  background: var(--gray-900);
  color: white;
  border-radius: var(--radius);
  font-size: var(--text-xs);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: var(--z-tooltip, 600);
  max-width: 220px;
  white-space: normal;
  text-align: center;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ============================================================
   SIMULATOR ELEMENTS
   ============================================================ */
.sim-step {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-normal);
  background: var(--bg-surface);
}

.sim-step:hover:not(.sim-step-locked) {
  border-color: var(--primary);
  box-shadow: 0 4px 20px var(--primary-glow);
  transform: translateY(-2px);
}

.sim-step.sim-step-active {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-glow), transparent);
}

.sim-step.sim-step-done {
  border-color: var(--success);
  background: rgba(22, 163, 74, 0.05);
}

.sim-step.sim-step-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.sim-step-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  background: var(--bg-subtle);
}

/* ============================================================
   NOTIFICATION / TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
  align-items: center;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--gray-900);
  color: white;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  animation: toastIn 0.3s ease;
  max-width: 400px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   CERTIFICATE
   ============================================================ */
.certificate-preview {
  background: linear-gradient(135deg, #EFF8FF 0%, #FAFAF7 50%, #F5F0E8 100%);
  border: 3px solid var(--primary);
  border-radius: var(--radius-2xl);
  padding: var(--space-12) var(--space-16);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.certificate-preview::before,
.certificate-preview::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.06;
}

.certificate-preview::before {
  width: 300px;
  height: 300px;
  background: var(--primary);
  top: -100px;
  right: -80px;
}

.certificate-preview::after {
  width: 200px;
  height: 200px;
  background: var(--sky-400);
  bottom: -60px;
  left: -40px;
}

/* ============================================================
   MASCOT SYSTEM: SI RUSA ESNAWAN (MASCOT RSAU)
   ============================================================ */
.mascot-guide-card {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-8);
  border-radius: var(--radius-2xl);
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--sky-50) 100%);
  border: 2px solid var(--sky-200);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-8);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .mascot-guide-card {
  background: linear-gradient(135deg, rgba(22, 34, 48, 0.95) 0%, rgba(31, 74, 171, 0.25) 100%);
  border-color: rgba(59, 130, 196, 0.3);
}

.mascot-guide-card.pilar1-theme {
  background: linear-gradient(135deg, var(--pilar1-light) 0%, var(--bg-surface) 100%);
  border-color: rgba(59, 130, 196, 0.3);
}
.mascot-guide-card.pilar2-theme {
  background: linear-gradient(135deg, var(--pilar2-light) 0%, var(--bg-surface) 100%);
  border-color: rgba(22, 163, 74, 0.3);
}
.mascot-guide-card.pilar3-theme {
  background: linear-gradient(135deg, var(--pilar3-light) 0%, var(--bg-surface) 100%);
  border-color: rgba(124, 58, 237, 0.3);
}
.mascot-guide-card.pilar4-theme {
  background: linear-gradient(135deg, var(--pilar4-light) 0%, var(--bg-surface) 100%);
  border-color: rgba(234, 107, 14, 0.3);
}

.mascot-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mascot-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15));
  transition: transform var(--transition-normal);
}

.mascot-img-lg {
  width: 130px;
  height: 130px;
}

.mascot-img-hero {
  width: 170px;
  height: 170px;
  filter: drop-shadow(0 14px 28px rgba(31, 91, 211, 0.25));
}

.mascot-img:hover {
  transform: scale(1.08) rotate(3deg);
}

.mascot-tag {
  background: linear-gradient(135deg, var(--primary), var(--sky-600));
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-top: -6px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.mascot-bubble {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  flex: 1;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .mascot-bubble {
  background: rgba(18, 28, 40, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
}

.mascot-bubble::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 10px solid var(--border-light);
}

.mascot-bubble::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 9px solid var(--bg-surface);
}

[data-theme="dark"] .mascot-bubble::after {
  border-right-color: rgba(18, 28, 40, 0.9);
}

.mascot-title {
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--primary);
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.mascot-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0;
}

/* Floating interactive mascot helper widget */
.mascot-floating-helper {
  position: fixed;
  bottom: calc(var(--space-6) + 54px);
  right: var(--space-6);
  z-index: calc(var(--z-raised) - 1);
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  pointer-events: none;
  transition: all 0.3s ease;
}

.mascot-floating-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--primary);
  box-shadow: var(--shadow-xl), 0 0 20px rgba(59, 130, 196, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.mascot-floating-btn:hover {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: var(--shadow-xl), 0 0 30px rgba(59, 130, 196, 0.5);
  border-color: var(--sky-500);
}

.mascot-floating-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mascot-floating-popover {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-xl);
  max-width: 260px;
  pointer-events: auto;
  display: none;
  animation: bubblePop 0.3s ease forwards;
}

.mascot-floating-popover.show {
  display: block;
}

@media (max-width: 768px) {
  .mascot-guide-card {
    flex-direction: column;
    text-align: center;
    padding: var(--space-5);
  }
  .mascot-bubble::before,
  .mascot-bubble::after {
    display: none;
  }
}
