/* ============================================
   PSIKOTES PPPK SKT — Dashboard Stylesheet
   Theme: Clean White & Royal Blue (Light Mode)
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-overlay: rgba(15, 23, 42, 0.65);

  --accent-gold: #0b57d0; /* Changed to royal blue as requested */
  --accent-gold-light: #2563eb;
  --accent-blue: #0b57d0;
  --accent-blue-light: #2563eb;
  --accent-green: #16a34a;
  --accent-purple: #7c3aed;
  --accent-rose: #e11d48;
  --accent-cyan: #0891b2;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --border-subtle: #e2e8f0;
  --border-card: #cbd5e1;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.05);
  --shadow-card-hover: 0 12px 30px rgba(11, 87, 208, 0.12);
  --shadow-glow-gold: 0 4px 20px rgba(11, 87, 208, 0.25);
  --shadow-glow-blue: 0 4px 20px rgba(11, 87, 208, 0.25);

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Animated background gradient for light mode */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(11, 87, 208, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(37, 99, 235, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(124, 58, 237, 0.02) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
}

.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-logo {
  background: linear-gradient(135deg, #0b57d0, #1e40af);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  font-style: italic;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  letter-spacing: -0.3px;
  box-shadow: 0 4px 12px rgba(11, 87, 208, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  position: relative;
  text-align: center;
  cursor: default;
  user-select: none;
}

.logo-text {
  position: relative;
  z-index: 2;
}

.logo-swoosh {
  width: 90%;
  height: 2px;
  background: #ffffff;
  border-radius: 50%;
  margin-top: 3px;
  position: relative;
  z-index: 2;
  opacity: 0.95;
}

.navbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.navbar-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.navbar-stats {
  display: flex;
  gap: 20px;
  align-items: center;
}

.navbar-stat {
  text-align: center;
}

.navbar-stat-value {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #0b57d0, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---------- Main Container ---------- */
.main-container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* ---------- Hero Section ---------- */
.hero {
  text-align: center;
  padding: 48px 20px 40px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(11, 87, 208, 0.08);
  border: 1px solid rgba(11, 87, 208, 0.2);
  color: #0b57d0;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 50px;
  margin-bottom: 20px;
  animation: fadeInDown 0.6s ease-out;
}

.badge-tag {
  background: #0b57d0;
  color: #ffffff;
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(11, 87, 208, 0.3);
}

.hero-title {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-title .text-gradient {
  background: linear-gradient(135deg, #0f172a, #0b57d0, #2563eb, #0f172a);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

.hero-description {
  font-size: clamp(14px, 2vw, 17px);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* Hero stats row */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #0b57d0;
}

.hero-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ---------- Tab Navigation ---------- */
.tab-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 36px;
  flex-wrap: wrap;
  animation: fadeInUp 0.5s ease-out 0.35s both;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--border-card);
  border-radius: 50px;
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.tab-btn:hover {
  background: #f8fafc;
  color: var(--text-primary);
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.tab-btn.active {
  background: linear-gradient(135deg, #0b57d0, #1d4ed8);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(11, 87, 208, 0.25);
}

.tab-btn .tab-icon {
  font-size: 18px;
}

.tab-btn .tab-count {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
}

.tab-btn.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* ---------- Category Section ---------- */
.category-section {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.category-section.active {
  display: block;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.category-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.category-icon.kecerdasan {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.category-icon.kepribadian {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.category-icon.koran {
  background: rgba(8, 145, 178, 0.1);
  border: 1px solid rgba(8, 145, 178, 0.2);
}

.category-title {
  font-size: 22px;
  font-weight: 700;
}

.category-description {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
  padding-left: 56px;
}

/* ---------- Sub-category ---------- */
.subcategory {
  margin-bottom: 32px;
}

.subcategory-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.subcategory-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.subcategory-title .dot.blue { background: var(--accent-blue); }
.subcategory-title .dot.purple { background: var(--accent-purple); }
.subcategory-title .dot.cyan { background: var(--accent-cyan); }
.subcategory-title .dot.green { background: var(--accent-green); }
.subcategory-title .dot.gold { background: #0b57d0; }
.subcategory-title .dot.rose { background: var(--accent-rose); }
.subcategory-title .dot.teal { background: #0d9488; }
.subcategory-title .dot.amber { background: #d97706; }

/* ---------- Cards Grid ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* ---------- Card ---------- */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition-normal);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.card.blue::before { background: linear-gradient(90deg, #0b57d0, #3b82f6); }
.card.purple::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.card.cyan::before { background: linear-gradient(90deg, #0891b2, #22d3ee); }
.card.green::before { background: linear-gradient(90deg, #16a34a, #4ade80); }
.card.gold::before { background: linear-gradient(90deg, #0b57d0, #2563eb); }
.card.rose::before { background: linear-gradient(90deg, #e11d48, #fb7185); }
.card.teal::before { background: linear-gradient(90deg, #0d9488, #2dd4bf); }
.card.amber::before { background: linear-gradient(90deg, #d97706, #fbbf24); }

.card:hover {
  background: #ffffff;
  border-color: #94a3b8;
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.card.teal:hover {
  border-color: #5eead4;
  box-shadow: 0 12px 30px rgba(13, 148, 136, 0.15);
}

.card.amber:hover {
  border-color: #fcd34d;
  box-shadow: 0 12px 30px rgba(217, 119, 6, 0.15);
}

.card:hover::before {
  opacity: 1;
}

.card:active {
  transform: translateY(-2px) scale(0.985);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-emoji {
  font-size: 32px;
  line-height: 1;
}

.card-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 50px;
  white-space: nowrap;
}

.card-badge.blue {
  background: rgba(11, 87, 208, 0.1);
  color: #0b57d0;
  border: 1px solid rgba(11, 87, 208, 0.25);
}

.card-badge.purple {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.card-badge.cyan {
  background: rgba(8, 145, 178, 0.1);
  color: #0891b2;
  border: 1px solid rgba(8, 145, 178, 0.25);
}

.card-badge.green {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.card-badge.gold {
  background: rgba(11, 87, 208, 0.1);
  color: #0b57d0;
  border: 1px solid rgba(11, 87, 208, 0.25);
}

.card-badge.rose {
  background: rgba(225, 29, 72, 0.1);
  color: #e11d48;
  border: 1px solid rgba(225, 29, 72, 0.25);
}

.card-badge.teal {
  background: #ccfbf1;
  color: #0f766e;
  border: 1px solid #5eead4;
}

.card-badge.amber {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.card-badge.free {
  background: rgba(22, 163, 74, 0.15);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.35);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
  color: var(--text-primary);
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.card-tag {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  color: #64748b;
  font-size: 14px;
}

.card:hover .card-arrow {
  background: #0b57d0;
  color: #ffffff;
  transform: translateX(2px);
}

/* ---------- Modal / Iframe Overlay ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--bg-overlay);
  display: none;
  flex-direction: column;
  animation: fadeIn 0.3s ease-out;
}

.modal-overlay.active {
  display: flex;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.modal-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: linear-gradient(135deg, #0b57d0, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(11, 87, 208, 0.25);
}

.back-label-short { display: none; }
.back-label-full { display: inline; }
.modal-header-spacer { width: 170px; flex-shrink: 0; }

@media (max-width: 768px) {
  .back-label-short { display: inline; }
  .back-label-full { display: none; }
  .modal-header-spacer { display: none; }
}

.modal-back-btn:hover {
  transform: translateX(-2px);
  box-shadow: 0 4px 16px rgba(11, 87, 208, 0.35);
}

.modal-title {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
  text-align: center;
  flex: 1;
  padding: 0 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 20px;
}

.footer a {
  color: #0b57d0;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* Staggered card animation */
.card {
  animation: fadeInUp 0.5s ease-out both;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  /* --- NAVBAR: Premium centered mobile header --- */
  .navbar {
    padding: 0;
    background: linear-gradient(135deg, #0b1a3e, #0b57d0, #1e40af);
    border-bottom: none;
    box-shadow: 0 4px 24px rgba(11, 87, 208, 0.25);
  }

  .navbar-inner {
    height: auto;
    flex-direction: column;
    align-items: center;
    padding: 14px 16px 12px;
    gap: 2px;
  }

  .navbar-brand {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
  }

  .navbar-logo {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    font-size: 11px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  .navbar-title {
    font-size: 15px;
    color: #ffffff;
    text-align: center;
    letter-spacing: -0.2px;
  }

  .navbar-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
  }

  .navbar-stats {
    display: none;
  }

  /* --- HERO section compact --- */
  .main-container {
    padding: 20px 16px 40px;
  }

  .hero {
    padding: 28px 12px 24px;
  }

  .hero-title {
    font-size: clamp(22px, 6vw, 32px);
  }

  .hero-stats {
    gap: 20px;
  }

  .hero-stat-value {
    font-size: 22px;
  }

  /* --- TAB NAV: Vertical stacked elegant cards on mobile --- */
  .tab-nav {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 28px;
  }

  .tab-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 14px;
    border-radius: 14px;
    justify-content: flex-start;
    gap: 12px;
    background: #ffffff;
    border: 1.5px solid var(--border-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
  }

  .tab-btn .tab-count {
    margin-left: auto;
  }

  .tab-btn.active {
    background: linear-gradient(135deg, #0b57d0, #1d4ed8);
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(11, 87, 208, 0.3);
    transform: none;
  }

  .tab-btn:hover {
    transform: none;
  }

  /* --- Cards & sections --- */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card {
    padding: 20px;
  }

  .category-description {
    padding-left: 0;
  }

  .modal-header {
    padding: 8px 10px;
    gap: 8px;
  }

  .modal-back-btn {
    padding: 6px 12px;
    font-size: 11px;
    gap: 4px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .modal-title {
    font-size: 11px;
    padding: 0 4px;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .navbar-inner {
    padding: 12px 14px 10px;
  }

  .navbar-logo {
    font-size: 10px;
    padding: 4px 10px;
  }

  .navbar-title {
    font-size: 14px;
  }

  .tab-btn {
    padding: 13px 16px;
    font-size: 13.5px;
    border-radius: 12px;
  }

  .tab-btn .tab-icon {
    font-size: 18px;
  }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f8fafc;
}::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ---------- Gatekeeper Login Modal (Ultra Premium Glassmorphism) ---------- */
@keyframes gatekeeperPopIn {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes shimmerBar {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.08); }
}

.gatekeeper-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  background: radial-gradient(circle at 50% 20%, rgba(30, 58, 138, 0.45) 0%, rgba(15, 23, 42, 0.88) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.4s ease-out;
}

.gatekeeper-card-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gatekeeper-glow-bg {
  position: absolute;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, rgba(11, 87, 208, 0) 70%);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  animation: pulseGlow 4s ease-in-out infinite;
  pointer-events: none;
}

.gatekeeper-card {
  background: rgba(255, 255, 255, 0.98);
  width: 100%;
  border-radius: 28px;
  padding: 48px 40px;
  box-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.8), 0 0 40px rgba(11, 87, 208, 0.2);
  text-align: center;
  border: 1px solid rgba(226, 232, 240, 0.8);
  position: relative;
  z-index: 2;
  overflow: hidden;
  animation: gatekeeperPopIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gatekeeper-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #0b57d0, #3b82f6, #60a5fa, #1d4ed8, #0b57d0);
  background-size: 200% 100%;
  animation: shimmerBar 3s linear infinite;
}

.gatekeeper-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px auto;
  padding: 8px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(11, 87, 208, 0.08), rgba(30, 64, 175, 0.02));
  box-shadow: 0 10px 25px rgba(11, 87, 208, 0.15);
  transform: scale(1.25);
}

.gatekeeper-logo-wrap .navbar-logo {
  background: linear-gradient(135deg, #0b57d0, #1e40af) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(11, 87, 208, 0.3) !important;
}

.gatekeeper-title {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.gatekeeper-subtitle {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 36px;
  font-weight: 500;
}

.gatekeeper-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gatekeeper-input-wrapper {
  position: relative;
  width: 100%;
}

.gatekeeper-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #0f172a;
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  outline: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.gatekeeper-input::placeholder {
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 1px;
}

.gatekeeper-input:focus {
  border-color: #0b57d0;
  background: #ffffff;
  box-shadow: 0 0 0 6px rgba(11, 87, 208, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.01);
  transform: translateY(-2px);
}

.gatekeeper-btn {
  width: 100%;
  padding: 16px;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #0b57d0 0%, #1d4ed8 50%, #1e40af 100%);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 25px -5px rgba(11, 87, 208, 0.4);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.gatekeeper-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px -5px rgba(11, 87, 208, 0.55);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e3a8a 100%);
}

.gatekeeper-btn:active:not(:disabled) {
  transform: translateY(-1px);
}

.gatekeeper-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
  background: #94a3b8;
  box-shadow: none;
}

.gatekeeper-error {
  margin-top: 6px;
  padding: 14px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 13px;
  font-weight: 700;
  display: none;
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.gatekeeper-footer-note {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #f1f5f9;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.gatekeeper-footer-note a {
  color: #0b57d0;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s;
}

.gatekeeper-footer-note a:hover {
  color: #1e40af;
  text-decoration: underline;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  padding: 6px 16px;
  border-radius: 50px;
  border: 1px solid #bfdbfe;
  box-shadow: 0 2px 8px rgba(11, 87, 208, 0.1);
}

.user-profile-name {
  font-size: 13px;
  font-weight: 800;
  color: #1e40af;
}

.user-logout-btn {
  font-size: 11px;
  font-weight: 800;
  color: #ef4444;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 20px;
  cursor: pointer;
  padding: 4px 10px;
  transition: all 0.2s;
}

.user-logout-btn:hover {
  background: #ef4444;
  color: #ffffff;
  transform: scale(1.05);
}

/* ========== MOBILE PROFILE BANNER ========== */
.mobile-profile-banner {
  display: none;
}

@media (max-width: 768px) {
  .mobile-profile-banner {
    display: block !important;
    background: linear-gradient(135deg, #eff6ff, #e0f2fe);
    border-bottom: 1px solid #bfdbfe;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 99;
  }

  .mobile-profile-banner[style*="display: none"] {
    display: none !important;
  }

  .mobile-profile-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
  }

  .mobile-profile-info {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-profile-icon {
    font-size: 22px;
    background: #ffffff;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #93c5fd;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
    flex-shrink: 0;
  }

  .mobile-profile-name {
    font-size: 13px;
    font-weight: 800;
    color: #1e3a5f;
    line-height: 1.2;
  }

  .mobile-profile-code {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.5px;
  }

  .mobile-logout-btn {
    font-size: 11px;
    font-weight: 800;
    color: #ef4444;
    background: #ffffff;
    border: 1.5px solid #fecaca;
    border-radius: 20px;
    cursor: pointer;
    padding: 6px 14px;
    transition: all 0.2s;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.1);
    flex-shrink: 0;
  }

  .mobile-logout-btn:hover,
  .mobile-logout-btn:active {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
  }
}

/* ========== CARD FOOTER ENHANCEMENTS & HISTORY BUTTON ========== */
.card-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--border-subtle);
  width: 100%;
}

.btn-history {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  z-index: 5;
}

.btn-history:hover {
  background: #1e293b;
  color: #ffffff;
  border-color: #0f172a;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(15, 23, 42, 0.2);
}

.card.blue .btn-history:hover { background: #0b57d0; border-color: #0b57d0; color: #ffffff; box-shadow: 0 6px 15px rgba(11, 87, 208, 0.25); }
.card.gold .btn-history:hover { background: #b45309; border-color: #b45309; color: #ffffff; box-shadow: 0 6px 15px rgba(180, 83, 9, 0.25); }
.card.green .btn-history:hover { background: #15803d; border-color: #15803d; color: #ffffff; box-shadow: 0 6px 15px rgba(21, 128, 61, 0.25); }

.card-start-btn {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s, color 0.2s;
}

.card:hover .card-start-btn {
  color: var(--color-blue);
  transform: translateX(4px);
}

/* ========== GLASSMORPHIC HISTORY & PEMBAHASAN MODAL ========== */
.history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.history-card-box {
  background: #ffffff;
  width: 100%;
  max-width: 820px;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
  animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.history-card-header {
  padding: 24px 32px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.history-card-header h3 {
  font-size: 20px;
  font-weight: 800;
  margin: 4px 0 0;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.history-category-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 3px 10px;
  border-radius: 20px;
}

.history-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.history-close-btn:hover {
  background: rgba(239, 68, 68, 0.9);
  transform: rotate(90deg);
}

.history-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px 32px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}


@keyframes slideUpModal {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.kpi-item {
  background: #ffffff;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 78px;
}

.kpi-label { 
  font-size: 11px; 
  font-weight: 700; 
  color: #64748b; 
  text-transform: uppercase; 
  letter-spacing: 0.5px; 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
}

.kpi-value { 
  font-size: 20px; 
  font-weight: 800; 
  color: #0f172a; 
  margin-top: 4px; 
  white-space: nowrap; 
}

.history-content-scroll {
  padding: 24px 32px;
  overflow-y: auto;
  flex: 1;
}

.history-item-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #22c55e;
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.history-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.08);
  border-color: #cbd5e1;
  border-left: 5px solid #16a34a;
}

.history-attempt-meta { display: flex; flex-direction: column; gap: 6px; }
.history-attempt-title { font-size: 16px; font-weight: 800; color: #0f172a; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.history-attempt-date { font-size: 13px; font-weight: 600; color: #64748b; }
.history-attempt-growth { font-size: 12px; font-weight: 700; color: #0b57d0; background: #eff6ff; padding: 2px 10px; border-radius: 6px; display: inline-block; width: fit-content; margin-top: 2px; }

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f0fdf4;
  color: #15803d;
  font-size: 14px;
  font-weight: 800;
  border-radius: 12px;
  border: 1px solid #bbf7d0;
}

.btn-pembahasan {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  white-space: nowrap;
}

.btn-pembahasan:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
  background: linear-gradient(135deg, #3b82f6, #1e40af);
}

.history-card-footer {
  padding: 18px 32px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pembahasan-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.01);
}
.pembahasan-title { font-size: 16px; font-weight: 800; color: #0f172a; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.pembahasan-text { font-size: 14px; color: #334155; line-height: 1.6; }
.pembahasan-key { display: inline-block; background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; font-weight: 800; padding: 4px 12px; border-radius: 8px; font-size: 13px; }



@media (max-width: 768px) {
  /* --- Gatekeeper Mobile Fix --- */
  .gatekeeper-overlay {
    padding: 16px;
    align-items: flex-start;
    overflow-y: auto;
  }
  
  .gatekeeper-card-container {
    margin: 40px auto;
  }

  .gatekeeper-card {
    padding: 32px 24px;
    border-radius: 24px;
  }

  .history-overlay {
    padding: 16px;
    align-items: center;
  }

  .history-card-box {
    max-height: 90vh;
    border-radius: 20px;
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* --- Header: compact, no truncation --- */
  .history-card-header {
    padding: 14px 16px;
    gap: 8px;
  }

  .history-card-header h3 {
    font-size: 15px;
    margin: 2px 0 0;
    word-break: break-word;
    line-height: 1.25;
  }

  .history-category-tag {
    font-size: 8px;
    letter-spacing: 0.8px;
    padding: 2px 7px;
  }

  .history-close-btn {
    width: 30px;
    height: 30px;
    font-size: 14px;
    flex-shrink: 0;
  }

  /* --- KPI Grid: 2x2, centered, no overflow --- */
  .history-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 10px 14px;
    overflow: hidden;
  }

  .kpi-item {
    padding: 8px 6px;
    border-radius: 10px;
    min-height: auto;
    text-align: center;
    align-items: center;
    overflow: hidden;
    box-sizing: border-box;
  }

  .kpi-label {
    font-size: 7px;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }

  .kpi-value {
    font-size: 12px;
    margin-top: 1px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;
    text-align: center;
  }

  /* --- Scrollable content area --- */
  .history-content-scroll {
    padding: 12px;
  }

  /* --- Attempt cards --- */
  .history-item-card {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 10px;
  }

  .history-attempt-meta {
    gap: 4px;
    width: 100%;
  }

  .history-attempt-title {
    font-size: 13px;
    gap: 6px;
  }

  .score-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 8px;
    line-height: 1.3;
    display: block;
    width: 100%;
    margin-top: 4px;
  }

  .history-attempt-date {
    font-size: 11px;
    line-height: 1.4;
  }

  .history-attempt-growth {
    font-size: 10px;
    padding: 2px 8px;
  }

  /* --- Action buttons inside attempt card --- */
  .btn-pembahasan {
    width: 100%;
    justify-content: center;
    padding: 8px 14px;
    font-size: 11px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
  }

  /* Delete button inside attempt card */
  .history-item-card > div:last-child {
    width: 100%;
    display: flex !important;
    gap: 8px;
  }

  .history-item-card > div:last-child button[title="Hapus catatan ini"] {
    padding: 8px 12px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
  }

  /* --- Footer: compact, responsive --- */
  .history-card-footer {
    padding: 10px 12px;
    gap: 8px;
    flex-direction: column;
  }

  .history-card-footer button,
  .history-card-footer a {
    font-size: 12px;
    padding: 10px 14px;
    width: 100%;
    text-align: center;
    justify-content: center;
    border-radius: 12px;
    box-sizing: border-box;
  }

  /* --- Pembahasan content --- */
  .pembahasan-box {
    padding: 12px;
    border-radius: 10px;
  }

  .pembahasan-title {
    font-size: 13px;
  }

  .pembahasan-text {
    font-size: 12px;
  }

  .pembahasan-key {
    font-size: 11px;
    padding: 3px 8px;
  }
}