/* ==========================================
   QUIZ MODULE - STYLES (NAMESPACED qz-)
   Maroon & White Theme for Avanteia
   ========================================== */

/* Maroon color utilities */
.text-maroon { color: #800000 !important; }
.bg-maroon { background-color: #800000 !important; }
.border-maroon { border-color: #800000 !important; }
.bg-maroon-light { background-color: #fff0f0 !important; }

/* Custom btn-maroon for Bootstrap */
.btn-maroon {
  background-color: #800000 !important;
  border-color: #800000 !important;
  color: #ffffff !important;
}
.btn-maroon:hover {
  background-color: #660000 !important;
  border-color: #660000 !important;
  color: #ffffff !important;
}


/* ==========================================
   LOGIN SCREEN
   ========================================== */
.qz-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #800000 0%, #4a0000 100%);
  padding: 1rem;
}

.qz-login-card {
  background: #ffffff;
  border-radius: 4px;
  padding: 2.5rem;
  box-shadow: 0 1rem 3rem rgba(0,0,0,0.175);
  text-align: center;
  border: none;
  width: 100%;
  max-width: 420px;
}

.qz-login-logo {
  margin-bottom: 1rem;
}

.qz-login-logo img {
  max-height: 60px;
  width: auto;
}

.qz-login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 0.25rem;
}

.qz-login-subtitle {
  color: #6c757d;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* ==========================================
   SIDEBAR
   ========================================== */
.qz-sidebar {
  background-color: #800000;
  min-height: 100vh;
  padding: 0;
}

.qz-sidebar-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.qz-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  padding-bottom: 1rem;
}

.qz-sidebar-brand img {
  max-height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.qz-sidebar-brand i {
  font-size: 1.5rem;
}

.qz-sidebar-divider {
  border-color: rgba(255,255,255,0.2);
  margin: 0.5rem 0;
}

.qz-nav {
  gap: 0.25rem;
}

.qz-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255,255,255,0.8) !important;
  border-radius: 4px;
  padding: 0.625rem 1rem;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all 0.2s;
  font-size: 0.9375rem;
}

.qz-nav-link:hover,
.qz-nav-link.active {
  background-color: rgba(255,255,255,0.15);
  color: #ffffff !important;
}

.qz-nav-link i {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
}

.qz-nav-logout {
  color: #ffcccc !important;
}

.qz-nav-logout:hover {
  background-color: rgba(220,53,69,0.2) !important;
  color: #ffffff !important;
}

/* Mobile sidebar toggle */
.qz-sidebar-toggle {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1040;
  background: #800000;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.625rem;
  font-size: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
.qz-main {
  background-color: #f8f9fa;
  min-height: 100vh;
}

/* ==========================================
   SET LIST (Horizontal Cards)
   ========================================== */
.qz-set-list .card {
  transition: all 0.2s;
  border: 2px solid transparent;
  border-radius: 4px;
}

.qz-set-list .card:hover {
  border-color: #800000;
  transform: translateX(4px);
  box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.1) !important;
}

.qz-set-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: #800000;
  color: #fff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* ==========================================
   TEST CARDS (Student Panel)
   ========================================== */
.qz-test-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
  border-radius: 4px;
}

.qz-test-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important;
  border-color: #800000;
}

/* ==========================================
   QUIZ INTERFACE (Student Panel)
   ========================================== */
.qz-quiz-container {
  max-width: 800px;
  margin: 0 auto;
}

/* Progress bar override */
.progress-bar.bg-maroon {
  background-color: #800000 !important;
}

/* Option cards in quiz */
#optionsList .form-check {
  background: #ffffff;
  border: 2px solid #e9ecef;
  border-radius: 4px;
  padding: 1rem 1.25rem !important;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

#optionsList .form-check:hover {
  border-color: #800000;
  background-color: #fff8f8;
}

#optionsList .form-check.border-maroon {
  border-color: #800000 !important;
  background-color: #fff0f0 !important;
}

#optionsList .form-check-input {
  width: 1.25em;
  height: 1.25em;
  margin-top: 0.15em;
  border-color: #800000;
}

#optionsList .form-check-input:checked {
  background-color: #800000;
  border-color: #800000;
}

