/* Epic Volcanic Temple Theme - The Colossal Dragon's Superninjas */

:root {
  /* Primary backgrounds - dark slate with purple undertone */
  --bg-primary: #1e1e2e;
  --bg-secondary: #2a2a3e;
  --bg-elevated: #352847;

  /* Volcanic accents */
  --volcanic-primary: #ff6b35;
  --volcanic-glow: #ff8c42;
  --volcanic-deep: #c14a2f;

  /* Dragon gold - warm amber */
  --gold-bright: #fbbf24;
  --gold-deep: #d97706;

  /* Ninja accents - indigo */
  --ninja-primary: #6366f1;
  --ninja-shadow: #4338ca;

  /* Text - high contrast */
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-accent: #fbbf24;

  /* Smoke/gray tones */
  --smoke-light: #9ca3af;
  --smoke-medium: #6b7280;

  /* Effects */
  --glow-volcanic: rgba(255, 107, 53, 0.3);
  --glow-dragon: rgba(251, 191, 36, 0.3);
  --glow-ninja: rgba(99, 102, 241, 0.3);
  --shadow-deep: rgba(0, 0, 0, 0.6);

  /* Theme variables (can be overridden per page) */
  --theme-primary: var(--volcanic-primary);
  --theme-glow: var(--glow-volcanic);

  /* Transitions */
  --transition: all 0.3s ease;
  --transition-slow: all 0.5s ease;
}

* {
  box-sizing: border-box;
}

