/* PCCOE EXAM HUB - Authentication & Gatekeeper Styles */

/* Anti-FOUC (Flash of Unauthenticated Content) Gatekeeper Rules:
   Hides underlying tool page content by default until user is authenticated via auth.js */
html:not(.pccoe-authenticated) body > :not(#pccoeAuthGatekeeperOverlay):not(script):not(style):not(link),
body:not(.pccoe-authenticated) > :not(#pccoeAuthGatekeeperOverlay):not(script):not(style):not(link) {
  display: none !important;
}

.pccoe-auth-header-bar {
  background: #0f172a;
  color: #f8fafc;
  padding: 6px 4vw;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1e293b;
}

.pccoe-auth-header-bar .brand-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #93c5fd;
  letter-spacing: 0.5px;
}

.pccoe-auth-header-bar .user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pccoe-auth-header-bar .user-pill {
  background: #1e293b;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid #334155;
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.pccoe-auth-header-bar .auth-btn {
  background: #334155;
  color: #f8fafc;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pccoe-auth-header-bar .auth-btn:hover {
  background: #475569;
}

.pccoe-auth-header-bar .auth-btn.logout {
  background: #7f1d1d;
  color: #fecaca;
}

.pccoe-auth-header-bar .auth-btn.logout:hover {
  background: #991b1b;
}

/* Full-Screen Welcome Gatekeeper */
#pccoeAuthGatekeeperOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0f172a;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  z-index: 99999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-y: auto;
}

.pccoe-welcome-box {
  background: #ffffff;
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  padding: 36px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  color: #0f172a;
  text-align: center;
}

.pccoe-welcome-box .banner-logos {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.pccoe-welcome-box .banner-logos img {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.pccoe-welcome-box .trust-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #005691;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.pccoe-welcome-box .college-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: #005691;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin: 2px 0 4px;
}

.pccoe-welcome-box .portal-badge {
  display: inline-block;
  background: #eff6ff;
  color: #1b365d;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  margin-bottom: 18px;
  letter-spacing: 0.5px;
}

.pccoe-auth-input-group {
  margin-bottom: 14px;
  text-align: left;
}

.pccoe-auth-input-group label {
  display: block;
  font-size: 0.80rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 5px;
}

.pccoe-auth-input-group input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.90rem;
  outline: none;
}

.pccoe-auth-input-group input:focus {
  border-color: #1b365d;
  box-shadow: 0 0 0 3px rgba(27, 54, 93, 0.15);
}

.pccoe-auth-submit-btn {
  width: 100%;
  background: #1b365d;
  color: #ffffff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 4px 12px rgba(27, 54, 93, 0.25);
  transition: background 0.15s;
}

.pccoe-auth-submit-btn:hover {
  background: #0f233f;
}

/* =========================================================
   APP LAYOUT & LEFT SIDEBAR NAVIGATION RIBBON
   ========================================================= */
.app-layout {
  display: flex;
  min-height: 100vh;
  background: #f6f5f1;
}

/* Sidebar Ribbon Styling */
.sidebar-ribbon {
  width: 250px;
  background: #0f172a;
  color: #f8fafc;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1.5px solid #1e293b;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 4px 0 16px rgba(0,0,0,0.06);
  z-index: 1000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.sidebar-ribbon .ribbon-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid #1e293b;
}

.sidebar-ribbon .ribbon-brand h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.sidebar-ribbon .ribbon-brand p {
  margin: 4px 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}

.sidebar-ribbon .ribbon-user-card {
  padding: 12px 18px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  font-size: 0.80rem;
}

.sidebar-ribbon .ribbon-user-card .user-email {
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-ribbon .ribbon-user-card .user-role-badge {
  display: inline-block;
  background: #046a38;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-ribbon .ribbon-nav {
  padding: 14px 10px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-ribbon .ribbon-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 10px 4px;
}

.sidebar-ribbon .ribbon-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border: 1px solid transparent;
}

.sidebar-ribbon .ribbon-item:hover {
  background: #1e293b;
  color: #f8fafc;
}

.sidebar-ribbon .ribbon-item.active {
  background: #046a38;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(4, 106, 56, 0.3);
}

.sidebar-ribbon .ribbon-item .ribbon-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-ribbon .ribbon-item .ribbon-icon {
  font-size: 1.1rem;
}

