/* ============================================================================
 * SUPERHERO SCHOOL DRAWER - STANDARDIZED TEMPLATE
 * ============================================================================
 * Created: November 11, 2025
 * Template Version: 1.0 (Based on report-drawer pattern)
 *
 * STANDARDIZATION BREAKDOWN:
 * → 75% Universal: From drawer style pattern [LOCKED]
 * → 20% Personalization: Blue family feature color (#007BFF)
 * → 5% Polish: Gamification-specific components (splash, saga map)
 *
 * FEATURE COLOR PALETTE (Blue Family):
 * - Primary: #007BFF (Bright Blue) - main highlights, buttons
 * - Secondary: #4682B4 (Steel Blue) - leaderboard button
 * - Splash: White background with centered video/text
 *
 * KEY PATTERNS:
 * - Full-page drawer (not right-slide overlay)
 * - Fixed close (‹) and help (?) buttons
 * - Splash screen with webm video (3s or video end transition)
 * - White backgrounds with grey containers
 * - Shadow highlights instead of borders
 *
 * ============================================================================ */

/* === DRAWER PANEL (FULL-PAGE) === */
.superhero-drawer-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  background: #fff;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 10002;
}

/* Desktop optimization - center drawer with max-width */
@media (min-width: 768px) {
  .superhero-drawer-panel {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.3);
  }
}

@media (min-width: 1024px) {
  .superhero-drawer-panel {
    max-width: 700px;
  }
}

/* === FIXED CLOSE BUTTON === */
.superhero-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: #DCDCDC;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease-in-out;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 10003;
  font-size: 24px;
  color: #696969;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

/* Desktop hover states (not on touch devices) */
@media (hover: hover) and (pointer: fine) {
  .superhero-drawer-close:hover {
    background: #D3D3D3;
  }
}

/* === FIXED HELP BUTTON === */
.superhero-drawer-help {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: #DCDCDC;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease-in-out;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10003;
  font-size: 18px;
  color: #696969;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

@media (hover: hover) and (pointer: fine) {
  .superhero-drawer-help:hover {
    background: #D3D3D3;
  }
}

/* === SPLASH SCREEN === */
.superhero-splash-screen {
  position: fixed;
  inset: 0;
  z-index: 10001; /* Below buttons, above panel */
  background: #fff; /* White background */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.superhero-splash-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 80%;
  max-height: 60%;
  object-fit: contain;
  z-index: 1;
}

.superhero-splash-text {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #333; /* Dark text on white background */
  margin-top: 60vh; /* Below video */
  padding: 0 20px;
}

.superhero-splash-text h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 10px 0;
  text-shadow: none; /* Remove shadow for white background */
}

.superhero-splash-text h2 {
  font-size: 18px;
  font-weight: 400;
  margin: 0 0 5px 0;
  opacity: 0.8;
}

.superhero-splash-text p {
  font-size: 14px;
  font-weight: 300;
  margin: 0;
  opacity: 0.7;
}

/* Mobile responsive splash */
@media (max-width: 768px) {
  .superhero-splash-text h1 {
    font-size: 24px;
  }

  .superhero-splash-text h2 {
    font-size: 16px;
  }

  .superhero-splash-video {
    max-width: 90%;
  }
}

/* === DRAWER CONTENT (SCROLLABLE) === */
.superhero-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 60px 12px 32px 12px; /* 12px horizontal padding */
  position: relative; /* For wallpaper positioning */
}

/* === WALLPAPER BACKGROUND === */
.superhero-drawer-content::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/assets/icons/Superhero School/compare.png');
  background-repeat: repeat;
  background-size: auto;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

/* === HEADER IMAGE === */
.drawer-header-image {
  width: 73%; /* Reduced from 100% */
  max-width: 292px; /* 73% of 400px */
  height: auto;
  display: block;
  margin: -10px auto 0 auto; /* -10px top, 0 bottom */
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .drawer-header-image {
    width: 73%;
  }
}

/* === INTRO QUESTION === */
.drawer-intro-question {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  text-align: center;
  margin: -10px 0 24px 0; /* -10px top margin */
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

/* === LEADERBOARD BUTTON === */
.superhero-leaderboard-btn {
  width: 75%; /* Reduced from 100% */
  max-width: 300px; /* 75% of 400px */
  margin: 0 auto 30px auto;
  display: block;
  padding: 14px 20px; /* Adjusted padding */
  background: #4682B4; /* Steel blue */
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px; /* Reduced from 18px by ~25% */
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .superhero-leaderboard-btn:hover {
    background: #5a9bd4;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
  }
}

.superhero-leaderboard-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .superhero-leaderboard-btn {
    font-size: 14px;
    padding: 14px 20px;
  }
}

/* === DRAWER SECTION === */
.superhero-drawer-section {
  width: 100%;
  margin: 0 0 24px 0;
  position: relative;
  z-index: 1;
}

/* === SAGA MAP CONTAINER === */
.superhero-saga-map {
  width: 100%;
  min-height: 3500px; /* Extended height for full saga */
  background: transparent; /* Transparent to show wallpaper */
  border-radius: 0; /* No border radius */
  padding: 0; /* No padding */
  box-shadow: none; /* No shadow */
  position: relative;
  z-index: 1;
}

/* === TOAST OVERLAY STYLES === */
.superhero-toast-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10004;
  padding: 20px;
}

.superhero-toast-content {
  background: #fff;
  border-radius: 16px;
  width: 75%; /* 75% width for building/footstep toasts */
  max-width: 500px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  position: relative;
}

/* Help modal is 85% width */
.superhero-toast-content.help-modal {
  width: 85%;
  max-width: 600px;
}

/* Toast header with border */
.superhero-toast-header {
  background: #f8f9fa;
  padding: 16px 20px;
  border-bottom: 3px solid #4682B4; /* Steel blue border */
  display: flex;
  align-items: center;
  gap: 12px;
}

.superhero-toast-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.superhero-toast-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toast body */
.superhero-toast-body {
  padding: 20px;
}

.superhero-toast-body p {
  margin: 0 0 12px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #555;
}

.superhero-toast-body p:last-child {
  margin-bottom: 0;
}

.superhero-toast-body strong {
  color: #333;
  font-weight: 600;
}

/* Progress bar container */
.superhero-progress-container {
  margin: 16px 0 0 0;
  padding: 12px 0 0 0;
  border-top: 1px solid #e0e0e0;
}

.superhero-progress-label {
  font-size: 12px;
  color: #666;
  margin: 0 0 6px 0;
  display: flex;
  justify-content: space-between;
}

.superhero-progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.superhero-progress-fill {
  height: 100%;
  background: #4682B4; /* Steel blue */
  transition: width 0.3s ease;
  border-radius: 4px;
}

/* Help modal specific styles */
.help-section {
  margin-bottom: 16px;
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section h3 {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin: 0 0 8px 0;
}

.help-section ul {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

.help-section li {
  margin-bottom: 4px;
}

/* Mobile responsive toasts */
@media (max-width: 768px) {
  .superhero-toast-content {
    width: 85%; /* Slightly wider on mobile */
  }

  .superhero-toast-content.help-modal {
    width: 90%;
  }

  .superhero-toast-title {
    font-size: 16px;
  }

  .superhero-toast-body p {
    font-size: 13px;
  }

  .help-section h3 {
    font-size: 15px;
  }

  .help-section ul {
    font-size: 13px;
  }
}
