/*
 * Prakantas MyClass portal presentation layer.
 * Visual baseline intentionally follows the proven V2 Skillart/Bootstrap portal:
 * config/portal/templates/portal/base_bootstrap.html
 * Vendor Bootstrap remains version-pinned in the templates; MyClass-specific
 * styling lives here so vendor code and domain logic remain separate.
 */
:root {
  --pmc-navy: #07111f;
  --pmc-blue: #172b66;
  --pmc-blue-2: #315ba8;
  --pmc-orange: #ff9f29;
  --pmc-orange-2: #ffbe55;
  --pmc-bg: #f5f7fb;
  --pmc-text: #111827;
  --pmc-muted: #64748b;
  --pmc-border: #e5e7eb;
  --pmc-white: #ffffff;
  --pmc-radius: 18px;
  --pmc-shadow: 0 18px 45px rgba(15, 23, 42, .10);
  --pmc-sidebar-width: 250px;
  --pmc-header-offset: 116px;
}

html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--pmc-text);
  background:
    radial-gradient(circle at 8% 10%, rgba(255,159,41,.16), transparent 27%),
    radial-gradient(circle at 92% 8%, rgba(49,91,168,.13), transparent 30%),
    linear-gradient(180deg, #fff 0%, #f6f8fb 42%, #eef3f8 100%);
  overflow-x: hidden;
}
a { text-decoration: none; }

/* V2 header language: navy utility bar + white primary header. */
.prakantas-header {
  position: sticky;
  top: 0;
  z-index: 1040;
  box-shadow: 0 14px 34px rgba(7,17,31,.10);
}
.prakantas-topbar {
  min-height: 34px;
  display: flex;
  align-items: center;
  background: var(--pmc-navy);
  color: rgba(255,255,255,.84);
  font-size: 12px;
  font-weight: 700;
}
.prakantas-topbar .environment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,159,41,.18);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 10px;
  font-weight: 900;
}
.prakantas-topbar .environment-pill.prod { background: rgba(34,197,94,.22); }
.prakantas-primary-header {
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid rgba(229,231,235,.95);
}
.prakantas-primary-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.prakantas-logo {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}
.prakantas-logo img {
  display: block;
  width: auto;
  max-width: 210px;
  height: 58px;
  object-fit: contain;
  object-position: left center;
}
.prakantas-logo-fallback {
  display: none;
  color: var(--pmc-navy);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.03em;
}
.prakantas-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.prakantas-user-copy { text-align: right; line-height: 1.15; }
.prakantas-user-copy strong { display: block; color: var(--pmc-navy); font-size: 13px; }
.prakantas-user-copy span { display: block; margin-top: 3px; color: var(--pmc-muted); font-size: 11px; }
.prakantas-menu-toggle {
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pmc-border);
  border-radius: 14px;
  background: #fff;
  color: var(--pmc-navy);
  font-weight: 900;
}

/* V2 responsive offcanvas sidebar pattern. */
.page-shell { min-height: calc(100vh - var(--pmc-header-offset)); }
.page-shell > .row { min-height: calc(100vh - var(--pmc-header-offset)); align-items: flex-start; }
.sidebar {
  --bs-offcanvas-width: min(290px, 86vw);
  width: var(--pmc-sidebar-width);
  background: rgba(255,255,255,.98) !important;
  border-right: 1px solid var(--pmc-border);
  box-shadow: 10px 0 35px rgba(15,23,42,.045);
}
.sidebar .offcanvas-header {
  min-height: 64px;
  border-bottom: 1px solid var(--pmc-border);
}
.sidebar .offcanvas-title { color: var(--pmc-navy); font-size: 16px; font-weight: 900; }
.sidebar .offcanvas-body { display: block; min-width: 0; overflow-y: auto; padding: 16px 10px 20px; }
.sidebar-section-title {
  margin: 16px 10px 8px;
  color: var(--pmc-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.role-context-card {
  margin: 4px 8px 16px;
  padding: 12px;
  border: 1px solid var(--pmc-border);
  border-radius: 14px;
  background: #f8fafc;
}
.role-context-card small {
  display: block;
  color: var(--pmc-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.role-context-card strong { display: block; margin-top: 4px; color: var(--pmc-navy); font-size: 14px; }
.role-context-card span { display: block; margin-top: 3px; color: var(--pmc-muted); font-size: 11px; }
.role-switch-list { display: grid; gap: 4px; margin-top: 8px; }
.role-switch-list a { min-height: auto !important; margin: 0 !important; padding: 6px 8px !important; font-size: 11px !important; }
.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 39px;
  margin: 0 8px 3px;
  padding: 8px 11px;
  overflow: hidden;
  border-radius: 10px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: color .18s ease, background-color .18s ease, transform .18s ease;
}
.sidebar-nav-link .nav-marker {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pmc-orange);
}
.sidebar-nav-link .nav-label { overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav-link:hover {
  color: var(--pmc-blue);
  background: rgba(255,159,41,.13);
  transform: translateX(2px);
}
.sidebar-nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--pmc-blue), var(--pmc-blue-2));
  box-shadow: 0 8px 18px rgba(31,59,115,.18);
}
.sidebar-nav-link.active .nav-marker { background: #fff; }
.sidebar-nav-link.sidebar-nav-child {
  min-height: 31px;
  margin-left: 25px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}
.sidebar-nav-link.sidebar-nav-child .nav-child-marker {
  flex: 0 0 12px;
  color: var(--pmc-orange);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}
.sidebar-nav-link.sidebar-nav-child:hover .nav-child-marker,
.sidebar-nav-link.sidebar-nav-child.active .nav-child-marker {
  color: currentColor;
}

.portal-main { position: relative; min-width: 0; padding: 28px !important; }
.portal-main::before {
  content: "";
  position: absolute;
  top: 24px;
  right: 28px;
  width: 180px;
  height: 180px;
  pointer-events: none;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,159,41,.12), transparent 70%);
}
.portal-main > * { position: relative; z-index: 1; }
.page-context-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 11px 15px;
  border: 1px solid var(--pmc-border);
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 26px rgba(15,23,42,.06);
  color: var(--pmc-muted);
  font-size: 12px;
  font-weight: 800;
}
.page-context-current { color: var(--pmc-text); font-weight: 900; }

