/* =========================================================
   TRYOUT UKOM KEPERAWATAN - CORE DESIGN SYSTEM & STYLES
   ========================================================= */

:root {
  /* Official Kemenkes Brand Color Palette Guidelines */
  --kemenkes-turquoise: #00B9AD;       /* Turquoise Gelap - Kepercayaan */
  --kemenkes-lime: #CDDC29;            /* Hijau Kuning - Ramah, hangat, semangat melayani */
  --kemenkes-medium: #60C0D0;          /* Turquoise Medium - Keterbukaan & Modern */
  --kemenkes-gray: #686969;            /* Abu-Abu - Profesionalitas & Intelektualitas */

  --primary: #00B9AD;
  --primary-dark: #00938a;
  --primary-hover: #00a499;
  --primary-light: #e0f7f6;
  --primary-subtle: #f0faf9;
  
  --secondary: #60C0D0;
  --secondary-hover: #4eaec0;
  --secondary-light: #e6f6f9;
  
  --accent: #CDDC29;
  --accent-dark: #b5c418;
  --accent-light: #f8fcdb;

  --background: #f4f8f8;
  --surface: #ffffff;
  --surface-alt: #edf6f6;

  --text-main: #1e293b;
  --text-muted: #686969;
  --text-light: #94a3b8;

  --border: #d1e5e4;
  --border-focus: #00B9AD;

  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #0284c7;
  --info-bg: #e0f2fe;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* App Shell Layout */
#app {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
}

.brand-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-menu {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.menu-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 0.75rem 0.75rem 0.25rem 0.75rem;
  letter-spacing: 0.05em;
}

/* Admin menu items: hidden by default, shown by JS after role check */
.admin-menu-item {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  pointer-events: auto;
  text-decoration: none;
  border: 1px solid transparent;
}

.nav-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  background: var(--surface-alt);
  color: var(--text-muted);
}

.nav-icon-badge svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Individual Colorful Accents per Menu Item */
.nav-item[href="#/dashboard"] .nav-icon-badge { background: #EFF6FF; color: #2563EB; }
.nav-item[href="#/tryout"] .nav-icon-badge { background: #F0FDF4; color: #16A34A; }
.nav-item[href="#/history"] .nav-icon-badge { background: #F5F3FF; color: #7C3AED; }
.nav-item[href="#/analytics"] .nav-icon-badge { background: #FFFBEB; color: #D97706; }
.nav-item[href="#/ranking"] .nav-icon-badge { background: #FDF2F8; color: #DB2777; }
.nav-item[href="#/guide"] .nav-icon-badge { background: #ECFEFF; color: #0891B2; }

.nav-item[href="#/admin/users"] .nav-icon-badge { background: #E6F8F7; color: #00B9AD; }
.nav-item[href="#/admin/questions"] .nav-icon-badge { background: #EEF2FF; color: #4F46E5; }
.nav-item[href="#/admin/blueprints"] .nav-icon-badge { background: #F0FDF4; color: #059669; }
.nav-item[href="#/admin/tryouts"] .nav-icon-badge { background: #FEF2F2; color: #DC2626; }
.nav-item[href="#/admin/results"] .nav-icon-badge { background: #F5F3FF; color: #9333EA; }
.nav-item[href="#/admin/reports"] .nav-icon-badge { background: #FEF3C7; color: #B45309; }
.nav-item[href="#/admin/print"] .nav-icon-badge { background: #EFF6FF; color: #1D4ED8; }
.nav-item[href="#/admin/settings"] .nav-icon-badge { background: #F0FDFA; color: #0D9488; }

.nav-item:hover {
  background-color: var(--surface-alt);
  transform: translateX(4px);
  border-color: var(--border);
}

.nav-item:hover .nav-icon-badge {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.nav-item.active {
  background: linear-gradient(135deg, #00B9AD, #009688) !important;
  color: white !important;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 185, 173, 0.35);
}

.nav-item.active .nav-icon-badge {
  background: rgba(255, 255, 255, 0.22) !important;
  color: white !important;
}

.nav-item.active span {
  color: white !important;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-mini-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.725rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

#sidebar-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-md);
  color: var(--danger);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition-fast);
}

#sidebar-logout-btn:hover {
  background-color: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
  transform: translateY(-1px);
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition);
}

.topbar {
  height: 64px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.content-viewport {
  padding: 1.5rem;
  flex: 1;
}

/* Fullscreen CBT Engine & Login Mode Overlay */
.cbt-mode .sidebar,
.cbt-mode .topbar,
.login-mode .sidebar,
.login-mode .topbar {
  display: none !important;
}

.cbt-mode .main-wrapper,
.login-mode .main-wrapper {
  margin-left: 0 !important;
}

.cbt-mode .content-viewport,
.login-mode .content-viewport {
  padding: 0 !important;
}

/* Fix white strip caused by zoom:0.75 on desktop —
   set the bg on html & body so it covers the full physical screen */
html:has(body.login-mode) {
  background: url('../assets/prodi.png') center center / cover no-repeat;
}
body.login-mode {
  background: url('../assets/prodi.png') center center / cover no-repeat;
  background-attachment: fixed;
}

/* Login wrapper bg already set inline; keep it transparent here */
body.login-mode .content-viewport > div {
  background: transparent !important;
}

