/* Import unified modal system */
@import url('modal.css');

/**
 * PMERIT Components CSS
 * Version: 3.5 - Development Banner Added
 * Last Updated: December 22, 2025
 *
 * FIXES:
 * - Control buttons now horizontal (VH Mode + Read About on same line)
 * - Removed redundant "Connected to Educational Services" text
 * - Polished ChatGPT-style input with smooth interactions
 * - Added animated typing indicator for AI responses
 * - Added development banner (remove after Feb 2026)
 */

/* ========================================
   DEVELOPMENT BANNER - Remove after Feb 2026
   ======================================== */
/* CSS Variable for banner height - used by layouts */
:root {
  --dev-banner-height: 40px;
}

.dev-banner {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
  color: #1a1a1a;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--dev-banner-height);
  z-index: 9999;
  /* HP-G24: Visual separator from chat content */
  border-bottom: 2px solid rgba(0, 0, 0, 0.15);
  margin-bottom: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dev-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 1200px;
  margin: 0 auto;
}

.dev-banner-content i.fa-hard-hat {
  font-size: 1rem;
}

.dev-banner-close {
  background: transparent;
  border: none;
  color: #1a1a1a;
  cursor: pointer;
  padding: 4px 8px;
  margin-left: 16px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.dev-banner-close:hover {
  opacity: 1;
}

/* Dark mode banner */
[data-theme="dark"] .dev-banner {
  background: linear-gradient(90deg, #b45309 0%, #92400e 100%);
  color: #fef3c7;
}

[data-theme="dark"] .dev-banner-close {
  color: #fef3c7;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .dev-banner {
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  .dev-banner-content {
    gap: 6px;
  }

  .dev-banner-close {
    margin-left: 8px;
  }
}

/* ========================================
   CHATGPT-STYLE INPUT BAR (MOBILE & DESKTOP)
   Enhanced with Phase 8.4 - Thumb-reach & Safe-area
   ======================================== */

/* === MOBILE INPUT CONTAINER === */
.chat-input-container {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  
  /* Phase 8.4 - iOS Safe Area Support */
  padding: var(--space-3) var(--space-4);
  padding-bottom: calc(var(--space-3) + var(--safe-area-bottom));
  
  /* Prevent viewport resize thrash */
  min-height: calc(56px + var(--safe-area-bottom));
  
  z-index: var(--z-sticky);
}

/* === MOBILE INPUT WRAPPER === */
.chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  
  background: var(--bg-card);
  border: none;
  border-radius: 24px;
  
  /* Phase 8.4 - Increased height for thumb-reach */
  min-height: 56px;
  padding: 8px 12px;
  
  transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  
  /* Subtle shadow instead of border */
  box-shadow: 
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 2px 4px rgba(0, 0, 0, 0.08);
}

.chat-input-wrapper:focus-within {
  /* ✅ Subtle blue glow on focus */
  box-shadow: 
    0 0 0 1px rgba(42, 91, 140, 0.3),
    0 0 0 4px rgba(42, 91, 140, 0.08),
    0 4px 8px rgba(0, 0, 0, 0.1);
  
  /* Subtle lift */
  transform: translateY(-1px);
}

/* === ADD BUTTON (Plus Icon) - Phase 8.4 Enhanced === */
.input-add-btn {
  width: 44px;  /* Phase 8.4 - Min touch target */
  height: 44px;
  min-width: 44px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: transparent;
  border: none;
  border-radius: 50%;
  
  font-size: 18px;
  color: var(--text-secondary);
  
  cursor: pointer;
  transition: all 0.2s ease;
  
  /* Touch target feedback */
  -webkit-tap-highlight-color: rgba(42, 91, 140, 0.1);
}

.input-add-btn:hover {
  background: var(--bg-secondary);
  color: var(--primary);
  transform: rotate(90deg) scale(1.1);
}

.input-add-btn:active {
  transform: rotate(90deg) scale(0.95);
}

/* === TEXT INPUT - Phase 8.4 Enhanced === */
.chat-input {
  flex: 1;
  
  background: transparent;
  border: none;
  outline: none;
  
  font-family: var(--font-body);
  font-size: 16px;  /* Prevents iOS zoom */
  line-height: 1.5;
  color: var(--text-primary);
  
  padding: 8px 0;
  
  resize: none;
  min-height: 24px;
  max-height: 120px; /* Phase 8.4 - Max 3 lines before scroll */
  
  /* Remove iOS default styling */
  -webkit-appearance: none;
  appearance: none;
  
  /* Smooth multiline expansion */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.chat-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

/* Ensure 16px on mobile to prevent iOS zoom */
@media (max-width: 767px) {
  .chat-input {
    font-size: 16px !important;
  }
}

/* === INPUT ACTIONS (Voice & Send) === */
.input-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* === VOICE BUTTON (Microphone) - Phase 8.4 Enhanced === */
.input-voice-btn {
  width: 44px;  /* Phase 8.4 - Min touch target */
  height: 44px;
  min-width: 44px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: transparent;
  border: none;
  border-radius: 50%;
  
  font-size: 18px;
  color: var(--text-secondary);
  
  cursor: pointer;
  transition: all 0.2s ease;
  
  /* Touch target feedback */
  -webkit-tap-highlight-color: rgba(42, 91, 140, 0.1);
}

.input-voice-btn:hover {
  background: var(--bg-secondary);
  color: var(--primary);
  transform: scale(1.1);
}

.input-voice-btn:active {
  transform: scale(0.95);
}

/* Pulse animation when recording */
.input-voice-btn.recording {
  color: var(--error);
  animation: pulse 1.5s ease-in-out infinite;
  background: rgba(220, 53, 69, 0.1);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* === SEND BUTTON (Arrow Up) - Phase 8.4 Enhanced === */
.send-btn {
  width: 44px;  /* Phase 8.4 - Min touch target */
  height: 44px;
  min-width: 44px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: var(--primary);
  border: none;
  border-radius: 50%;
  
  color: white;
  font-size: 18px;
  
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  
  /* Nice shadow */
  box-shadow: 0 2px 6px rgba(42, 91, 140, 0.25);
  
  /* Touch target feedback */
  -webkit-tap-highlight-color: rgba(42, 91, 140, 0.2);
}

.send-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(42, 91, 140, 0.35);
}

.send-btn:active {
  transform: scale(0.95);
}

/* Disabled state */
.send-btn:disabled {
  background: var(--bg-secondary);
  color: var(--text-tertiary);
  cursor: not-allowed;
  box-shadow: none;
}

.send-btn:disabled:hover {
  transform: none;
}

/* === CHARACTER COUNTER === */
.char-counter,
.desktop-char-counter {
  position: absolute;
  bottom: 4px;
  right: 48px;
  
  font-size: 11px;
  color: var(--text-tertiary);
  
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.chat-input-wrapper:focus-within .char-counter,
.desktop-input-wrapper:focus-within .desktop-char-counter {
  opacity: 1;
  visibility: visible;
}

.char-counter.hidden,
.desktop-char-counter.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
}

.char-counter.warning,
.desktop-char-counter.warning {
  color: var(--warning);
}

.char-counter.error,
.desktop-char-counter.error {
  color: var(--error);
}

/* ========================================
   DESKTOP INPUT BAR (CENTER PANEL)
   ======================================== */

.desktop-chat-input-area {
  position: sticky;
  bottom: 0;
  
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  
  padding: 16px;
  
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* === DESKTOP INPUT WRAPPER === */
.desktop-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  
  background: var(--bg-card);
  border: none; /* ✅ REMOVED hard border */
  border-radius: 26px;
  
  padding: 10px 14px;
  
  transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  
  /* ✅ Subtle shadow instead of border */
  box-shadow: 
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 2px 4px rgba(0, 0, 0, 0.08);
  
  position: relative;
}

.desktop-input-wrapper:focus-within {
  /* ✅ Subtle blue glow on focus */
  box-shadow: 
    0 0 0 1px rgba(42, 91, 140, 0.3),
    0 0 0 4px rgba(42, 91, 140, 0.08),
    0 4px 8px rgba(0, 0, 0, 0.1);
  
  transform: translateY(-1px);
}

/* === DESKTOP ADD BUTTON === */
.desktop-add-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: transparent;
  border: none;
  border-radius: 50%;
  
  font-size: 20px;
  color: var(--text-secondary);
  
  cursor: pointer;
  transition: all 0.2s ease;
}

.desktop-add-btn:hover {
  background: var(--bg-secondary);
  color: var(--primary);
  transform: rotate(90deg) scale(1.1);
}

/* === DESKTOP TEXT INPUT === */
.desktop-chat-input {
  flex: 1;
  
  background: transparent;
  border: none;
  outline: none;
  
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  
  padding: 6px 0;
  
  resize: none;
  min-height: 24px;
  max-height: 140px;
}

.desktop-chat-input::placeholder {
  color: var(--text-tertiary);
}

/* === DESKTOP INPUT ACTIONS === */
.desktop-input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* === DESKTOP ATTACH BUTTON === */
.desktop-attach-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: transparent;
  border: none;
  border-radius: 50%;
  
  font-size: 18px;
  color: var(--text-secondary);
  
  cursor: pointer;
  transition: all 0.2s ease;
}