/* Cards, tables and controls mirror V2 base_bootstrap semantics. */
.content-card, .card, .stat-card {
  border: 1px solid rgba(229,231,235,.94);
  border-radius: var(--pmc-radius);
  background: rgba(255,255,255,.97);
  box-shadow: var(--pmc-shadow);
}
.content-card { overflow: hidden; }
.content-card::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--pmc-orange), var(--pmc-blue-2));
}
.card-header { background: #fff; border-bottom: 1px solid var(--pmc-border); font-weight: 900; }
.hero-card {
  position: relative;
  overflow: hidden;
  color: #fff;
  border: 0;
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 10%, rgba(255,159,41,.42), transparent 26%),
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.13), transparent 28%),
    linear-gradient(135deg, #07111f 0%, #10264a 48%, #1f3b73 100%);
  box-shadow: 0 26px 80px rgba(7,17,31,.24);
}
.hero-card h1, .hero-card h2, .hero-card p { color: #fff; }
.hero-card .text-muted { color: rgba(255,255,255,.74) !important; }
.prakantas-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(255,159,41,.28);
  border-radius: 999px;
  color: var(--pmc-blue);
  background: rgba(255,159,41,.13);
  font-size: 12px;
  font-weight: 900;
}
.btn { border-radius: 12px; font-weight: 900; }
.btn-primary, .btn-prakantas {
  color: #fff !important;
  border: 0;
  background: linear-gradient(135deg, var(--pmc-orange), var(--pmc-orange-2));
  box-shadow: 0 12px 24px rgba(255,159,41,.24);
}
.btn-outline-primary { color: var(--pmc-blue); border-color: rgba(31,59,115,.35); }
.btn-outline-primary:hover { color: #fff; background: var(--pmc-blue); border-color: var(--pmc-blue); }
.table-responsive {
  overflow: hidden;
  border: 1px solid var(--pmc-border);
  border-radius: 18px;
  background: #fff;
}
.table { margin-bottom: 0; vertical-align: middle; }
.table > :not(caption) > * > * { padding: 14px 16px; }
.table thead th {
  color: #475569;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.badge { border-radius: 999px; padding: 7px 11px; font-weight: 900; }
.text-primary { color: var(--pmc-blue) !important; }
.text-muted { color: var(--pmc-muted) !important; }

.module-card-link { color: inherit; }
.module-card-link:hover .content-card { transform: translateY(-2px); border-color: rgba(49,91,168,.28); }
.content-card { transition: transform .18s ease, border-color .18s ease; }

/* Login reuses the same V2 palette and component language. */
.prakantas-login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 10%, rgba(255,159,41,.18), transparent 28%),
    linear-gradient(135deg, #07111f 0%, #172b66 46%, #f5f7fb 46%, #fff 100%);
}
.login-brand-panel { min-height: 100vh; color: #fff; padding: clamp(32px,6vw,72px); }
.login-brand-panel .prakantas-logo img { max-width: 250px; height: 72px; filter: drop-shadow(0 8px 18px rgba(0,0,0,.12)); }
.login-brand-panel h1 { max-width: 660px; margin-top: 15vh; color: #fff; font-size: clamp(38px,5vw,68px); line-height: 1; letter-spacing: -.05em; }
.login-brand-panel p { max-width: 590px; color: rgba(255,255,255,.76); line-height: 1.75; }
.login-form-panel { min-height: 100vh; display: flex; align-items: center; padding: clamp(28px,6vw,80px); }
.login-card { width: min(100%, 500px); margin: auto; padding: clamp(24px,4vw,42px); }
.form-label { color: #334155; font-size: 13px; font-weight: 900; }
.form-control { min-height: 48px; border-radius: 14px; border-color: #d1d5db; font-weight: 600; }
.form-control:focus { border-color: var(--pmc-orange); box-shadow: 0 0 0 .22rem rgba(255,159,41,.14); }

.prakantas-footer {
  margin-top: 24px;
  padding: 16px 0;
  background: linear-gradient(135deg, #07111f 0%, #172b66 100%);
  color: rgba(255,255,255,.78);
  font-size: 12px;
}
.prakantas-footer h5,
.prakantas-footer h6 {
  color: #fff;
  font-weight: 800;
}
.prakantas-footer a {
  color: rgba(255,255,255,.86);
  text-decoration: none;
}
.prakantas-footer a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer-quick-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
}
.footer-credit {
  line-height: 1.7;
}
@media (min-width: 992px) {
  .footer-credit {
    text-align: right;
  }
}

@media (min-width: 992px) {
  .sidebar {
    position: sticky !important;
    top: var(--pmc-header-offset);
    flex: 0 0 var(--pmc-sidebar-width);
    width: var(--pmc-sidebar-width) !important;
    max-width: var(--pmc-sidebar-width);
    height: calc(100vh - var(--pmc-header-offset));
    visibility: visible !important;
    transform: none !important;
    z-index: 1020;
  }
  .sidebar .offcanvas-header { display: none; }
  .sidebar .offcanvas-body { height: 100%; }
  .page-shell > .row > .sidebar + .portal-main {
    flex: 1 1 0;
    width: auto !important;
    max-width: calc(100% - var(--pmc-sidebar-width));
  }
}

@media (max-width: 991.98px) {
  :root { --pmc-header-offset: 78px; }
  .prakantas-topbar { display: none; }
  .prakantas-primary-inner { min-height: 78px; }
  .prakantas-menu-toggle { display: inline-flex; }
  .prakantas-logo { flex: 1; }
  .prakantas-logo img { max-width: 155px; height: 48px; }
  .prakantas-user-copy { display: none; }
  .sidebar {
    width: var(--bs-offcanvas-width) !important;
    max-width: 86vw;
    height: 100vh;
    z-index: 1055;
  }
  .page-shell > .row > .sidebar + .portal-main { width: 100% !important; max-width: 100%; }
  .portal-main { padding: 18px !important; }
  .prakantas-login-page { background: #f5f7fb; }
  .login-brand-panel { min-height: auto; padding: 28px 24px; background: linear-gradient(135deg, #07111f, #172b66); }
  .login-brand-panel h1 { margin-top: 40px; font-size: 38px; }
  .login-form-panel { min-height: auto; padding: 28px 18px 48px; }
}

@media (max-width: 575.98px) {
  .prakantas-primary-inner { gap: 8px; }
  .prakantas-header-actions { gap: 6px; }
  .prakantas-logo img { max-width: 130px; }
  .environment-pill { max-width: 88px; overflow: hidden; text-overflow: ellipsis; }
  .portal-main { padding: 14px !important; }
  .table > :not(caption) > * > * { padding: 11px 12px; }
}


/* V16.2 — compact portal page headers.
   Normal navbar destinations use the My Profile header footprint so page
   content starts higher without changing page-specific actions or copy. */
.portal-main .hero-card {
  padding: 1.5rem !important;
  border-radius: 22px;
  box-shadow: 0 18px 52px rgba(7,17,31,.18);
}
.portal-main .hero-card h1 {
  margin-bottom: .5rem !important;
  font-size: clamp(1.5rem, 1.8vw, 2rem) !important;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.portal-main .hero-card p {
  margin-bottom: 0;
  line-height: 1.55;
}
.portal-main .hero-card .badge {
  margin-bottom: .75rem !important;
  padding: 6px 10px;
}
.portal-main .hero-card .gap-4 {
  gap: 1rem !important;
}

@media (max-width: 575.98px) {
  .portal-main .hero-card {
    padding: 1.25rem !important;
    border-radius: 18px;
  }
  .portal-main .hero-card h1 {
    font-size: 1.5rem !important;
  }
}
