/* css/modal.css - Modals, Overlays, and Forms */

/* Modal Backdrop */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 9, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Window Container */
.modal-window {
  background: rgba(18, 22, 30, 0.96);
  border: 1px solid var(--border-glass-gold);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.9), 0 0 40px rgba(212, 175, 55, 0.12);
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-window {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.02);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* ========================================================
   1. Role & Onboarding Modal
   ======================================================== */
.onboarding-card {
  max-width: 580px;
  text-align: center;
}

.onboarding-hero {
  margin-bottom: 24px;
}

.onboarding-hero h1 {
  font-family: var(--font-title);
  font-size: 26px;
  color: #fff;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}

.onboarding-hero p {
  color: var(--gold-light);
  font-size: 14px;
}

.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.role-card {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.role-card:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-4px);
}

.role-card.selected.teacher {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 24px var(--teacher-glow);
}

.role-card.selected.student {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  box-shadow: 0 0 24px var(--student-glow);
}

/* ==========================================
   Classroom Furniture Selection Cards
   ========================================== */
.furniture-card {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.furniture-card * {
  pointer-events: none; /* Ensure click target is always the card itself */
}

.furniture-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(245, 158, 11, 0.5);
  transform: translateY(-3px);
}

.furniture-card .furn-icon {
  font-size: 34px;
  margin-bottom: 6px;
  transition: transform 0.2s ease;
}

.furniture-card:hover .furn-icon {
  transform: scale(1.12);
}

.furniture-card .furn-name {
  font-weight: 600;
  font-size: 13.5px;
  color: #f1f5f9;
  margin-bottom: 2px;
}

.furniture-card .furn-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.furniture-card .furn-badge {
  display: none;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 20px;
  padding: 3px 10px;
}

.furniture-card.selected {
  border-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.16) !important;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.35), inset 0 0 0 1px #f59e0b !important;
  transform: scale(1.03);
}

.furniture-card.selected .furn-name {
  color: #fbbf24;
}

.furniture-card.selected .furn-badge {
  display: inline-flex;
}

.furniture-card .furn-num {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 11px;
  font-family: monospace;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.6;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 1px 5px;
}

.furniture-card.selected .furn-num {
  color: #fbbf24;
  opacity: 1;
  background: rgba(245, 158, 11, 0.25);
}

.furn-preset-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 10px;
}

.furn-preset-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.furn-preset-pill:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
}


.role-avatar-preview {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.role-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.role-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--gold-primary);
  background: rgba(255, 255, 255, 0.08);
}

.enter-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
  color: #0c0e12;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--gold-glow);
  transition: all 0.2s ease;
}

.enter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.5);
}

/* ========================================================
   2. Artwork Detail & Cinema Showcase Modal
   ======================================================== */
.artwork-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  min-height: 520px;
}

.artwork-media-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  overflow: hidden;
  position: relative;
  min-height: 380px;
}

.artwork-img-full {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  box-shadow: 0 8px 30px rgba(0,0,0,0.7);
  transition: transform 0.3s ease;
}

.artwork-img-full:hover {
  transform: scale(1.02);
}

.artwork-video-player {
  width: 100%;
  max-height: 440px;
  outline: none;
  border-radius: var(--radius-sm);
}

.artwork-info-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.artwork-meta-header {
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 14px;
}

.artwork-detail-title {
  font-family: var(--font-title);
  font-size: 22px;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 6px;
}

.artwork-detail-artist {
  font-size: 15px;
  color: var(--gold-primary);
  font-weight: 500;
}

.artwork-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.artwork-pill {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.artwork-description {
  font-size: 13.5px;
  line-height: 1.7;
  color: #d1d5db;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 6px;
}

/* Audio Guide Player */
.audio-guide-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-glass-gold);
  border-radius: var(--radius-md);
}

.audio-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold-primary);
  border: none;
  color: #0c0e12;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: transform 0.2s ease;
}

.audio-play-btn:hover {
  transform: scale(1.1);
}

.audio-info {
  flex: 1;
}

.audio-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.audio-status {
  font-size: 11px;
  color: var(--gold-light);
}

/* Art Quiz Card */
.quiz-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.quiz-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiz-question {
  font-size: 13px;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.5;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quiz-option-btn {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: #e5e7eb;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.quiz-option-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--gold-primary);
}

.quiz-option-btn.correct {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
  color: #34d399 !important;
}

.quiz-option-btn.wrong {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
  color: #f87171 !important;
}

.quiz-result-box {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.4;
  display: none;
}

.quiz-result-box.show {
  display: block;
}

/* Comments & Reactions on Artwork */
.artwork-comments-box {
  border-top: 1px solid var(--border-glass);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comments-list {
  max-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comment-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
}

.comment-author {
  font-weight: 600;
  color: var(--gold-light);
}

/* ========================================================
   3. Curator Modal (Teacher Add/Edit Artwork)
   ======================================================== */
.curator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.upload-dropzone {
  border: 2px dashed var(--border-glass-gold);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.02);
}

.upload-dropzone:hover {
  background: rgba(212, 175, 55, 0.05);
  border-color: var(--gold-light);
}

.preview-thumb {
  max-width: 100%;
  max-height: 160px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  display: none;
}

/* ========================================================
   4. Teacher Dashboard Modal
   ======================================================== */
.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.metric-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-primary);
  margin-top: 4px;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.dashboard-table th {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
  font-weight: 600;
}

.dashboard-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-glass);
  color: #fff;
}

/* Media Queries for Modals */
@media (max-width: 820px) {
  .artwork-layout {
    grid-template-columns: 1fr;
  }
  .curator-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-metrics {
    grid-template-columns: 1fr;
  }
}
