/* INFI-BOARD Classroom Onboarding & Splash Screen */

/* ============================================
   NEW UI: Classroom Onboarding
   BoardPDF Teacher Pro - Classroom Setup Screen
   Premium Glassmorphism / Dark Gradient UI
   ============================================ */

/* ---- Overlay (Full-screen gate) ---- */
#classroomOnboarding {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(37, 99, 235, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(34, 211, 238, 0.09) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(99, 37, 235, 0.07) 0%, transparent 45%),
    linear-gradient(180deg, #060a12 0%, #0b1a30 45%, #070b14 100%);
  overflow-y: auto;
  overflow-x: hidden;
  animation: co-overlayIn 0.18s ease-out;
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#classroomOnboarding.co-hidden {
  display: none !important;
}

#classroomOnboarding.co-exiting {
  animation: co-overlayOut 0.14s ease-in forwards;
  pointer-events: none;
}

/* ---- Scroll Container ---- */
.co-container {
  width: min(92vw, 480px);
  min-height: 100dvh;
  padding: clamp(16px, 2.5vh, 36px) clamp(12px, 2vw, 24px) clamp(16px, 2vh, 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.5vh, 20px);
  animation: co-slideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1) 0.03s both;
  will-change: opacity, transform;
  flex-shrink: 0;
}

/* ---- Header ---- */
.co-header {
  text-align: center;
  flex-shrink: 0;
}

.co-logo-icon {
  width: clamp(44px, 7vh, 62px);
  height: clamp(44px, 7vh, 62px);
  margin: 0 auto clamp(6px, 1vh, 14px);
  border-radius: clamp(14px, 2vw, 20px);
  padding: 5px;
  background:
    radial-gradient(circle at 50% 42%, rgba(34, 211, 238, 0.18), transparent 68%),
    #06080d;
  display: grid;
  place-items: center;
  box-shadow:
    0 10px 40px rgba(37, 99, 235, 0.38),
    0 0 0 1px rgba(34, 211, 238, 0.22);
  animation: co-logoPulse 2s ease-in-out infinite;
  will-change: transform, box-shadow;
  overflow: hidden;
}

.co-logo-icon svg {
  width: 30px;
  height: 30px;
  stroke: white;
  stroke-width: 2;
  fill: none;
}

.co-title {
  font-size: clamp(20px, 3.2vw, 30px);
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 clamp(4px, 0.6vh, 8px);
  letter-spacing: -0.6px;
  line-height: 1.15;
}

.co-subtitle {
  font-size: clamp(12px, 1.5vw, 14px);
  color: #7b879e;
  margin: 0;
  line-height: 1.45;
  max-width: 360px;
  margin-inline: auto;
}

/* ---- Card (Glassmorphism) ---- */
.co-card {
  width: 100%;
  padding: clamp(14px, 2vh, 26px) clamp(14px, 2vw, 24px);
  border-radius: clamp(16px, 2vw, 22px);
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vh, 14px);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Subtle top-edge glow */
.co-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.5), rgba(34, 211, 238, 0.5), transparent);
}

/* ---- Input Groups ---- */
.co-input-group {
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.6vh, 6px);
}

.co-input-label {
  font-size: clamp(11px, 1.2vw, 13px);
  font-weight: 700;
  color: #b0b8ce;
  display: flex;
  align-items: center;
  gap: 6px;
}

.co-input-label .co-optional {
  font-size: 11px;
  font-weight: 600;
  color: #4e5670;
}

.co-input-label .co-required-star {
  color: #f87171;
  font-size: 11px;
  font-weight: 600;
}

.co-input {
  width: 100%;
  padding: clamp(8px, 1.2vh, 13px) clamp(10px, 1.3vw, 16px);
  border-radius: clamp(8px, 1vw, 13px);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: clamp(13px, 1.4vw, 15px);
  font-weight: 600;
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  outline: none;
  -webkit-appearance: none;
}

.co-input::placeholder {
  color: #3e465e;
  font-weight: 500;
}

.co-input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.13);
}

.co-input.co-input-error {
  border-color: rgba(239, 68, 68, 0.65);
  box-shadow: 0 0 0 3.5px rgba(239, 68, 68, 0.1);
}

