/* =========================================
   RQuiz - Global Styles
   Extracted from index200.html
   ========================================= */

/* Reset & global box model */
body {
    box-sizing: border-box;
  }
  
  /* ===============================
     PAGE / SECTION VISIBILITY SYSTEM
     =============================== */
  .page {
    display: none !important;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .page.active {
    display: block !important;
    opacity: 1;
  }
  
  .section {
    display: none !important;
  }
  
  .section.active {
    display: block !important;
  }

  /* ===============================
     MODE CARDS (Student Space)
     =============================== */
  .mode-card {
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  }

  .mode-card:hover {
    box-shadow: 0 18px 35px rgba(99, 102, 241, 0.18);
  }

  .mode-card.active-mode {
    border-color: #7c3aed !important;
    box-shadow: 0 16px 32px rgba(124, 58, 237, 0.25);
  }

  .mode-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  }

  .mode-status-badge.active {
    background: linear-gradient(135deg, #34d399, #059669);
    color: white;
    box-shadow: 0 10px 22px rgba(16, 185, 129, 0.25);
  }

  .mode-status-badge.locked {
    background: #f97316;
    color: white;
    box-shadow: 0 8px 18px rgba(249, 115, 22, 0.25);
  }
  
  /* ===============================
     ANIMATIONS & EFFECTS
     =============================== */
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .fade-in {
    animation: fadeIn 0.6s ease-out;
  }
  
  .gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  }
  
  .gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  /* ===============================
     TOAST NOTIFICATIONS
     =============================== */
  .toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 600;
    z-index: 1100;
    transform: translateX(400px);
    transition: transform 0.3s ease;
  }
  
  .toast.show {
    transform: translateX(0);
  }
  
  .toast.success {
    background: #10b981;
  }
  .toast.error {
    background: #ef4444;
  }
  .toast.info {
    background: #3b82f6;
  }
  
  /* ===============================
     MODALS
     =============================== */
  .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
  }
  
  .modal-content {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    max-width: 500px;
    width: 90%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
  }
  
  /* ===============================
     RQuiz HIGHLIGHT ANIMATION
     =============================== */
  @keyframes pulse-glow {
    0%, 100% {
      box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
      transform: scale(1);
    }
    50% {
      box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
      transform: scale(1.02);
    }
  }
  
  .rquiz-highlight {
    animation: pulse-glow 2s infinite;
  }
  
  /* ===============================
     CONFETTI EFFECT
     =============================== */
  .confetti-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }
  
  .confetti {
    position: absolute;
    font-size: 2rem;
    animation: confetti-fall 3s linear infinite;
    opacity: 0.8;
  }
  
  @keyframes confetti-fall {
    0% {
      transform: translateY(-100vh) rotate(0deg);
      opacity: 1;
    }
    100% {
      transform: translateY(100vh) rotate(360deg);
      opacity: 0;
    }
  }
  
  /* ===============================
     VIDEO CONTAINER (Responsive)
     =============================== */
  .video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
  }
  
  .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
  
  /* ===============================
     ADMIN PAGE STYLES
     =============================== */
  .admin-card {
    transition: all 0.3s ease;
  }
  
  .admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  }
  
  .stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
  }
  
  /* ===============================
     PARENT PAGE STYLES
     =============================== */
  .parent-card {
    transition: all 0.3s ease;
  }
  
  .parent-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  }
  
  .progress-ring {
    transform: rotate(-90deg);
  }
  
  .progress-ring-circle {
    transition: stroke-dasharray 0.35s;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
  }
  
  /* ===============================
     RQuiz BUTTONS & ELEMENTS
     =============================== */
  .rquiz-room {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border: 3px solid #d97706;
    animation: pulse-room 3s infinite;
  }
  
  @keyframes pulse-room {
    0%, 100% {
      box-shadow: 0 0 30px rgba(251, 191, 36, 0.6);
    }
    50% {
      box-shadow: 0 0 50px rgba(251, 191, 36, 0.9);
    }
  }
  
  .rquiz-countdown {
    font-size: 4rem;
    font-weight: bold;
    color: #dc2626;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  }
  
  .rquiz-answer-btn {
    transition: all 0.2s ease;
  }
  
  .rquiz-answer-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }
  
  .rquiz-answer-btn.correct {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    animation: correct-flash 0.5s ease;
  }
  
  .rquiz-answer-btn.incorrect {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    animation: incorrect-shake 0.5s ease;
  }
  
  @keyframes correct-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
  }
  
  @keyframes incorrect-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
  }
  
  .player-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    color: white;
    margin: 0 auto 0.5rem;
  }
  
  .leaderboard-item {
    transition: all 0.3s ease;
  }
  
  .leaderboard-item:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }
  
  /* ===============================
     VIEW TRANSITION (Experimental)
     =============================== */
  @view-transition {
    navigation: auto;
  }

  /* ===============================
     LEVEL SELECTION BUTTONS
     =============================== */
  .level-btn, .rquiz-level-btn {
    transition: all 0.2s ease;
  }

  .level-btn:hover, .rquiz-level-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }

  /* ===============================
     MOBILE & TABLET RESPONSIVE FIXES
     =============================== */
  
  /* Prevent horizontal scrolling */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  
  /* Hide scrollbar but allow scrolling */
  .scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
  }
  
  .scrollbar-hide::-webkit-scrollbar {
    display: none;  /* Chrome, Safari and Opera */
  }
  
  /* Touch-friendly button sizes (minimum 44x44px for mobile) */
  button, a.button, .btn {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
  }
  
  /* Responsive tables */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table-responsive table {
    min-width: 600px;
  }
  
  /* Mobile-specific styles */
  @media (max-width: 640px) {
    /* Smaller padding on mobile */
    .container, .max-w-7xl {
      padding-left: 1rem;
      padding-right: 1rem;
    }
    
    /* Stack flex items on mobile */
    .flex-row {
      flex-direction: column;
    }
    
    /* Full width buttons on mobile */
    button, .btn, a.button {
      width: 100%;
      margin-bottom: 0.5rem;
    }
    
    /* Smaller text on mobile */
    h1 { font-size: 1.75rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    
    /* Modal adjustments */
    .modal-content {
      width: 95%;
      max-width: 95%;
      margin: 1rem;
      padding: 1rem;
    }
    
    /* Card padding adjustments */
    .card, [class*="rounded-2xl"], [class*="rounded-xl"] {
      padding: 1rem !important;
    }
    
    /* Hide less important elements on mobile */
    .hidden-mobile {
      display: none !important;
    }
    
    /* Better spacing for mobile */
    .space-y-6 > * + * {
      margin-top: 1rem;
    }
    
    /* Grid adjustments */
    .grid {
      grid-template-columns: 1fr !important;
    }
    
    /* Navigation adjustments */
    nav {
      flex-wrap: wrap;
    }
    
    /* Input fields full width on mobile */
    input, textarea, select {
      width: 100%;
      font-size: 16px; /* Prevent iOS zoom on focus */
    }
    
    /* Better spacing for forms */
    form .space-y-6 > * + * {
      margin-top: 1.5rem;
    }
    
    /* Stack grid items */
    .grid {
      grid-template-columns: 1fr !important;
    }
    
    /* Full width buttons on mobile */
    button[type="submit"], .btn-primary, .btn-submit {
      width: 100%;
    }
  }
  
  /* Tablet-specific styles */
  @media (min-width: 641px) and (max-width: 1024px) {
    /* 2-column grid on tablet */
    .grid.md\:grid-cols-2 {
      grid-template-columns: repeat(2, 1fr);
    }
    
    /* Tablet padding */
    .container, .max-w-7xl {
      padding-left: 1.5rem;
      padding-right: 1.5rem;
    }
    
    /* Tablet modal */
    .modal-content {
      width: 90%;
      max-width: 600px;
    }
  }
  
  /* Prevent text selection on buttons (better touch experience) */
  button, .btn, a.button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Better touch targets for touch devices */
  @media (hover: none) and (pointer: coarse) {
    button, a.button, .btn, .clickable, input[type="button"], input[type="submit"] {
      min-height: 48px;
      min-width: 48px;
      padding: 12px 16px;
    }
    
    /* Larger tap targets for links */
    nav a, .nav-link {
      min-height: 44px;
      padding: 10px 16px;
    }
  }
  
  /* Prevent iOS input zoom */
  @media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
      font-size: 16px !important;
    }
  }
  
  /* Smooth scrolling */
  html {
    scroll-behavior: smooth;
  }
  
  /* Fix for iOS Safari viewport */
  @supports (-webkit-touch-callout: none) {
    body {
      min-height: -webkit-fill-available;
    }
  }
  