/* ==========================================================================
   ISB Simulations Platform Shell Stylesheet
   ========================================================================== */

/* Login Split Page Layout */
.login-wrap {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.login-brand {
  flex: 1 1 50%;
  background-color: var(--legacy-blue);
  color: var(--text-on-dark);
  display: flex;
  align-items: center;
  padding: var(--space-10) var(--space-8);
  box-sizing: border-box;
}

.login-brand-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.login-headline {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-display);
  line-height: var(--leading-display);
  color: var(--text-on-dark);
}

.login-sub {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  line-height: var(--leading-body);
  color: rgba(255, 255, 255, 0.85);
}

.login-form-col {
  flex: 1 1 50%;
  background-color: var(--surface-page);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  box-sizing: border-box;
}

.login-form-container {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-sso-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  border: none;
  background-color: var(--legacy-blue);
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  color: var(--text-on-dark);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--duration-fast) var(--ease-standard);
}

.login-sso-btn:hover {
  background-color: var(--accent-hover);
}

.login-sso-btn:active {
  background-color: var(--accent-press);
}

.login-legal {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  line-height: var(--leading-relaxed);
  color: var(--text-faint);
  margin-top: var(--space-8);
}

/* Modal SSO Authentication Simulator */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(25, 40, 144, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
  backdrop-filter: blur(2px);
}

.modal-box {
  width: 100%;
  max-width: 440px;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
}

.modal-account-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast);
  outline: none;
}

.modal-account-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-sunken);
}

/* Main Layout Shell */
/* Main Layout Shell */
.shell-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

.shell-header {
  height: 52px;
  background-color: rgba(25, 40, 144, 0.98); /* Translucent Legacy Blue */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 100;
}

.shell-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-6);
}

.shell-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1.5) var(--space-4);
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  text-align: left;
  transition: background-color var(--duration-fast), color var(--duration-fast);
}

.shell-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.shell-nav-item-active {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: var(--weight-semibold);
}

.shell-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.shell-profile-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.shell-profile-details {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.25;
}

.shell-profile-email {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.shell-profile-role {
  font-family: var(--font-sans);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: rgba(255, 255, 255, 0.55);
}

.shell-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
}

.shell-logout-btn:hover {
  border-color: #fff;
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

/* App Iframe View Wrapper */
.app-header {
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--surface-page);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* General Layout Dashboard */
.db-container, .ad-container {
  padding: var(--space-8);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  /* Fixed height = viewport minus the 52px header, so the whole content area
     (everything except the header) scrolls as one. Explicit height (not flex:1)
     so it works regardless of the flex chain. */
  height: calc(100vh - 52px);
  overflow-y: auto;
}

.db-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}

.ad-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-6);
  align-items: start;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 880px) {
  /* Login Responsive */
  .login-wrap {
    flex-direction: column;
  }
  
  .login-brand {
    flex: 0 0 200px;
    padding: var(--space-6);
    justify-content: center;
    text-align: center;
  }
  
  .login-brand-inner {
    gap: var(--space-3);
    align-items: center;
  }
  
  .login-headline {
    font-size: var(--text-h2);
    margin: 0;
  }
  
  .login-sub {
    display: none; /* Hide description on mobile banner */
  }
  
  .login-brand-inner .isb-card {
    display: none; /* Hide sticky note on mobile banner */
  }
  
  .login-form-col {
    flex: 1;
    padding: var(--space-6);
  }
  
  /* Shell Layout Mobile responsive headers */
  .shell-header {
    padding: 0 var(--space-3);
  }

  .shell-profile-details {
    display: none; /* Hide profile text on small screens to save header space */
  }

  .shell-nav-item {
    padding: var(--space-1.5) var(--space-2.5);
    font-size: var(--text-xs);
  }
  
  /* Layout Dashboard & Admin responsive grids */
  .db-container, .ad-container {
    padding: var(--space-4);
  }
  
  .ad-grid {
    grid-template-columns: 1fr;
  }
  
  .app-header {
    padding: var(--space-3) var(--space-4);
  }
}

/* ==========================================================================
   ISB Brand Slide Dashboard
   ========================================================================== */
.brand-slide-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: calc(100vh - 52px);
  position: relative;
  overflow: hidden;
  background-color: var(--surface-canvas);
  background-image: linear-gradient(to right, rgba(93, 111, 122, 0.10) 1px, transparent 1px), 
                    linear-gradient(to bottom, rgba(93, 111, 122, 0.10) 1px, transparent 1px);
  background-size: 64px 64px;
  box-sizing: border-box;
  padding: 72px 80px;
}

.brand-slide-content {
  margin-top: auto;
  max-width: 860px;
  z-index: 2;
}

.brand-slide-subtitle {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.brand-slide-headline {
  font-family: 'Reckless', Georgia, serif;
  font-weight: 600;
  font-size: 76px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-heading);
  margin: 0;
}

.brand-slide-description {
  font-family: var(--font-sans);
  font-size: 21px;
  line-height: 1.55;
  color: var(--text-body);
  max-width: 680px;
  margin: 28px 0 0;
}

.brand-slide-sticky {
  position: absolute;
  right: 80px;
  bottom: 96px;
  width: 208px;
  z-index: 3;
}

.brand-slide-footer-line {
  position: absolute;
  left: 0;
  bottom: 64px;
  width: 100%;
  height: 1.5px;
  background: var(--text-muted);
  opacity: 0.4;
  z-index: 1;
}

/* Responsive adjustment for brand slide */
@media (max-width: 880px) {
  .brand-slide-container {
    padding: var(--space-6) var(--space-4);
    justify-content: flex-start;
    min-height: auto;
  }
  .brand-slide-content {
    margin-top: 0;
  }
  .brand-slide-headline {
    font-size: 38px;
    line-height: 1.15;
  }
  .brand-slide-description {
    font-size: 15px;
    margin-top: 16px;
  }
  .brand-slide-sticky {
    position: static;
    margin-top: 32px;
    width: 100%;
    max-width: 240px;
  }
  .brand-slide-footer-line {
    display: none;
  }
}

/* ==========================================================================
   Header Sub-branding & Sandbox Controls
   ========================================================================== */
.shell-subbrand {
  color: #fff;
  font-size: 13px;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.shell-sandbox-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: var(--space-3);
}

@media (max-width: 880px) {
  .shell-subbrand {
    display: none; /* Hide subbrand text on mobile to prevent overlap */
  }
  .shell-header-divider {
    display: none; /* Hide divider on mobile */
  }
  .shell-sandbox-controls {
    margin-left: var(--space-1.5);
  }
  .shell-sandbox-controls .isb-badge {
    display: none; /* Hide badge text on mobile header */
  }
}