.desktop-attach-btn:hover {
  background: var(--bg-secondary);
  color: var(--primary);
  transform: scale(1.1) rotate(15deg);
}

/* === DESKTOP VOICE BUTTON === */
.desktop-voice-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: transparent;
  border: none;
  border-radius: 50%;
  
  font-size: 18px;
  color: var(--text-secondary);
  
  cursor: pointer;
  transition: all 0.2s ease;
}

.desktop-voice-btn:hover {
  background: var(--bg-secondary);
  color: var(--primary);
  transform: scale(1.1);
}

/* === DESKTOP SEND BUTTON === */
.desktop-send-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: var(--primary);
  border: none;
  border-radius: 50%;
  
  color: white;
  font-size: 18px;
  
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  
  box-shadow: 0 2px 6px rgba(42, 91, 140, 0.25);
}

.desktop-send-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(42, 91, 140, 0.35);
}

.desktop-send-btn:active {
  transform: scale(0.95);
}

.desktop-send-btn:disabled {
  background: var(--bg-secondary);
  color: var(--text-tertiary);
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================
   ✅ FIX #1: DESKTOP CONTROL BUTTONS HORIZONTAL
   VH Mode and Read About on the same line
   ========================================== */

.desktop-input-controls {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Align to left */
  gap: 8px; /* Space between buttons */
  padding: 0 4px;
}

/* === CONTROL BUTTONS === */
.control-btn {
  padding: 6px 14px;
  
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  
  cursor: pointer;
  transition: all 0.2s ease;
  
  display: flex;
  align-items: center;
  gap: 6px;
  
  white-space: nowrap; /* Prevent text wrapping */
}

.control-btn:hover {
  border-color: var(--primary);
  background: var(--bg-secondary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.control-btn:active {
  transform: translateY(0);
}

.control-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.control-btn i {
  font-size: 12px;
}

/* ==========================================
   ✅ FIX #2: HIDE REDUNDANT STATUS INDICATOR
   "Connected to Educational Services" already in footer
   ========================================== */

.status-indicator {
  display: none !important; /* Hide redundant status */
}

/* If you want to keep it but make it less prominent, use this instead:
.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  
  font-size: 11px;
  color: var(--text-tertiary);
  opacity: 0.6;
  
  margin-left: auto;
}
*/

.status-dot {
  width: 8px;
  height: 8px;
  
  background: var(--success);
  border-radius: 50%;
  
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ==========================================
   ✅ NEW: TYPING INDICATOR FOR AI RESPONSES
   Shows animated dots while AI is generating response
   ========================================== */

.typing-indicator {
  opacity: 0.85;
  animation: typing-fade-in 0.3s ease-out;
}

@keyframes typing-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 0.85;
    transform: translateY(0);
  }
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
  vertical-align: middle;
}

.typing-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  opacity: 0.4;
  animation: typing-blink 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-blink {
  0%, 60%, 100% {
    opacity: 0.25;
    transform: scale(0.8);
  }
  30% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* Dark mode adjustments for typing indicator */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .typing-dots span {
    opacity: 0.5;
  }
  
  :root:not([data-theme="light"]) .typing-dots span {
    animation: typing-blink-dark 1.4s ease-in-out infinite;
  }
  
  @keyframes typing-blink-dark {
    0%, 60%, 100% {
      opacity: 0.3;
      transform: scale(0.8);
    }
    30% {
      opacity: 0.9;
      transform: scale(1.1);
    }
  }
}

/* ========================================
   MOBILE-SPECIFIC INPUT ADJUSTMENTS
   ======================================== */

@media (max-width: 1023px) {
  /* Ensure input doesn't zoom on iOS */
  .chat-input,
  .desktop-chat-input {
    font-size: 16px !important;
  }
  
  /* Larger touch targets on mobile */
  .input-add-btn,
  .input-voice-btn,
  .send-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  
  /* More padding on mobile */
  .chat-input-wrapper {
    padding: 10px 14px;
  }
  
  /* Hide desktop controls on mobile */
  .desktop-input-controls {
    display: none !important;
  }
  
  /* Smaller typing dots on mobile */
  .typing-dots span {
    width: 5px;
    height: 5px;
  }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Focus states for keyboard navigation */
.input-add-btn:focus-visible,
.input-voice-btn:focus-visible,
.send-btn:focus-visible,
.desktop-add-btn:focus-visible,
.desktop-attach-btn:focus-visible,
.desktop-voice-btn:focus-visible,
.desktop-send-btn:focus-visible,
.control-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  /* Keep typing indicator visible but static */
  .typing-dots span {
    animation: none !important;
    opacity: 0.6 !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .chat-input-wrapper,
  .desktop-input-wrapper {
    border-width: 2px;
  }
  
  .send-btn,
  .desktop-send-btn {
    border: 2px solid white;
  }
  
  .control-btn {
    border-width: 2px;
  }
  
  .typing-dots span {
    background: var(--text-primary);
    opacity: 1 !important;
  }
}

/* ========================================
   DARK MODE SUPPORT (IF ENABLED)
   ======================================== */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Adjust shadows for dark mode */
    .chat-input-wrapper,
    .desktop-input-wrapper {
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    .chat-input-wrapper:focus-within,
    .desktop-input-wrapper:focus-within {
      box-shadow: 
        0 0 0 3px rgba(74, 164, 185, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.4);
    }
    
    .send-btn,
    .desktop-send-btn {
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    }
  }
}

/* ========================================
   ENHANCEMENT NOTES
   ======================================== */

/**
 * v3.3 UPDATES:
 * 
 * ✅ NEW: Animated typing indicator
 *    - Three bouncing dots
 *    - Smooth fade-in animation
 *    - Respects reduced motion preferences
 *    - Dark mode compatible
 *    - Scales appropriately on mobile
 * 
 * v3.2 FIXES:
 * 
 * ✅ FIX #1: Control buttons now horizontal
 *    - VH Mode and Read About on same line
 *    - Better spacing (8px gap)
 *    - Aligned to left side
 * 
 * ✅ FIX #2: Removed redundant status
 *    - "Connected to Educational Services" hidden
 *    - Already present in footer
 *    - Reduces visual clutter
 * 
 * IMPROVEMENTS OVER CHATGPT:
 * 
 * ✅ Smoother hover transitions (cubic-bezier easing)
 * ✅ Better focus states (rings + lift effect)
 * ✅ Icon rotation on hover (add button spins)
 * ✅ Pulse animation for recording state
 * ✅ Character counter that appears on focus
 * ✅ iOS-specific fixes (no zoom, proper font size)
 * ✅ Reduced motion support for accessibility
 * ✅ High contrast mode support
 * ✅ Better shadows (layered for depth)
 * ✅ Micro-interactions (scale, rotate, lift)
 * ✅ Control buttons with active states
 * ✅ Animated typing indicator
 * 
 * POLISH DETAILS:
 * - Buttons scale on hover/press
 * - Send button disabled until text entered
 * - Voice button pulses when recording
 * - Add button rotates 90° on hover
 * - Input lifts slightly when focused
 * - Character counter fades in on focus
 * - Smooth transitions for all states
 * - Perfect spacing and alignment
 * - Control buttons horizontal (not stacked)
 * - Typing dots bounce while AI thinks
 */

/* ========================================
   AUTH MODAL COMPONENT
   Version: 1.0 - Phase 3.1
   ======================================== */

/* Modal Overlay */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  
  display: none;
  align-items: center;
  justify-content: center;
  
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-modal.active {
  display: flex;
  opacity: 1;
}

/* Backdrop */
.auth-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay, rgba(0, 0, 0, 0.6));
  backdrop-filter: blur(4px);
  
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  
  overflow-y: auto;
}

