/* 
 * Modal Styles - Consistent across all pages
 * Purple headings, cyan text, purple glow animation
 */

/* Modal Background - Dracula Theme Simplified */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  /* Simple dark overlay - no blur for performance */
  background: rgba(22, 22, 30, 0.95);
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Modal Content Box - Dracula theme with purple neon glow */
.modal-content {
  background: var(--bg-dark);
  margin: 5% auto;
  padding: 0;
  border: 1px solid rgba(189, 147, 249, 0.2);
  border-radius: 12px;
  width: 80%;
  max-width: 800px;
  position: relative;
  /* Fast, simple animation */
  animation: modalSlideIn 0.2s ease-out;
  /* Match card glow exactly */
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  /* Enable hardware acceleration */
  transform: translateZ(0);
  transition: all 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hover effect - matching cards exactly */
.modal-content:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 0 20px rgba(189, 147, 249, 0.6),
              0 0 30px rgba(189, 147, 249, 0.4),
              0 0 40px rgba(139, 233, 253, 0.2);
  border-color: rgba(189, 147, 249, 0.5);
  background: rgba(36, 40, 59, 0.85);
}

/* Modal Header */
.modal-header {
  padding: 2rem;
  background: linear-gradient(135deg, rgba(189, 147, 249, 0.08), transparent);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  position: relative;
}

/* Subtle separator line with glow */
.modal-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(189, 147, 249, 0.3), transparent);
  box-shadow: 0 0 5px rgba(189, 147, 249, 0.2);
}

.modal-header h2 {
  color: var(--purple) !important;
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 2px;
  margin: 0;
  /* Simplified text shadow for performance */
  text-shadow: 0 2px 10px rgba(189, 147, 249, 0.3);
  font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Modal Body */
.modal-body {
  padding: 2rem;
  max-height: 60vh;
  overflow-y: auto;
  font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* All headings in purple */
.modal-body h3,
.modal-body h4,
.modal-body h5 {
  color: var(--purple) !important;
  margin-bottom: 1rem;
  /* Simplified text shadow */
  text-shadow: 0 1px 5px rgba(189, 147, 249, 0.2);
}

.modal-body h3 {
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 1px;
  margin-top: 1.5rem;
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-body h4 {
  font-size: 1.2rem;
  font-weight: 500;
  margin-top: 1.5rem;
}

/* All text in cyan */
.modal-body p,
.modal-body li {
  color: var(--cyan) !important;
  line-height: 1.8;
  font-size: 0.95rem;
}

.modal-body p {
  margin-bottom: 1rem;
}

.modal-body ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.modal-body li {
  margin-bottom: 0.5rem;
}

/* Strong text in brighter cyan */
.modal-body strong {
  color: #a0f0ff !important;
  font-weight: 600;
}

/* Em text keeps same color but italic */
.modal-body em {
  color: inherit !important;
  font-style: italic;
}

/* Ensure em tags in headings stay purple */
.modal-body h3 em,
.modal-body h4 em,
.modal-body h5 em,
.modal-header h2 em {
  color: inherit !important;
  font-style: italic;
}

/* Special quote styling */
.modal-body p[style*="text-align: center"] {
  color: var(--purple) !important;
  font-size: 1.1rem;
  font-weight: 600;
  text-shadow: 0 1px 8px rgba(189, 147, 249, 0.3);
  margin: 2rem 0;
}

/* Close button - Dark magenta with purple neon glow */
.modal .close {
  color: #8b008b; /* Dark magenta */
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 32px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  /* Purple neon glow effect */
  text-shadow: 0 0 8px rgba(189, 147, 249, 0.6),
               0 0 12px rgba(189, 147, 249, 0.4),
               0 0 20px rgba(189, 147, 249, 0.2);
}

.modal .close:hover,
.modal .close:focus {
  color: var(--purple);
  transform: rotate(90deg);
  /* Enhanced purple neon glow on hover */
  text-shadow: 0 0 10px rgba(189, 147, 249, 0.9),
               0 0 20px rgba(189, 147, 249, 0.7),
               0 0 30px rgba(189, 147, 249, 0.5),
               0 0 40px rgba(189, 147, 249, 0.3);
}

/* Scrollbar styling for modal body */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(189, 147, 249, 0.1);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--purple);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #8b008b;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  /* Hide the separator line on mobile to save space */
  .modal-header::after {
    display: none;
  }
  
  /* Tighter close button positioning */
  .modal .close {
    top: 0.5rem;
    right: 1rem;
    font-size: 28px;
  }
  
  /* Optimize modal body padding */
  .modal-body {
    padding: 1rem !important;
    padding-top: 0.5rem !important;
    max-height: 70vh;
  }
  
  /* Remove top margin from first element in modal body */
  .modal-body > *:first-child {
    margin-top: 0 !important;
  }
}

/* Desktop optimizations - ONLY for Learn More modals with specific class */
@media screen and (min-width: 769px) {
  .learn-more-modal .modal-header {
    padding: 10px 20px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
  
  .learn-more-modal .modal-header h2,
  .learn-more-modal #modalTitle {
    font-size: 1.5rem !important;
  }
  
  .learn-more-modal .modal-body {
    padding: 1.5rem !important;
  }
}