/* ==============================================================================
   CMSC Modern Responsive Lightbox & Modal Popup
   Replaces legacy DMX Lightbox and Dreamweaver Layer Popups
   ============================================================================== */

.cmsc-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.82);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease-in-out, visibility 0.25s ease-in-out;
}

.cmsc-lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cmsc-lightbox-container {
  position: relative;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-sizing: border-box;
}

.cmsc-lightbox-overlay.active .cmsc-lightbox-container {
  transform: scale(1);
}

.cmsc-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: linear-gradient(135deg, #490101, #6b0202);
  color: #ffffff;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  user-select: none;
}

.cmsc-lightbox-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 12px;
}

.cmsc-lightbox-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  margin: 0;
  opacity: 0.85;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.cmsc-lightbox-close:hover {
  opacity: 1;
  color: #ffcccc;
  transform: scale(1.1);
}

.cmsc-lightbox-body {
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(90vh - 54px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.cmsc-lightbox-img {
  max-width: 100%;
  max-height: calc(90vh - 56px);
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #000000;
}

.cmsc-lightbox-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

@media (max-width: 768px) {
  .cmsc-lightbox-overlay {
    padding: 8px;
  }
  .cmsc-lightbox-container {
    max-width: 98vw;
    max-height: 94vh;
    border-radius: 8px;
  }
  .cmsc-lightbox-header {
    padding: 10px 14px;
  }
  .cmsc-lightbox-title {
    font-size: 0.95rem;
  }
  .cmsc-lightbox-close {
    font-size: 24px;
  }
}
