/* ===== MODAL ENHANCEMENTS & SACRED INTERACTIONS ===== */

/* Enhanced Modal Styling */
.modal-header {
  display: flex;
  align-items: center;
  gap: var(--sacred-margin);
  margin-bottom: calc(var(--sacred-margin) * 1.5);
  padding-bottom: var(--sacred-margin);
  border-bottom: 2px solid rgba(107, 70, 193, 0.3);
}

.modal-icon {
  font-size: 3rem;
  text-shadow: var(--shadow-glow);
  animation: pulseGlow 3s ease-in-out infinite;
}

.modal-title {
  font-family: var(--font-sacred);
  font-size: 2rem;
  font-weight: 700;
  color: var(--sacred-gold);
  text-shadow: var(--shadow-glow);
  margin: 0;
}

.modal-subtitle {
  font-family: var(--font-accent);
  font-size: 1rem;
  color: var(--sacred-accent);
  font-style: italic;
  margin: calc(var(--sacred-unit) / 2) 0 0 0;
}

.modal-description,
.modal-backstory,
.artifact-details,
.relic-details,
.scroll-details,
.tech-details,
.modal-reflection,
.modal-protection {
  margin-bottom: calc(var(--sacred-margin) * 1.5);
  padding: var(--sacred-padding);
  background: rgba(107, 70, 193, 0.05);
  border-radius: 12px;
  border-left: 3px solid var(--sacred-accent);
}

.modal-description h3,
.modal-backstory h3,
.artifact-details h3,
.relic-details h3,
.scroll-details h3,
.tech-details h3,
.modal-reflection h3,
.modal-protection h3 {
  font-family: var(--font-sacred);
  font-size: 1.3rem;
  color: var(--sacred-gold);
  margin: 0 0 var(--sacred-padding) 0;
  display: flex;
  align-items: center;
  gap: var(--sacred-unit);
}

.modal-description h3::before {
  content: '📜';
}

.modal-backstory h3::before {
  content: '📖';
}

.artifact-details h3::before,
.relic-details h3::before,
.scroll-details h3::before,
.tech-details h3::before {
  content: '⚡';
}

.modal-reflection h3::before {
  content: '🪞';
}

.modal-protection h3::before {
  content: '🛡️';
}

.property-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sacred-gap);
  margin-top: var(--sacred-padding);
}

.property {
  background: rgba(10, 10, 15, 0.5);
  padding: calc(var(--sacred-unit) * 1.5);
  border-radius: 8px;
  border: 1px solid rgba(107, 70, 193, 0.2);
  font-family: var(--font-body);
  color: var(--sacred-silver);
  transition: var(--transition-fast);
}

.property:hover {
  border-color: var(--sacred-accent);
  background: rgba(107, 70, 193, 0.1);
}

.property strong {
  color: var(--sacred-gold);
  font-family: var(--font-sacred);
  font-size: 0.9rem;
}