body {
  /* Layered background with volcanic atmosphere */
  background:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence baseFrequency="0.9"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.05"/></svg>'),
    radial-gradient(ellipse at 50% 120%, rgba(255, 107, 53, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 50% -20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, #1f2937 0%, #2a1a3a 100%);
  background-attachment: fixed;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
}

/* Animated magma breathing at bottom */
body::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: radial-gradient(ellipse at bottom,
    rgba(255, 107, 53, 0.2) 0%,
    rgba(201, 74, 47, 0.1) 40%,
    transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: magmaBreathing 6s ease-in-out infinite;
}

@keyframes magmaBreathing {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Ensure content appears above background effects */
.container,
.site-header {
  position: relative;
  z-index: 1;
}

/* Header and Title */
.site-header {
  text-align: center;
  padding: 2rem 1rem 1rem;
  background: linear-gradient(135deg, rgba(42, 42, 62, 0.9) 0%, rgba(30, 30, 46, 0.95) 100%);
  box-shadow: 0 4px 16px var(--shadow-deep);
  border-bottom: 3px solid var(--volcanic-primary);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.site-header::before {
  content: '🐉';
  position: absolute;
  left: 5%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  opacity: 0.4;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
  animation: dragonFloat 3s ease-in-out infinite;
}

.site-header::after {
  content: '🥷';
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  opacity: 0.4;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
  animation: ninjaFloat 3s ease-in-out infinite;
}

@keyframes dragonFloat {
  0%, 100% { transform: translateY(-50%) rotate(-5deg); }
  50% { transform: translateY(-60%) rotate(5deg); }
}

@keyframes ninjaFloat {
  0%, 100% { transform: translateY(-50%) rotate(5deg); }
  50% { transform: translateY(-60%) rotate(-5deg); }
}

/* Floating dragons and ninjas across the page */
.floating-characters {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.dragon-float, .ninja-float {
  position: absolute;
  font-size: 2rem;
  opacity: 0.4;
  transition: none;
  will-change: transform, left, top;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.site-title {
  font-family: 'Luminari', fantasy, serif;
  font-size: 2.5rem;
  margin: 0 0 1rem;
  background: linear-gradient(135deg, #fbbf24 0%, #ff6b35 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  text-decoration: underline;
  text-decoration-color: rgba(255, 107, 53, 0.5);
  position: relative;
  z-index: 1;
}

/* Navigation */
.nav-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.nav-btn {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #352847 0%, #2a2a3e 100%);
  border: 2px solid rgba(99, 102, 241, 0.4);
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

/* Metallic sheen effect */
.nav-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.nav-btn:hover::after {
  left: 100%;
}

.nav-btn:hover {
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  border-color: var(--gold-bright);
  box-shadow: 0 0 20px var(--glow-ninja);
  transform: translateY(-2px);
}

.nav-btn.active {
  background: linear-gradient(135deg, #ff6b35 0%, #c14a2f 100%);
  border-color: var(--gold-bright);
  box-shadow: 0 0 30px var(--glow-volcanic);
}

/* Main Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Section Headings */
h2 {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  margin: 2rem 0 1.5rem;
  color: var(--text-primary);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  position: relative;
  padding-bottom: 0.5rem;
}

/* Gradient text for dragon headings */
h2.dragon-heading,
.dragon-section h2 {
  background: linear-gradient(135deg, #fbbf24 0%, #ff6b35 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--volcanic-primary), transparent);
  margin: 0.5rem auto 0;
  box-shadow: 0 0 10px var(--glow-volcanic);
}

/* Content Box */
.content-box {
  background: linear-gradient(145deg, rgba(42, 42, 62, 0.9), rgba(35, 35, 53, 0.85));
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(255, 107, 53, 0.1);
  margin: 2rem auto;
  max-width: 800px;
  text-align: center;
  border: 1px solid rgba(255, 107, 53, 0.2);
  backdrop-filter: blur(10px);
}

/* Grid Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
  justify-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

/* Card with volcanic depth */
.card {
  background: linear-gradient(145deg, #2a2a3e, #232335);
  border-radius: 8px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(255, 107, 53, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 107, 53, 0.2);
  position: relative;
}

/* Volcanic crack border effect */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, #ff6b35, #fbbf24, #ff6b35);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(255, 107, 53, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card:hover::before {
  opacity: 0.6;
}

.card-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  background: #1a1a2a;
}

.card-content {
  padding: 1rem;
  text-align: center;
  position: relative;
  z-index: 2;
}

.card-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

/* Brighten dark colors in card titles */
.card-title[style*="color: black"],
.card-title[style*="color: #333"] {
  color: var(--text-primary) !important;
}

.card-title[style*="color: purple"] {
  color: var(--ninja-primary) !important;
}

.card-title[style*="color: red"] {
  color: var(--volcanic-primary) !important;
}

.card-title[style*="color: orange"] {
  color: var(--volcanic-glow) !important;
}

.card-title[style*="color: blue"],
.card-title[style*="color: #0088ff"],
.card-title[style*="color: #3b8dd1"] {
  color: #60a5fa !important;
}

.card-title[style*="color: #005c18"] {
  color: #4ade80 !important;
}

.card-text {
  margin: 0.5rem 0;
  color: var(--text-secondary);
}

/* Brighten dark colors in card text */
.card-text[style*="color: black"] {
  color: var(--text-primary) !important;
}

.card-text[style*="color: purple"] {
  color: var(--ninja-primary) !important;
}

.card-text[style*="color: red"] {
  color: var(--volcanic-primary) !important;
}

.card-text[style*="color: orange"] {
  color: var(--volcanic-glow) !important;
}

.card-text[style*="color: blue"],
.card-text[style*="color: #0088ff"],
.card-text[style*="color: #3b8dd1"] {
  color: #60a5fa !important;
}

.card-text[style*="color: #005c18"] {
  color: #4ade80 !important;
}

/* Video Container */
.video-wrapper {
  position: relative;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  cursor: pointer;
}

.video-wrapper canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.5) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 4rem;
  transition: var(--transition);
  cursor: pointer;
  z-index: 10;
}

.video-placeholder:hover {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.5) 0%, rgba(201, 74, 47, 0.4) 100%);
  transform: scale(1.01);
  box-shadow: 0 0 20px rgba(255, 107, 53, 0.2);
}

.video-placeholder.hidden {
  display: none;
}

/* Video Modal */
.video-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.3s ease-out;
}

.video-modal.active {
  display: flex;
}

.video-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
}

.video-modal video {
  width: 100%;
  height: auto;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px var(--glow-volcanic);
  border: 2px solid rgba(255, 107, 53, 0.4);
}

.video-modal-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: linear-gradient(135deg, #ff6b35, #c14a2f);
  color: white;
  border: 2px solid var(--gold-bright);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 20px var(--glow-volcanic);
}

.video-modal-close:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5), 0 0 30px var(--glow-volcanic);
}

/* Table (for data that needs to stay tabular) */
.data-table {
  width: 100%;
  max-width: 600px;
  margin: 2rem auto;
  background: linear-gradient(145deg, #2a2a3e, #232335);
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.2);
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: linear-gradient(135deg, #352847, #2a2a3e);
  color: var(--text-primary);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 107, 53, 0.3);
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

/* Default color for cells without inline styles */
.data-table td:not([style*="color"]) {
  color: var(--text-secondary);
}

/* Add glow to all colored table cells */
.data-table td[style*="color"] {
  text-shadow: 0 0 12px currentColor, 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Specific color brightening for known dark colors */
.data-table td[style*="color: black"],
.data-table td[style*="color: #333"],
.data-table td[style*="color: rgb(51, 51, 51)"],
.data-table td[style*="color: rgb(51,"],
.data-table td[style*="#333333"] {
  color: var(--text-primary) !important;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
}

.data-table td[style*="color: purple"] {
  color: var(--ninja-primary) !important;
}

.data-table td[style*="color: red"] {
  color: var(--volcanic-primary) !important;
}

.data-table td[style*="color: orange"] {
  color: var(--volcanic-glow) !important;
}

.data-table td[style*="color: blue"],
.data-table td[style*="color: #0088ff"],
.data-table td[style*="color: #3b8dd1"] {
  color: #60a5fa !important;
}

.data-table td[style*="color: #005c18"] {
  color: #4ade80 !important;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover {
  background: rgba(255, 107, 53, 0.05);
}

/* Element Icons */
.element-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin: 2rem auto;
  max-width: 900px;
  justify-items: center;
}

.element-card {
  background: linear-gradient(145deg, #2a2a3e, #232335);
  padding: 1rem;
  border-radius: 8px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(255, 107, 53, 0.1);
  text-align: center;
  transition: var(--transition);
  border: 1px solid rgba(255, 107, 53, 0.2);
}

.element-card:hover {
  transform: scale(1.05) translateY(-4px);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 0 30px var(--glow-volcanic);
}

.element-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 0.5rem;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.element-name {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin: 0;
  font-weight: 600;
}

/* Weapons List */
.weapons-list {
  background: linear-gradient(145deg, #2a2a3e, #232335);
  max-width: 400px;
  margin: 2rem auto;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.weapons-list h3 {
  color: var(--ninja-primary);
  margin-top: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.weapons-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.weapons-list li {
  padding: 0.5rem 0;
  font-weight: bold;
  color: var(--ninja-primary);
}

.weapons-list li::before {
  content: "⭐ ";
  margin-right: 0.5rem;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.5));
}

/* Story Cards */
.story-card {
  background: linear-gradient(145deg, #2a2a3e, #232335);
  padding: 2rem;
  border-radius: 8px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(255, 107, 53, 0.1);
  margin: 2rem auto;
  max-width: 800px;
  border: 1px solid rgba(255, 107, 53, 0.2);
}

.story-card h3 {
  color: var(--text-primary);
  margin-top: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.story-card p {
  color: var(--volcanic-primary);
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Links */
.favorite-links {
  background: linear-gradient(145deg, #2a2a3e, #232335);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(255, 107, 53, 0.1);
  margin: 2rem auto;
  max-width: 600px;
  border: 1px solid rgba(255, 107, 53, 0.2);
}

.favorite-links a {
  color: var(--gold-bright);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.favorite-links a:hover {
  color: var(--volcanic-primary);
  text-shadow: 0 0 10px var(--glow-volcanic);
  text-decoration: underline;
}

/* Iframe container */
.iframe-container {
  background: linear-gradient(145deg, #2a2a3e, #232335);
  padding: 2rem;
  border-radius: 8px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(255, 107, 53, 0.1);
  margin: 2rem auto;
  max-width: 900px;
  border: 1px solid rgba(255, 107, 53, 0.2);
}

.iframe-container iframe {
  border-radius: 8px;
  border: 2px solid rgba(255, 107, 53, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .site-title {
    font-size: 1.75rem;
  }

  .nav-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .card-image {
    height: 200px;
  }

  .element-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

/* Loading state */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
  font-size: 1.2rem;
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* Ember particles - will be added via JavaScript */
.ember {
  position: fixed;
  bottom: -10px;
  width: 3px;
  height: 3px;
  background: radial-gradient(circle, #fbbf24, #ff6b35);
  border-radius: 50%;
  pointer-events: none;
  animation: floatEmber 10s linear infinite;
  box-shadow: 0 0 6px rgba(255, 107, 53, 0.8);
  z-index: 0;
}

@keyframes floatEmber {
  0% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-100vh) translateX(var(--drift)) scale(0.5);
    opacity: 0;
  }
}

/* Elemental theming overrides */
body[data-element="water"] {
  --theme-primary: #3b82f6;
  --theme-glow: rgba(59, 130, 246, 0.3);
}

body[data-element="water"]::after {
  background: radial-gradient(ellipse at bottom,
    rgba(59, 130, 246, 0.15) 0%,
    transparent 60%);
}

body[data-element="ice"] {
  --theme-primary: #7dd3fc;
  --theme-glow: rgba(125, 211, 252, 0.3);
}

body[data-element="ice"]::after {
  background: radial-gradient(ellipse at bottom,
    rgba(125, 211, 252, 0.15) 0%,
    transparent 60%);
}