.sidebar-ribbon .ribbon-item .ribbon-count {
  background: #334155;
  color: #cbd5e1;
  font-size: 0.70rem;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 10px;
}

.sidebar-ribbon .ribbon-item.active .ribbon-count {
  background: rgba(255,255,255,0.25);
  color: #ffffff;
}

.sidebar-ribbon .ribbon-footer {
  padding: 14px 16px;
  border-top: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.main-content-area {
  flex: 1;
  min-width: 0;
}

/* Role Matrix Table in Admin Panel */
.role-matrix-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 0.85rem;
}

.role-matrix-table th, .role-matrix-table td {
  border: 1px solid #cbd5e1;
  padding: 10px 12px;
  text-align: center;
  vertical-align: middle;
}

.role-matrix-table th {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
}

.role-matrix-table td.left {
  text-align: left;
}

.role-matrix-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #046a38;
}

/* ==========================================================================
   PROFESSIONAL 3D BUTTONS & INTERACTIVE GUI ANIMATION FRAMEWORK
   ========================================================================== */

:root {
  --pccoe-navy: #1b365d;
  --pccoe-navy-dark: #0f2341;
  --pccoe-green: #046a38;
  --pccoe-green-dark: #024724;
  --pccoe-purple: #6d28d9;
  --pccoe-purple-dark: #4c1d95;
  --pccoe-gold: #cba052;
  --pccoe-gold-dark: #967433;
  --pccoe-red: #dc2626;
  --pccoe-red-dark: #991b1b;
  --pccoe-slate-dark: #cbd5e1;
}

/* Base 3D Button Class */
.btn-3d,
button.btn-3d,
a.btn-3d,
.pccoe-auth-submit-btn,
button.pccoe-auth-submit-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "IBM Plex Mono", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  background: var(--pccoe-navy);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--pccoe-navy-dark), 0 6px 12px rgba(15, 35, 65, 0.18);
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1), filter 0.15s ease, background 0.15s ease;
  overflow: hidden;
}

.btn-3d:hover,
button.btn-3d:hover,
a.btn-3d:hover,
.pccoe-auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--pccoe-navy-dark), 0 10px 20px rgba(15, 35, 65, 0.25);
  filter: brightness(1.06);
  color: #ffffff;
}

.btn-3d:active,
button.btn-3d:active,
a.btn-3d:active,
.pccoe-auth-submit-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--pccoe-navy-dark), 0 2px 4px rgba(15, 35, 65, 0.15);
  filter: brightness(0.96);
}

/* Primary Green 3D Button */
.btn-3d-primary,
button.btn-3d-primary,
a.btn-3d-primary {
  background: linear-gradient(180deg, #058245 0%, #046a38 100%);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--pccoe-green-dark), 0 6px 14px rgba(4, 106, 56, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-3d-primary:hover,
button.btn-3d-primary:hover,
a.btn-3d-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--pccoe-green-dark), 0 10px 20px rgba(4, 106, 56, 0.32);
  filter: brightness(1.08);
  color: #ffffff;
}
.btn-3d-primary:active,
button.btn-3d-primary:active,
a.btn-3d-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--pccoe-green-dark), 0 2px 4px rgba(4, 106, 56, 0.2);
}

/* Secondary / Navy 3D Button */
.btn-3d-secondary,
.btn-3d-navy,
button.btn-3d-secondary,
a.btn-3d-secondary {
  background: linear-gradient(180deg, #244673 0%, #1b365d 100%);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--pccoe-navy-dark), 0 6px 14px rgba(27, 54, 93, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-3d-secondary:hover,
.btn-3d-navy:hover,
button.btn-3d-secondary:hover,
a.btn-3d-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--pccoe-navy-dark), 0 10px 20px rgba(27, 54, 93, 0.32);
  filter: brightness(1.08);
  color: #ffffff;
}
.btn-3d-secondary:active,
.btn-3d-navy:active,
button.btn-3d-secondary:active,
a.btn-3d-secondary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--pccoe-navy-dark), 0 2px 4px rgba(27, 54, 93, 0.2);
}