.reflection-text {
  font-family: var(--font-accent);
  font-style: italic;
  line-height: 1.8;
  color: var(--sacred-silver);
  text-align: center;
  padding: var(--sacred-padding);
  background: rgba(10, 10, 15, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.protection-blessing {
  font-family: var(--font-sacred);
  font-weight: 600;
  color: var(--sacred-gold);
  text-align: center;
  text-shadow: var(--shadow-glow);
  padding: var(--sacred-padding);
  background: rgba(212, 175, 55, 0.1);
  border-radius: 8px;
  border: 1px solid var(--sacred-gold);
}

/* Modal Sacred Geometry Background */
.modal-sacred-geometry {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.1;
  pointer-events: none;
  z-index: -1;
}

.modal-sacred-geometry .sacred-mandala {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Enhanced Item Card Meta Styling */
.artifact-meta,
.relic-meta,
.scroll-meta,
.tech-meta {
  background: rgba(10, 10, 15, 0.3);
  padding: var(--sacred-padding);
  border-radius: 8px;
  border-top: 2px solid var(--sacred-accent);
  margin-bottom: var(--sacred-padding);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--sacred-unit) / 2) 0;
  border-bottom: 1px solid rgba(107, 70, 193, 0.1);
  font-size: 0.9rem;
}

.meta-row:last-child {
  border-bottom: none;
}

.meta-row strong {
  color: var(--sacred-gold);
  font-family: var(--font-sacred);
  font-weight: 500;
}

/* Sacred Blessing Animation */
.sacred-blessing {
  color: var(--sacred-gold) !important;
  font-weight: 600 !important;
  text-shadow: var(--shadow-glow);
  animation: brandGlow 2s ease-in-out infinite;
}

/* Enhanced Navigation Active States */
.nav-link.active {
  color: var(--sacred-black) !important;
  background: var(--sacred-gradient-accent);
  box-shadow: var(--shadow-glow);
}

.nav-link.active::before {
  opacity: 1;
}

/* Keyboard Navigation Enhancement */
.keyboard-navigation *:focus {
  outline: 2px solid var(--sacred-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* High Contrast Mode Enhancements */
.high-contrast-mode {
  --sacred-black: #000000;
  --sacred-silver: #ffffff;
  --sacred-gold: #ffff00;
  --sacred-accent: #00ff00;
}

.high-contrast-mode .item-card {
  border: 2px solid var(--sacred-silver);
}

.high-contrast-mode .nav-link {
  border: 1px solid var(--sacred-silver);
}

/* Skip to Main Content Link */
.skip-to-main:focus {
  position: absolute !important;
  top: 6px !important;
  left: 6px !important;
  z-index: 100000;
  background: var(--sacred-gold);
  color: var(--sacred-black);
  padding: 8px 12px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  font-family: var(--font-sacred);
}

/* Sacred Achievement Notification */
.sacred-achievement-notification {
  animation: slideInFromRight 0.6s ease-out, fadeOut 0.6s ease-out 4s forwards;
}

.achievement-content {
  display: flex;
  align-items: center;
  gap: var(--sacred-gap);
}

.achievement-icon {
  font-size: 1.5rem;
}

.achievement-text {
  font-family: var(--font-sacred);
  font-weight: 600;
}

/* Mystical Mode Enhancements */
.mystical-mode .sacred-particles {
  animation: particleFloat 15s ease-in-out infinite alternate;
}

.mystical-mode .item-card {
  box-shadow: var(--shadow-sacred), 0 0 20px rgba(107, 70, 193, 0.3);
}

.mystical-mode .trinity-node {
  box-shadow: 0 0 20px var(--sacred-gold), 0 0 40px rgba(212, 175, 55, 0.5);
}

.mystical-mode .section-title {
  text-shadow: var(--shadow-glow), 0 0 30px rgba(212, 175, 55, 0.5);
}

/* Sacred Error States */
.sacred-error-toast {
  animation: slideInFromBottom 0.6s ease-out, fadeOut 0.6s ease-out 4s forwards;
}

.error-icon {
  margin-right: var(--sacred-gap);
  font-size: 1.2rem;
}

/* Sacred Loading States */
.item-card.loading {
  opacity: 0.5;
  pointer-events: none;
}

.item-card.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border: 3px solid var(--sacred-gold);
  border-top: 3px solid transparent;
  border-radius: 50%;
  animation: sacredLoading 1s linear infinite;
}

/* Responsive Modal Enhancements */
@media (max-width: 768px) {
  .property-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-header {
    flex-direction: column;
    text-align: center;
    gap: var(--sacred-padding);
  }
  
  .modal-icon {
    font-size: 2.5rem;
  }
  
  .modal-title {
    font-size: 1.6rem;
  }
  
  .modal-content {
    max-height: 95vh;
    margin: var(--sacred-unit);
  }
}

@media (max-width: 480px) {
  .modal-icon {
    font-size: 2rem;
  }
  
  .modal-title {
    font-size: 1.4rem;
  }
  
  .modal-description,
  .modal-backstory,
  .artifact-details,
  .relic-details,
  .scroll-details,
  .tech-details,
  .modal-reflection,
  .modal-protection {
    padding: var(--sacred-unit);
    margin-bottom: var(--sacred-padding);
  }
}

/* Sacred Scroll Animations */
.animate-in {
  animation: slideInFromBottom 0.8s ease-out forwards;
}

.shrine-section.animate-in .section-title {
  animation: textReveal 1s ease-out 0.2s forwards;
}

.shrine-section.animate-in .section-description {
  animation: textReveal 1s ease-out 0.4s forwards;
}

.shrine-section.animate-in .item-card {
  animation: slideInFromBottom 0.8s ease-out forwards;
}

.shrine-section.animate-in .item-card:nth-child(1) {
  animation-delay: 0.1s;
}

.shrine-section.animate-in .item-card:nth-child(2) {
  animation-delay: 0.2s;
}

.shrine-section.animate-in .item-card:nth-child(3) {
  animation-delay: 0.3s;
}

.shrine-section.animate-in .item-card:nth-child(4) {
  animation-delay: 0.4s;
}

/* Print Styles for Sacred Documentation */
@media print {
  .sacred-header,
  .sacred-particles,
  .enter-shrine-btn,
  .whisper-container,
  .sacred-footer {
    display: none !important;
  }
  
  .shrine-section {
    page-break-inside: avoid;
    margin-bottom: 2rem;
  }
  
  .item-card {
    border: 1px solid #000;
    margin-bottom: 1rem;
    break-inside: avoid;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .section-title,
  .item-title {
    color: black !important;
  }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  .sacred-particles,
  .trinity-node,
  .trinity-center,
  .sacred-mandala .mandala-ring {
    animation: none !important;
  }
  
  .item-card:hover {
    transform: none !important;
    animation: none !important;
  }
  
  .modal-fade-in,
  .whisper-appear,
  .slide-in-bottom,
  .animate-in {
    animation: none !important;
  }
}