/* 
 * NOTE: This is a compiled CSS file generated from SCSS source files.
 * All font-family declarations should use $font-family-primary from _variables.scss
 * Source files: main.scss and imported SCSS modules
 */

/* CSS Reset and Root Styles for MFE Isolation */

/* CSS Reset to prevent MFE style conflicts */
.pearson-ead-root {
  /* Set root-level defaults */
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  background-color: #EFEEF7 !important;
  
  /* Prevent MFEs from affecting the root container */
  box-sizing: border-box !important;
  
  /* Reset common problematic properties */
  min-height: initial !important;
  height: initial !important;
  width: initial !important;
  position: initial !important;
  display: initial !important;
  flex: initial !important;
  grid: initial !important;
  
  /* Establish new stacking context */
  z-index: 0;
}

/* Isolate child MFE containers */
.pearson-ead-root [data-single-spa-app] {
  /* Create isolated styling context for each MFE */
  position: relative;
  isolation: isolate;
  contain: style;
}

/* Prevent MFE global styles from leaking to the root */
.pearson-ead-root .mfe-isolation {
  all: initial;
  font-family: inherit;
}

/* Prevent MFE styles from affecting siblings */
.pearson-ead-root > * {
  position: relative;
  z-index: 1;
}

/* Request access app should be below everything */
.pearson-ead-root [data-single-spa-app="@pearson/request-access-app"] {
  z-index: 0 !important;
  position: relative;
}

.pearson-ead-root [data-single-spa-app="@pearson/request-access-app"] * {
  z-index: 0 !important;
}

/* Modal Styles */

/* Base overlay for all modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Base modal container */
.modal-container {
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 24px;
  max-width: 480px;
  min-width: 320px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  text-align: center;
  font-family: inherit;
}

/* Modal title */
.modal-title {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  font-family: inherit;
}

.modal-title.modal-title--error {
  color: #d63031;
}

.modal-title.modal-title--warning {
  color: #fdcb6e;
}

.modal-title.modal-title--success {
  color: #00b894;
}

.modal-title.modal-title--info {
  color: #0066cc;
}

/* Modal message content */
.modal-message {
  margin: 16px 0;
  color: #666;
  line-height: 1.4;
  font-size: 14px;
  font-family: inherit;
}

/* Modal button container */
.modal-buttons {
  margin-top: 20px;
}

/* Base button styles */
.modal-button {
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  margin: 0 8px;
  font-size: 13px;
  font-family: inherit;
  transition: background-color 0.2s ease;
  color: white;
}

.modal-button:hover {
  opacity: 0.9;
}

/* Primary button (OK button) */
.modal-button.modal-button--primary {
  background: #047a9c;
}

.modal-button.modal-button--primary:hover {
  background: #035a7a;
}

/* Error/Retry button */
.modal-button.modal-button--error {
  background: #d63031;
}

.modal-button.modal-button--error:hover {
  background: #b71c1c;
}

/* Warning button */
.modal-button.modal-button--warning {
  background: #fdcb6e;
}

.modal-button.modal-button--warning:hover {
  background: #e1ac3d;
}

/* Success button */
.modal-button.modal-button--success {
  background: #00b894;
}

.modal-button.modal-button--success:hover {
  background: #00a686;
}

/* Info button */
.modal-button.modal-button--info {
  background: #0066cc;
}

.modal-button.modal-button--info:hover {
  background: #004c99;
}

/* Loading modal specific styles */
.modal-loading .modal-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #047a9c;
  border-radius: 50%;
  animation: modal-spin 1s linear infinite;
  margin-bottom: 16px;
}

.modal-loading .modal-loading-message {
  color: #666;
  font-size: 14px;
}

/* Spinner animation */
@keyframes modal-spin {
  0% { 
    transform: rotate(0deg); 
  }
  100% { 
    transform: rotate(360deg); 
  }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .modal-container {
    max-width: 90%;
    min-width: 280px;
    margin: 16px;
  }
}

/* Accessibility improvements */
.modal-overlay:focus-within .modal-container {
  outline: 2px solid #047a9c;
  outline-offset: 2px;
}

.modal-button:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Fallback Service Styles */

/* Base service unavailable component */
.service-unavailable {
  padding: 16px;
  margin: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #ffffff;
  color: #666;
  text-align: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  border-left: 4px solid #d63031;
}

.service-unavailable__title {
  margin: 8px 0;
  color: #d63031;
  font-size: 16px;
  font-weight: 600;
}

.service-unavailable__message {
  margin: 8px 0;
  color: #666;
  font-size: 13px;
  line-height: 1.4;
}

/* Detailed fallback variant */
.service-unavailable--detailed {
  padding: 20px;
}

.service-unavailable--detailed .service-unavailable__icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.service-unavailable--detailed .service-unavailable__error-details {
  margin: 12px 0;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 13px;
  color: #666;
  border-left: 3px solid #fdcb6e;
}

.service-unavailable--detailed .service-unavailable__retry-button {
  margin-top: 16px;
  padding: 8px 16px;
  background: #047a9c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: background-color 0.2s ease;
}

.service-unavailable--detailed .service-unavailable__retry-button:hover {
  background: #035a7a;
}

.service-unavailable--detailed .service-unavailable__retry-button:focus {
  outline: 2px solid #047a9c;
  outline-offset: 2px;
}

/* Service loading component */
.service-loading {
  padding: 20px;
  margin: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #ffffff;
  text-align: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.service-loading__spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #047a9c;
  border-radius: 50%;
  animation: service-spin 1s linear infinite;
  margin-bottom: 12px;
}

.service-loading__title {
  margin: 8px 0;
  color: #047a9c;
  font-size: 16px;
  font-weight: 600;
}

.service-loading__message {
  margin: 8px 0;
  color: #666;
  font-size: 13px;
  line-height: 1.4;
}

/* Spinner animation */
@keyframes service-spin {
  0% { 
    transform: rotate(0deg); 
  }
  100% { 
    transform: rotate(360deg); 
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .service-unavailable,
  .service-loading {
    margin: 8px 0;
  }

  .service-unavailable__title,
  .service-loading__title {
    font-size: 14px;
  }

  .service-unavailable__message,
  .service-loading__message {
    font-size: 12px;
  }
}

/* Animation for when services come back online */
.service-unavailable,
.service-loading {
  transition: all 0.3s ease;
}

.service-unavailable.service-available,
.service-loading.service-available {
  opacity: 0;
  transform: translateY(-10px);
}