/* ---- Error Message ---- */
.co-error-msg {
  font-size: 13px;
  font-weight: 700;
  color: #f87171;
  min-height: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.3s, max-height 0.3s, margin 0.3s;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.co-error-msg.co-visible {
  opacity: 1;
  max-height: 32px;
  margin-top: 2px;
}

/* ---- Primary Create Button ---- */
.co-btn-primary {
  width: 100%;
  padding: clamp(10px, 1.4vh, 15px) clamp(16px, 2vw, 24px);
  border: none;
  border-radius: clamp(10px, 1.2vw, 15px);
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 60%, #22d3ee 100%);
  color: #ffffff;
  font-size: clamp(13px, 1.4vw, 16px);
  font-weight: 800;
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.22s ease, background 0.18s ease;
  will-change: transform;
  box-shadow:
    0 8px 32px rgba(37, 99, 235, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
  margin-top: 2px;
  flex-shrink: 0;
}

.co-btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  pointer-events: none;
}

.co-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 44px rgba(37, 99, 235, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  box-shadow:
    0 12px 38px rgba(37, 99, 235, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.co-btn-primary:active {
  transform: translateY(0px);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.28);
}

/* ---- Continue Last Classroom Button ---- */
.co-btn-continue {
  width: 100%;
  padding: clamp(9px, 1.2vh, 14px) clamp(16px, 2vw, 24px);
  border: 1.5px solid rgba(34, 211, 238, 0.22);
  border-radius: clamp(10px, 1.2vw, 15px);
  background: rgba(34, 211, 238, 0.06);
  color: #22d3ee;
  font-size: clamp(12px, 1.3vw, 15px);
  font-weight: 700;
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.co-btn-continue svg {
  flex-shrink: 0;
}

.co-btn-continue:hover {
  background: rgba(34, 211, 238, 0.13);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.12);
  transform: translateY(-1px);
}

.co-btn-continue:active {
  transform: translateY(0);
}

/* ---- Divider ---- */
.co-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  color: #3d4560;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.co-divider::before,
.co-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* ---- Recent Classrooms Section ---- */
.co-recent-section {
  width: 100%;
  flex-shrink: 0;
}

.co-recent-title {
  font-size: 12px;
  font-weight: 800;
  color: #6b7590;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.co-recent-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.co-recent-card {
  padding: clamp(10px, 1.3vh, 16px) clamp(10px, 1.2vw, 14px);
  border-radius: clamp(12px, 1.4vw, 16px);
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
  position: relative;
  overflow: hidden;
}

/* Animated gradient border on hover */
.co-recent-card::before {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: 19px;
  padding: 1.5px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0), rgba(34, 211, 238, 0));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: background 0.35s ease;
  pointer-events: none;
}

.co-recent-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(37, 99, 235, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}

.co-recent-card:hover::before {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.55), rgba(34, 211, 238, 0.55));
}

.co-recent-card:active {
  transform: translateY(-1px);
}

.co-recent-card-name {
  font-size: clamp(12px, 1.3vw, 14px);
  font-weight: 800;
  color: #e2e8f4;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 28px;
}

.co-recent-card-meta {
  font-size: 11px;
  color: #5a6380;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.co-recent-card-time {
  font-size: 10px;
  color: #3a4158;
  margin-top: 6px;
  font-weight: 600;
}

/* Delete button on recent card */
.co-recent-card-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: none;
  background: rgba(220, 38, 38, 0.12);
  color: #f87171;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.22s, background 0.22s, transform 0.2s;
  padding: 0;
}

.co-recent-card:hover .co-recent-card-delete {
  opacity: 1;
}

.co-recent-card-delete:hover {
  background: rgba(220, 38, 38, 0.3);
  transform: scale(1.08);
}

.co-recent-card-delete svg {
  width: 14px;
  height: 14px;
}

/* ---- Footer ---- */
.co-footer {
  font-size: 11px;
  color: #2d3450;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

/* ==============================
   Animations
   ============================== */

@keyframes co-overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes co-overlayOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.03); }
}

@keyframes co-slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes co-logoPulse {
  0%, 100% {
    transform: translateZ(0) scale(1);
    box-shadow:
      0 10px 40px rgba(37, 99, 235, 0.34),
      0 0 0 1px rgba(255, 255, 255, 0.08);
  }
  50% {
    transform: translateZ(0) scale(1.025);
    box-shadow:
      0 14px 48px rgba(37, 99, 235, 0.44),
      0 0 0 1px rgba(255, 255, 255, 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
