/* ==========================================================================
   ISTQB CT-GenAI Master - Authentication & LMS Management Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Header User Area (Navbar Integration)
   -------------------------------------------------------------------------- */
.auth-user-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 6px;
}

.btn-auth-login {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
  color: #ffffff;
  border: none;
  padding: 7px 15px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
  transition: all var(--transition-fast);
}

.btn-auth-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.user-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 4px 12px 4px 5px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.user-profile-chip:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
}

.user-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  text-transform: uppercase;
}

.user-chip-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-chip-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.badge-role {
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-role-admin {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.badge-role-user {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-expiry {
  color: #b45309;
  font-weight: 600;
}

.btn-header-admin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
  padding: 6px 11px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-header-admin:hover {
  background: #ddd6fe;
  transform: translateY(-1px);
}

.btn-header-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-header-logout:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* --------------------------------------------------------------------------
   2. Auth Modal (Login / Register Tabs)
   -------------------------------------------------------------------------- */
.auth-modal-dialog {
  width: 440px;
  max-width: 94vw;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-tabs-header {
  display: flex;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
}

.auth-tab-btn {
  flex: 1;
  padding: 14px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
  position: relative;
}

.auth-tab-btn.active {
  color: var(--primary);
  background: var(--bg-card);
}

.auth-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.auth-modal-body {
  padding: 24px;
}

.auth-form-group {
  margin-bottom: 16px;
}

.auth-form-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 12px;
  font-size: 0.95rem;
  color: var(--text-subtle);
  pointer-events: none;
}

.auth-form-input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--text-main);
  transition: all var(--transition-fast);
  outline: none;
}

.auth-form-input:focus {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-alert-box {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.45;
  margin-bottom: 16px;
  display: none;
  align-items: flex-start;
  gap: 10px;
}

.auth-alert-box.show {
  display: flex;
}

.auth-alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.auth-alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.auth-alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.auth-alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.btn-auth-submit {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(37, 99, 235, 0.4);
}

.btn-auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* --------------------------------------------------------------------------
   3. Admin Management Modal
   -------------------------------------------------------------------------- */
.admin-modal-dialog {
  width: 1100px;
  max-width: 96vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-modal-header {
  padding: 16px 24px;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 800;
}

.admin-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
}

.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-stat-info h5 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 3px;
}

.admin-stat-info .num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}

.admin-stat-icon {
  font-size: 1.6rem;
  opacity: 0.85;
}

.admin-filter-bar {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
}

.admin-search-input {
  flex: 1;
  max-width: 380px;
  padding: 8px 14px 8px 36px;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  outline: none;
}

.admin-table-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 24px;
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.admin-users-table th {
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 2px solid var(--border-color);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-users-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.admin-users-table tr:hover {
  background: var(--bg-card-hover);
}

/* User status badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
}

.status-pill.pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  animation: pulseAmber 2s infinite;
}

.status-pill.active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.status-pill.blocked {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.status-pill.expired {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

@keyframes pulseAmber {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Admin action buttons */
.admin-actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-act-approve {
  background: #10b981;
  color: #ffffff;
}

.btn-act-approve:hover {
  background: #059669;
}

.btn-act-dropdown {
  background: #e0e7ff;
  color: #3730a3;
}

.btn-act-dropdown:hover {
  background: #c7d2fe;
}

.btn-act-block {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.btn-act-block:hover {
  background: #fca5a5;
  color: #991b1b;
}

.btn-act-unblock {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.btn-act-unblock:hover {
  background: #d1fae5;
}

.btn-act-del {
  background: transparent;
  color: #ef4444;
  border: 1px solid #fecaca;
  padding: 4px 7px;
}

.btn-act-del:hover {
  background: #dc2626;
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   4. Unlearned & Learned Progress Indicators
   -------------------------------------------------------------------------- */
.unlearned-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.celebrate-toast {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
  color: #ffffff !important;
  border: 1px solid #34d399 !important;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4) !important;
  animation: celebrateBounce 0.4s ease;
}

@keyframes celebrateBounce {
  0% { transform: scale(0.8) translateY(20px); opacity: 0; }
  60% { transform: scale(1.05) translateY(-4px); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* --------------------------------------------------------------------------
   5. Mandatory Access Gate & Single Session Lock Screen
   -------------------------------------------------------------------------- */
.gate-lock-screen {
  min-height: calc(100vh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #eff6ff 0%, #cbd5e1 100%);
  padding: 40px 16px;
  box-sizing: border-box;
}

[data-theme="dark"] .gate-lock-screen {
  background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0b1120 100%);
}

.gate-card {
  width: 480px;
  max-width: 95vw;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gate-header {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #ffffff;
  padding: 26px 20px;
  text-align: center;
}

.gate-icon-badge {
  font-size: 2.8rem;
  margin-bottom: 6px;
  display: inline-block;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.3));
}

.gate-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 6px 0;
  letter-spacing: -0.3px;
}

.gate-subtitle {
  font-size: 0.83rem;
  opacity: 0.88;
  line-height: 1.45;
  margin: 0;
}

.gate-body {
  padding: 24px;
}

.gate-kicked-banner {
  background: #fef2f2;
  border: 2px solid #ef4444;
  border-radius: 10px;
  color: #991b1b;
  padding: 14px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: pulseKicked 2s infinite;
}

.kicked-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.gate-tabs {
  display: flex;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
}

.gate-tab {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.gate-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.gate-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.gate-support-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gate-admin-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.gate-admin-link:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

@keyframes pulseKicked {
  0%, 100% { border-color: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { border-color: #b91c1c; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.15); }
}

/* Mobile responsive gate */
@media (max-width: 768px), (pointer: coarse) and (max-width: 900px) {
  .gate-lock-screen {
    padding: 16px 10px 40px 10px;
    align-items: flex-start;
  }

  .gate-card {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-md);
  }

  .gate-header {
    padding: 20px 14px;
  }

  .gate-icon-badge {
    font-size: 2.2rem;
  }

  .gate-title {
    font-size: 1.15rem;
  }

  .gate-subtitle {
    font-size: 0.8rem;
  }

  .gate-body {
    padding: 16px 14px;
  }

  .auth-form-input {
    height: 48px;
    font-size: 16px !important;
  }

  .btn-auth-submit {
    height: 48px;
    font-size: 0.95rem;
  }

  .gate-tab {
    padding: 10px 8px;
    font-size: 0.85rem;
  }
}