/* ==========================================
   SUCCESS SCREEN - Animated
   ========================================== */
.qz-success-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  padding: 2rem;
}

.qz-success-content {
  text-align: center;
  max-width: 500px;
  animation: qz-success-fade-in 0.6s ease-out;
}

.qz-success-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
}

.qz-success-circle {
  width: 100%;
  height: 100%;
  background: #800000;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 40px rgba(128,0,0,0.3);
  animation: qz-success-scale 0.5s ease-out 0.3s both;
}

.qz-success-circle i {
  font-size: 4rem;
  color: #ffffff;
}

.qz-success-title {
  font-size: 2rem;
  font-weight: 800;
  color: #212529;
  margin-bottom: 0.5rem;
  animation: qz-success-slide-up 0.5s ease-out 0.5s both;
}

.qz-success-message {
  font-size: 1.1rem;
  color: #6c757d;
  margin-bottom: 2rem;
  animation: qz-success-slide-up 0.5s ease-out 0.7s both;
}

.qz-success-content .btn {
  animation: qz-success-slide-up 0.5s ease-out 0.9s both;
}

@keyframes qz-success-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes qz-success-scale {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

@keyframes qz-success-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   TABLES
   ========================================== */
.qz-data-table {
  width: 100%;
  background: #ffffff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
  border-collapse: collapse;
}

.qz-data-table th,
.qz-data-table td {
  padding: 0.875rem 1.25rem;
  text-align: left;
  font-size: 0.875rem;
}

.qz-data-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.qz-data-table td {
  border-top: 1px solid #dee2e6;
}

.qz-data-table tr:hover td {
  background: #fff8f8;
}

/* ==========================================
   EMPTY STATE
   ========================================== */
.qz-empty-state {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}

.qz-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* ==========================================
   JSON PREVIEW
   ========================================== */
.qz-json-preview {
  background: #1f2937;
  color: #e5e7eb;
  padding: 1rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 0;
}

/* ==========================================
   MODAL (custom overlay for student panel)
   ========================================== */
.qz-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.qz-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.qz-modal {
  background: #ffffff;
  border-radius: 4px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 1rem 3rem rgba(0,0,0,0.175);
  transform: scale(0.95);
  transition: transform 0.3s;
}

.qz-modal-overlay.active .qz-modal {
  transform: scale(1);
}

.qz-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qz-modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.qz-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6c757d;
  line-height: 1;
  padding: 0;
}

.qz-modal-body {
  padding: 1.5rem;
}

.qz-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==========================================
   UTILITIES
   ========================================== */
.qz-hidden { display: none !important; }
.qz-text-center { text-align: center; }
.qz-mt-1 { margin-top: 0.5rem; }
.qz-mt-2 { margin-top: 1rem; }
.qz-mb-2 { margin-bottom: 1rem; }
.qz-text-gray { color: #6c757d; }
.qz-font-bold { font-weight: 700; }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 767.98px) {
  .qz-sidebar {
    min-height: auto;
    position: relative;
  }
  .qz-sidebar-sticky {
    height: auto;
    position: relative;
  }
  .qz-login-card {
    padding: 1.5rem;
  }
  .qz-hero-title {
    font-size: 1.5rem;
  }
  
}
/* ==========================================
   MOBILE OFFCANVAS & LAYOUT FIX
   ========================================== */

@media (max-width: 767.98px) {
  /* 1. Fix offcanvas positioning broken by .qz-sidebar media query */
  .offcanvas.qz-sidebar {
    position: fixed !important;
    min-height: 100vh !important;
  }

  /* 2. Push main content below the fixed hamburger button */
  .qz-main {
    padding-top: 3.5rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* 3. Tidy up the hamburger button on small screens */
  .qz-sidebar-toggle {
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.5rem 0.625rem;
    font-size: 1.1rem;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  }
}

/* 4. Keep offcanvas fully maroon (header + body) */
#sidebarOffcanvas .offcanvas-header,
#sidebarOffcanvas .offcanvas-body {
  background-color: #800000 !important;
}

#sidebarOffcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

/* 5. Force white close button */
#sidebarOffcanvas .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.9;
}
#sidebarOffcanvas {
  width: 260px;
}