/* Modal Content */
.auth-modal-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg-card, #ffffff);
  border-radius: var(--border-radius-lg, 12px);
  box-shadow: var(--shadow-xl, 0 20px 40px rgba(0, 0, 0, 0.15));
  
  animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Close Button */
.auth-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: transparent;
  border: none;
  border-radius: 50%;
  
  color: var(--text-secondary, #6C757D);
  font-size: 1.25rem;
  cursor: pointer;
  
  transition: all 0.2s ease;
  z-index: 10;
}

.auth-modal-close:hover {
  background: var(--bg-secondary, #F8F9FA);
  color: var(--text-primary, #2C2C2C);
  transform: rotate(90deg);
}

.auth-modal-close:focus {
  outline: 2px solid var(--interactive-primary, #2A5B8C);
  outline-offset: 2px;
}

/* Modal Header with Tabs */
.auth-modal-header {
  padding: 2rem 2rem 0;
  border-bottom: 1px solid var(--border-color, #E9ECEF);
}

.auth-modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: -1px;
}

.auth-modal-tab {
  flex: 1;
  padding: 0.875rem 1rem;
  
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  
  font-family: var(--font-primary, 'Montserrat', sans-serif);
  font-size: 1rem;
  font-weight: var(--weight-semibold, 600);
  color: var(--text-secondary, #6C757D);
  
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-modal-tab:hover {
  color: var(--interactive-primary, #2A5B8C);
  background: var(--bg-secondary, #F8F9FA);
}

.auth-modal-tab.active {
  color: var(--interactive-primary, #2A5B8C);
  border-bottom-color: var(--interactive-primary, #2A5B8C);
}

.auth-modal-tab:focus {
  outline: 2px solid var(--interactive-primary, #2A5B8C);
  outline-offset: -2px;
}

/* Modal Body */
.auth-modal-body {
  padding: 2rem;
  max-height: calc(100vh - 200px); /* Fallback */
  max-height: calc(100dvh - 200px);
  overflow-y: auto;

  /* GAP-8: Hide scrollbar while maintaining scroll functionality */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Webkit scrollbar styling for modal */
.auth-modal-body::-webkit-scrollbar {
  width: 6px;
}

.auth-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.auth-modal-body::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.auth-modal-body::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}

/* Tab Panels */
.auth-modal-panel {
  display: none;
}

.auth-modal-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal Title */
.auth-modal-title {
  margin: 0 0 0.5rem 0;
  font-family: var(--font-primary, 'Montserrat', sans-serif);
  font-size: 1.75rem;
  font-weight: var(--weight-bold, 700);
  color: var(--text-primary, #2C2C2C);
}

.auth-modal-subtitle {
  margin: 0 0 1.5rem 0;
  font-size: 0.95rem;
  color: var(--text-secondary, #6C757D);
}

/* Messages (Error/Success) */
.auth-modal-message {
  display: none;
  padding: 0.875rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: var(--border-radius-md, 8px);
  font-size: 0.9rem;
  font-weight: var(--weight-medium, 500);
}

.auth-modal-message.error {
  background: #fee;
  border: 1px solid #fcc;
  color: #c00;
}

.auth-modal-message.success {
  background: #efe;
  border: 1px solid #cfc;
  color: #060;
}

/* Error message with action links */
.auth-modal-message .error-text {
  display: block;
}

.auth-modal-message .attempts-warning {
  color: #b00;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.auth-modal-message .error-actions {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #fcc;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.auth-modal-message .error-link {
  color: var(--primary-color, #0066cc);
  text-decoration: underline;
  font-weight: 500;
  cursor: pointer;
}

.auth-modal-message .error-link:hover {
  color: var(--primary-hover, #0052a3);
}

.auth-modal-message .error-divider {
  color: #999;
  font-size: 0.85rem;
}

/* Form Styles */
.auth-modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: var(--weight-medium, 500);
  color: var(--text-primary, #2C2C2C);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  
  font-family: var(--font-secondary, 'Inter', sans-serif);
  font-size: 1rem;
  color: var(--text-primary, #2C2C2C);
  
  background: var(--bg-secondary, #F8F9FA);
  border: 1px solid var(--border-color, #E9ECEF);
  border-radius: var(--border-radius-md, 8px);
  
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: var(--interactive-primary, #2A5B8C);
  background: var(--bg-card, #ffffff);
  box-shadow: 0 0 0 3px rgba(42, 91, 140, 0.1);
}

.form-group input.error {
  border-color: var(--color-error, #DC3545);
}

.form-group input.error:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Password Wrapper */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  
  background: transparent;
  border: none;
  color: var(--text-secondary, #6C757D);
  cursor: pointer;
  padding: 0.5rem;
  
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: var(--interactive-primary, #2A5B8C);
}

.password-toggle:focus {
  outline: 2px solid var(--interactive-primary, #2A5B8C);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Form Hint */
.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted, #8E9499);
  margin-top: -0.25rem;
}

/* Form Group Inline (for "Forgot password?" link) */
.form-group-inline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: -0.5rem;
}

/* Buttons */
.auth-modal-button {
  width: 100%;
  padding: 0.875rem 1.5rem;
  
  font-family: var(--font-primary, 'Montserrat', sans-serif);
  font-size: 1rem;
  font-weight: var(--weight-semibold, 600);
  
  border: none;
  border-radius: var(--border-radius-md, 8px);
  
  cursor: pointer;
  transition: all 0.2s ease;
  
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-modal-button.primary {
  background: var(--interactive-primary, #2A5B8C);
  color: var(--text-inverse, #ffffff);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08));
}

.auth-modal-button.primary:hover:not(:disabled) {
  background: var(--interactive-primary-hover, #1f4567);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
}

.auth-modal-button.primary:active:not(:disabled) {
  transform: translateY(0);
}

.auth-modal-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-modal-button:focus {
  outline: 2px solid var(--interactive-primary, #2A5B8C);
  outline-offset: 2px;
}

/* Links */
.auth-modal-link {
  background: none;
  border: none;
  padding: 0;
  
  color: var(--interactive-primary, #2A5B8C);
  font-weight: var(--weight-medium, 500);
  text-decoration: none;
  cursor: pointer;
  
  transition: color 0.2s ease;
}

.auth-modal-link:hover {
  color: var(--interactive-primary-hover, #1f4567);
  text-decoration: none;
}

.auth-modal-link:focus {
  outline: 2px solid var(--interactive-primary, #2A5B8C);
  outline-offset: 2px;
  border-radius: 2px;
}

.auth-modal-link-small {
  font-size: 0.85rem;
  color: var(--interactive-primary, #2A5B8C);
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-modal-link-small:hover {
  color: var(--interactive-primary-hover, #1f4567);
  text-decoration: none;
}

/* Footer Text */
.auth-modal-footer-text {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary, #6C757D);
}

/* Cookie Warning */
.auth-modal-warning {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: var(--border-radius-md, 8px);
  
  font-size: 0.9rem;
  color: #856404;
}

.auth-modal-warning.hidden {
  display: none;
}

.auth-modal-warning i {
  font-size: 1.25rem;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
  .auth-modal-content {
    max-width: 100%;
    margin: 0;
    border-radius: var(--border-radius-lg, 12px) var(--border-radius-lg, 12px) 0 0;
  }
  
  .auth-modal-header,
  .auth-modal-body {
    padding: 1.5rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .auth-modal-title {
    font-size: 1.5rem;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .auth-modal,
  .auth-modal-content,
  .auth-modal-panel,
  .auth-modal-button,
  .auth-modal-tab,
  .auth-modal-close {
    animation: none;
    transition: none;
  }
}

/* ========================================
   K-12 REGISTRATION FORM STYLES
   Session 78 - GAP Fix
   Session 79 - Layout Improvements
   ======================================== */

/* Multi-step form */
.signup-step {
  display: none !important;
}

.signup-step.active {
  display: block !important;
  animation: stepFadeIn 0.35s ease-out;
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Account Type Selection - Step 1 */
.account-type-group {
  margin-bottom: 2rem;
  padding: 0.5rem 0;
}

.form-label-main {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a1a);
  margin-bottom: 1.5rem;
  text-align: center;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .form-label-main {
  color: var(--text-primary-dark, #e5e5e5);
}

.account-type-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.account-type-option {
  cursor: pointer;
  position: relative;
}

/* Hide checkbox/radio inputs - simple display none */
.account-type-checkbox,
.account-type-option input[type="radio"],
.account-type-option input[type="checkbox"] {
  display: none !important;
}

.account-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 1.25rem;
  border: 2px solid var(--border-color, #e0e0e0);
  border-radius: 16px;
  background: var(--bg-secondary, #f8f9fa);
  transition: all 0.25s ease;
  min-height: 140px;
}

.account-type-card i {
  font-size: 2.5rem;
  color: var(--primary, #2A5B8C);
  margin-bottom: 0.25rem;
}

.account-type-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary, #1a1a1a);
}

.account-type-desc {
  font-size: 0.875rem;
  color: var(--text-secondary, #666);
  text-align: center;
  line-height: 1.4;
}

.account-type-option input:checked + .account-type-card,
.account-type-card.selected {
  border-color: var(--primary, #2A5B8C);
  background: rgba(42, 91, 140, 0.08);
  box-shadow: 0 0 0 4px rgba(42, 91, 140, 0.12);
  transform: scale(1.02);
}

.account-type-option:hover .account-type-card {
  border-color: var(--primary, #2A5B8C);
  background: rgba(42, 91, 140, 0.04);
  transform: translateY(-2px);
}

[data-theme="dark"] .account-type-card {
  background: var(--bg-secondary-dark, #2a2a2a);
  border-color: var(--border-color-dark, #404040);
}

[data-theme="dark"] .account-type-title {
  color: var(--text-primary-dark, #e5e5e5);
}

[data-theme="dark"] .account-type-desc {
  color: var(--text-secondary-dark, #a0a0a0);
}

[data-theme="dark"] .account-type-option input:checked + .account-type-card,
[data-theme="dark"] .account-type-card.selected {
  background: rgba(42, 91, 140, 0.2);
  border-color: var(--primary, #2A5B8C);
}

/* Back button */
.back-to-step1 {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  margin-bottom: 1.25rem;
  background: var(--bg-secondary, #f5f5f5);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  color: var(--primary, #2A5B8C);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.back-to-step1:hover {
  background: var(--bg-primary, white);
  border-color: var(--primary, #2A5B8C);
  color: var(--primary-dark, #1f4567);
}

.back-to-step1 i {
  font-size: 0.75rem;
}

[data-theme="dark"] .back-to-step1 {
  background: var(--bg-secondary-dark, #2a2a2a);
  border-color: var(--border-color-dark, #404040);
}

/* K-12 Info Banner - COPPA Notice */
.k12-info-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, rgba(42, 91, 140, 0.08) 0%, rgba(42, 91, 140, 0.04) 100%);
  border: 2px solid rgba(42, 91, 140, 0.2);
  border-radius: 12px;
  font-size: 0.95rem;
  color: var(--text-primary, #1a1a1a);
  line-height: 1.5;
}

.k12-info-banner i {
  color: var(--primary, #2A5B8C);
  font-size: 1.75rem;
  flex-shrink: 0;
}

[data-theme="dark"] .k12-info-banner {
  background: linear-gradient(135deg, rgba(42, 91, 140, 0.15) 0%, rgba(42, 91, 140, 0.08) 100%);
  border-color: rgba(42, 91, 140, 0.3);
  color: var(--text-primary-dark, #e5e5e5);
}

/* Form Section Wrapper - Visual grouping */
.form-section {
  padding: 1.5rem;
  margin: 1.5rem -0.5rem;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 12px;
  border: 1px solid var(--border-color, #e8e8e8);
}

[data-theme="dark"] .form-section {
  background: var(--bg-secondary-dark, #252525);
  border-color: var(--border-color-dark, #3a3a3a);
}

/* Form Section Title - Clear headers */
.form-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a1a);
  margin: 0 0 1.5rem 0;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary, #2A5B8C);
  letter-spacing: -0.01em;
}

.form-section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.25rem;
  background: var(--primary, #2A5B8C);
  border-radius: 2px;
}

[data-theme="dark"] .form-section-title {
  color: var(--text-primary-dark, #e5e5e5);
  border-color: var(--primary, #2A5B8C);
}

/* Improved form spacing for K-12 */
#signup-step-child .form-group,
#signup-step-adult .form-group {
  margin-bottom: 1.25rem;
}

#signup-step-child .form-row,
#signup-step-adult .form-row {
  margin-bottom: 1rem;
}

#signup-step-child .form-group label,
#signup-step-adult .form-group label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

/* Input focus improvements */
#signup-step-child input:focus,
#signup-step-child select:focus,
#signup-step-adult input:focus {
  border-color: var(--primary, #2A5B8C);
  box-shadow: 0 0 0 4px rgba(42, 91, 140, 0.12);
}

/* Consent Group - More prominent */
.consent-group {
  margin-top: 2rem;
  padding: 1.25rem;
  background: rgba(42, 91, 140, 0.04);
  border: 1px solid rgba(42, 91, 140, 0.15);
  border-radius: 10px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-primary, #333);
}

.checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 3px;
  accent-color: var(--primary, #2A5B8C);
  cursor: pointer;
}

[data-theme="dark"] .consent-group {
  background: rgba(42, 91, 140, 0.1);
  border-color: rgba(42, 91, 140, 0.25);
}

[data-theme="dark"] .checkbox-label {
  color: var(--text-primary-dark, #d0d0d0);
}

/* Select styling - Grade dropdown */
#child-grade {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 10px;
  background: var(--bg-primary, white);
  color: var(--text-primary, #1a1a1a);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

#child-grade:focus {
  outline: none;
  border-color: var(--primary, #2A5B8C);
  box-shadow: 0 0 0 4px rgba(42, 91, 140, 0.12);
}

[data-theme="dark"] #child-grade {
  background: var(--bg-secondary-dark, #2a2a2a);
  border-color: var(--border-color-dark, #404040);
  color: var(--text-primary-dark, #e5e5e5);
}

/* Date input styling */
#child-dob {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 10px;
  background: var(--bg-primary, white);
  color: var(--text-primary, #1a1a1a);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

#child-dob:focus {
  outline: none;
  border-color: var(--primary, #2A5B8C);
  box-shadow: 0 0 0 4px rgba(42, 91, 140, 0.12);
}

[data-theme="dark"] #child-dob {
  background: var(--bg-secondary-dark, #2a2a2a);
  border-color: var(--border-color-dark, #404040);
  color: var(--text-primary-dark, #e5e5e5);
  color-scheme: dark;
}

/* Submit button for K-12 - More prominent */
#signup-child-submit {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

/* Responsive adjustments for K-12 form */
@media (max-width: 560px) {
  .account-type-options {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .account-type-card {
    flex-direction: row;
    padding: 1.25rem;
    min-height: auto;
    gap: 1rem;
    text-align: left;
  }

  .account-type-card i {
    font-size: 2rem;
    margin-bottom: 0;
  }

  .account-type-card .account-type-title,
  .account-type-card .account-type-desc {
    text-align: left;
  }

  .k12-info-banner {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
    font-size: 0.9rem;
  }

  .k12-info-banner i {
    font-size: 2rem;
  }

  .form-section-title {
    font-size: 1rem;
  }

  #signup-step-child .form-row,
  #signup-step-adult .form-row {
    grid-template-columns: 1fr;
  }

  .consent-group {
    padding: 1rem;
  }
}

/* ========================================
   SUPPORT BUTTONS - ACTIVE STATE
   Phase 3 - Priority 2
   ======================================== */

/* Active state for support buttons */
.support-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(42, 91, 140, 0.3);
}

.support-btn.active i {
  color: white;
}

/* Active state hover (different from regular hover) */
.support-btn.active:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
  box-shadow: 0 4px 12px rgba(42, 91, 140, 0.4);
}

/* Dark mode adjustments */
[data-theme="dark"] .support-btn.active {
  background: #2A5B8C;
  border-color: #2A5B8C;
}

[data-theme="dark"] .support-btn.active:hover {
  background: #1f4567;
  border-color: #1f4567;
}

/* Loading state for support buttons */
.support-btn.loading {
  position: relative;
  pointer-events: none;
}

.support-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  margin-left: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   STANDARDIZED BUTTON SYSTEM
   ========================================

   Hierarchy:
   - .btn           → Base button styles
   - .btn-primary   → Main CTA (solid primary color)
   - .btn-secondary → Secondary action (outline)
   - .btn-tertiary  → Minimal/text-like
   - .btn-danger    → Destructive actions
   - .btn-ghost     → Transparent background

   Sizes:
   - .btn-sm        → Small (32px height)
   - Default        → Medium (44px height)
   - .btn-lg        → Large (52px height)

   Modifiers:
   - .btn-full      → Full width
   - .btn-icon      → Icon-only (square)

   Usage:
   <button class="btn btn-primary">Primary Action</button>
   <button class="btn btn-secondary btn-sm">Small Secondary</button>
   <a href="#" class="btn btn-tertiary btn-full">Full Width Link</a>
   ======================================== */

/* Base Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  /* Size - Default (Medium) */
  min-height: 44px;
  padding: 10px 20px;

  /* Typography */
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;

  /* Shape */
  border-radius: 8px;
  border: 1px solid transparent;

  /* Behavior */
  cursor: pointer;
  transition: all 0.2s ease;

  /* Reset defaults */
  background: none;
  -webkit-appearance: none;
  appearance: none;
}

.btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary Button - Main CTA */
.btn-primary,
.btn.primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover,
.btn.primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:active,
.btn.primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Secondary Button - Outline Style */
.btn-secondary,
.btn.secondary {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover,
.btn.secondary:hover {
  background-color: var(--bg-secondary);
  border-color: var(--primary);
  color: var(--primary);
}

/* Tertiary Button - Minimal/Text Style */
.btn-tertiary,
.btn.tertiary {
  background-color: transparent;
  border-color: transparent;
  color: var(--primary);
  padding: 10px 12px;
}

.btn-tertiary:hover,
.btn.tertiary:hover {
  background-color: var(--bg-secondary);
  text-decoration: none;
}

/* Ghost Button - Transparent */
.btn-ghost,
.btn.ghost {
  background-color: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover,
.btn.ghost:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

/* Danger Button - Destructive Actions */
.btn-danger,
.btn.danger {
  background-color: var(--danger, #DC3545);
  border-color: var(--danger, #DC3545);
  color: #FFFFFF;
}

.btn-danger:hover,
.btn.danger:hover {
  background-color: #c82333;
  border-color: #c82333;
}

/* Outline Variant */
.btn-outline {
  background-color: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary);
  color: #FFFFFF;
}

/* ========== BUTTON SIZES ========== */

/* Small Button */
.btn-sm,
.btn.btn-sm {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* Large Button */
.btn-lg,
.btn.btn-lg {
  min-height: 52px;
  padding: 14px 28px;
  font-size: 16px;
  border-radius: 10px;
}

/* ========== BUTTON MODIFIERS ========== */

/* Full Width */
.btn-full,
.btn.btn-full,
.btn-block {
  width: 100%;
}

/* Icon Only Button */
.btn-icon,
.btn.btn-icon {
  padding: 10px;
  min-width: 44px;
  width: 44px;
}

.btn-icon.btn-sm {
  padding: 6px;
  min-width: 32px;
  width: 32px;
}

.btn-icon.btn-lg {
  padding: 14px;
  min-width: 52px;
  width: 52px;
}

/* Button with Icon + Text */
.btn i,
.btn .icon,
.btn svg {
  font-size: 1em;
  flex-shrink: 0;
}

/* ========== BUTTON GROUP ========== */

.btn-group {
  display: inline-flex;
  gap: 8px;
}

.btn-group.vertical {
  flex-direction: column;
}

/* ========== DARK THEME ADJUSTMENTS ========== */

[data-theme="dark"] .btn-secondary {
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .btn-secondary:hover {
  background-color: var(--bg-elevated);
  border-color: var(--primary);
}

[data-theme="dark"] .btn-ghost:hover {
  background-color: var(--bg-elevated);
}

[data-theme="dark"] .btn-tertiary:hover {
  background-color: var(--bg-elevated);
}

/* ========================================
   K-12 DASHBOARD ADAPTATIONS (Session 80-82)
   Option C Hybrid: Single dashboard with dynamic content
   Policy: K-8 hide career, 9-12 show career (Session 82)
   ======================================== */

/* Hide career content for K-8 users (NOT high school 9-12) */
.user-k12:not(.user-high-school) .hidden-for-k12,
body.user-k12:not(.user-high-school) #nav-career,
body.user-k12:not(.user-high-school) .icon-sidebar-item[data-section="career"],
body.user-k12:not(.user-high-school) [data-content-type="career"],
body.user-k12:not(.user-high-school) [data-audience="adult"] {
  display: none !important;
}

/* High school students (9-12) see career content */
body.user-high-school [data-audience="adult"],
body.user-high-school #nav-career,
body.user-high-school .icon-sidebar-item[data-section="career"],
body.user-high-school [data-content-type="career"] {
  display: flex !important;
}

/* Show K-12 specific content (data-audience="k12") */
body.user-k12 [data-audience="k12"] {
  display: flex !important;
}

/* K-12 visible content (legacy class support) */
.visible-for-k12 {
  display: block;
}

/* Hide K-12 specific content for adults */
.user-adult .visible-for-k12,
.user-adult .k12-learning-section,
.user-adult .parent-oversight-notice,
body.user-adult [data-audience="k12"] {
  display: none !important;
}

/* Grade badge styling */
.grade-badge {
  font-size: 0.6em;
  background: var(--color-primary, #2A5B8C);
  color: white;
  padding: 0.25em 0.5em;
  border-radius: 4px;
  margin-left: 0.5em;
  vertical-align: middle;
}

/* K-2 specific: Larger touch targets and text */
.ui-tier-k2 .quick-action-card {
  padding: 1.5rem;
  font-size: 1.1rem;
}

.ui-tier-k2 .nav-menu-link {
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
}

.ui-tier-k2 .dashboard-card {
  padding: 1.75rem;
}

/* Elementary (3-5): Slightly larger */
.ui-tier-elementary .quick-action-card {
  padding: 1.25rem;
}

/* Middle school (6-8): Standard with some career prep visible */
.ui-tier-middle .hidden-for-k12[href*="pathway"] {
  display: flex !important; /* Show pathways for 6-8 */
}

/* High school (9-12): Near-adult experience */
.ui-tier-high .hidden-for-k12[href*="pathway"],
.ui-tier-high .hidden-for-k12[href*="assessment"] {
  display: flex !important; /* Show career prep for 9-12 */
}

/* Dark theme K-12 adjustments */
[data-theme="dark"] .grade-badge {
  background: var(--color-primary, #3B82F6);
}

/* K-12 friendly colors for younger students */
.ui-tier-k2 {
  --color-primary: #10B981; /* Friendly green */
}

.ui-tier-elementary {
  --color-primary: #3B82F6; /* Bright blue */
}

