/* ==========================================================================
   demo.css
   Styles for the AI Class public demo pages and demo modal.
   Used by: /demo/teacher-demo.html, /demo/student-demo.html
   Also:    the modal that wraps them on the landing page.
   ========================================================================== */

/* --- Demo banner (top of each demo page) -------------------------------- */
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: linear-gradient(90deg, #0a3d62 0%, #1e6091 100%);
  color: #fff;
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.demo-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.demo-banner-badge {
  background: #d4af37;
  color: #0a3d62;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 3px;
}

.demo-banner-text {
  opacity: 0.95;
}

.demo-banner-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.demo-subject-label {
  font-size: 12px;
  opacity: 0.85;
}

.demo-subject-select {
  background: #fff;
  color: #0a3d62;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* --- Modal wrapper on landing page -------------------------------------- */
.demo-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: demoFadeIn 0.2s ease-out;
}

@keyframes demoFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.demo-modal {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1400px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.demo-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #0a3d62;
  color: #0a3d62;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.15s ease;
}

.demo-modal-close:hover {
  background: #0a3d62;
  color: #fff;
  transform: scale(1.05);
}

.demo-modal iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* --- Landing page demo buttons (blinking) -------------------------------- */
.demo-button-group {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease;
  animation: demoPulse 2s ease-in-out infinite;
}

.demo-btn-teacher {
  background: #0a3d62;
  color: #fff;
}

.demo-btn-student {
  background: #d4af37;
  color: #0a3d62;
}

.demo-btn:hover {
  transform: translateY(-2px);
  animation-play-state: paused;
}

@keyframes demoPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.6);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(212, 175, 55, 0);
  }
}

/* Stop blinking once the user has opened a demo at least once */
body.demo-seen .demo-btn {
  animation: none;
}

@media (max-width: 640px) {
  .demo-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .demo-banner-text {
    font-size: 12px;
  }
  .demo-button-group {
    width: 100%;
  }
  .demo-btn {
    flex: 1;
    justify-content: center;
  }
}