/* Purple AI 3D Button */
.btn-3d-purple,
button.btn-3d-purple,
a.btn-3d-purple {
  background: linear-gradient(180deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--pccoe-purple-dark), 0 6px 14px rgba(109, 40, 217, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-3d-purple:hover,
button.btn-3d-purple:hover,
a.btn-3d-purple:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--pccoe-purple-dark), 0 10px 20px rgba(109, 40, 217, 0.32);
  filter: brightness(1.08);
  color: #ffffff;
}
.btn-3d-purple:active,
button.btn-3d-purple:active,
a.btn-3d-purple:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--pccoe-purple-dark), 0 2px 4px rgba(109, 40, 217, 0.2);
}

/* Danger / Red 3D Button */
.btn-3d-danger,
button.btn-3d-danger,
a.btn-3d-danger {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--pccoe-red-dark), 0 6px 14px rgba(220, 38, 38, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-3d-danger:hover,
button.btn-3d-danger:hover,
a.btn-3d-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--pccoe-red-dark), 0 10px 20px rgba(220, 38, 38, 0.32);
  filter: brightness(1.08);
  color: #ffffff;
}
.btn-3d-danger:active,
button.btn-3d-danger:active,
a.btn-3d-danger:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--pccoe-red-dark), 0 2px 4px rgba(220, 38, 38, 0.2);
}

/* Light / Slate 3D Button */
.btn-3d-light,
button.btn-3d-light,
a.btn-3d-light {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  color: #1e293b;
  border: 1px solid #cbd5e1;
  box-shadow: 0 3px 0 var(--pccoe-slate-dark), 0 4px 10px rgba(0, 0, 0, 0.06);
}
.btn-3d-light:hover,
button.btn-3d-light:hover,
a.btn-3d-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--pccoe-slate-dark), 0 8px 16px rgba(0, 0, 0, 0.1);
  background: #ffffff;
  color: #0f172a;
}
.btn-3d-light:active,
button.btn-3d-light:active,
a.btn-3d-light:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--pccoe-slate-dark), 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Top Auth Bar 3D Button Refinement */
.pccoe-auth-header-bar .auth-btn {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border: 1px solid #475569;
  box-shadow: 0 2px 0 #0f172a, 0 3px 6px rgba(0,0,0,0.2);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.pccoe-auth-header-bar .auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 0 #0f172a, 0 5px 10px rgba(0,0,0,0.3);
  background: #3b4d66;
}
.pccoe-auth-header-bar .auth-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #0f172a;
}

.pccoe-auth-header-bar .auth-btn.logout {
  background: linear-gradient(180deg, #991b1b 0%, #7f1d1d 100%);
  border: 1px solid #b91c1c;
  box-shadow: 0 2px 0 #450a0a, 0 3px 6px rgba(0,0,0,0.25);
}
.pccoe-auth-header-bar .auth-btn.logout:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 3px 0 #450a0a, 0 5px 10px rgba(185, 28, 28, 0.35);
}

/* 3D Interactive Card Lift for Homepage Grid */
.grid .card {
  position: relative;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.2s ease;
}
.grid .card.active:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 16px 32px -8px rgba(27, 54, 93, 0.14), 0 6px 12px rgba(0, 0, 0, 0.04);
  border-color: #94a3b8;
}
.grid .card .btn {
  box-shadow: 0 3px 0 #000000, 0 4px 8px rgba(0,0,0,0.15);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.grid .card:hover .btn {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #000000, 0 8px 14px rgba(0,0,0,0.25);
}
.grid .card .btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #000000;
}

/* Subtle Shimmer Effect for Primary Action Buttons */
@keyframes pccoeShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.pccoe-shimmer-btn {
  background-size: 200% auto !important;
  background-image: linear-gradient(to right, #046a38 0%, #10b981 50%, #046a38 100%) !important;
  animation: pccoeShimmer 4s infinite linear;
}

/* Smooth Fade In Up Animation */
@keyframes pccoeFadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pccoe-welcome-box,
#pccoeAdminModal > div,
.step,
.step-card {
  animation: pccoeFadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media(max-width: 900px) {
  .app-layout {
    flex-direction: column;
  }
  .sidebar-ribbon {
    width: 100%;
    height: auto;
    position: relative;
  }
}

/* STRICT ZERO-PRINT FOOTPRINT: Hide completely in Print / PDF */
@media print {
  .pccoe-auth-header-bar,
  #pccoeAuthGatekeeperOverlay,
  .sidebar-ribbon,
  .btn-3d,
  .no-print {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
  }
}
