/* JoJo's Bizarre Adventure Character Relationship Website Styles */

/* Import Google Fonts for JoJo-themed typography */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Oswald:wght@300;400;500;600;700&family=Bebas+Neue&display=swap');

/* Custom CSS Variables for JoJo Theme */
:root {
  --jojo-gold: #FFD700;
  --jojo-purple: #8B00FF;
  --jojo-red: #DC143C;
  --jojo-blue: #4169E1;
  --jojo-green: #32CD32;
  --jojo-dark: #1a1a2e;
  --jojo-darker: #16213e;
  --jojo-accent: #e94560;
  --text-light: #f5f5f5;
  --text-muted: #b0b0b0;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Oswald', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* JoJo Title Styling */
.jojo-title {
  font-family: 'Bebas Neue', cursive;
  text-shadow: 
    0 0 10px var(--jojo-gold),
    0 0 20px var(--jojo-gold),
    0 0 30px var(--jojo-gold);
  letter-spacing: 3px;
  animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  from {
    text-shadow: 
      0 0 10px var(--jojo-gold),
      0 0 20px var(--jojo-gold),
      0 0 30px var(--jojo-gold);
  }
  to {
    text-shadow: 
      0 0 15px var(--jojo-gold),
      0 0 25px var(--jojo-gold),
      0 0 35px var(--jojo-gold),
      0 0 45px var(--jojo-gold);
  }
}

/* Part Selection Buttons */
.part-btn {
  position: relative;
  overflow: hidden;
  transform: perspective(1px) translateZ(0);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.part-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.part-btn.active {
  border-color: var(--jojo-gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.part-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.part-btn:hover::before {
  left: 100%;
}

/* Character Cards */
.character-card {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5));
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.character-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--jojo-gold);
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 215, 0, 0.3);
}

.character-card.selected {
  border-color: var(--jojo-gold);
  box-shadow: 
    0 0 30px rgba(255, 215, 0, 0.6),
    inset 0 0 20px rgba(255, 215, 0, 0.1);
}

.character-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 215, 0, 0.1) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.character-card:hover::before {
  opacity: 1;
}

.character-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(255, 215, 0, 0.3);
  transition: all 0.3s ease;
}

.character-card:hover img {
  border-color: var(--jojo-gold);
  box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.character-name {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  color: var(--jojo-gold);
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.character-part {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.25rem;
}

/* Role Color Coding */
.role-protagonist { color: var(--jojo-gold); }
.role-main-antagonist { color: var(--jojo-red); }
.role-ally { color: var(--jojo-green); }
.role-mentor-ally { color: var(--jojo-blue); }
.role-antagonist { color: var(--jojo-purple); }

/* SVG Diagram Styles */
#relationship-diagram {
  background: radial-gradient(circle at center, #1a1a2e 0%, #0f0f1e 100%);
}

.node-circle {
  stroke-width: 3;
  cursor: pointer;
  transition: all 0.3s ease;
}

.node-circle:hover {
  stroke-width: 5;
  filter: drop-shadow(0 0 10px currentColor);
}

.node-circle.selected {
  stroke-width: 6;
  filter: drop-shadow(0 0 15px currentColor);
}

.node-text {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 12px;
  fill: white;
  text-anchor: middle;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.link-line {
  stroke-width: 2;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.link-line.highlighted {
  stroke-width: 4;
  opacity: 1;
  filter: drop-shadow(0 0 5px currentColor);
}

.link-line.dimmed {
  opacity: 0.1;
}

/* Relationship type colors */
.relationship-enemy { stroke: var(--jojo-red); }
.relationship-ally { stroke: var(--jojo-green); }
.relationship-family { stroke: var(--jojo-blue); }
.relationship-mentor { stroke: var(--jojo-gold); }
.relationship-rival { stroke: var(--jojo-purple); }
.relationship-neutral { stroke: var(--text-muted); }

/* Control Buttons */
.control-btn {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.8), rgba(255, 215, 0, 0.6));
  border: 2px solid var(--jojo-gold);
  color: black;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Oswald', sans-serif;
}

.control-btn:hover {
  background: linear-gradient(135deg, var(--jojo-gold), rgba(255, 215, 0, 0.8));
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
  .jojo-title {
    font-size: 2.5rem;
    letter-spacing: 2px;
  }
  
  .character-card {
    padding: 0.75rem;
  }
  
  .character-card img {
    height: 100px;
  }
  
  .character-name {
    font-size: 0.8rem;
  }
  
  .character-part {
    font-size: 0.7rem;
  }
  
  .node-text {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .jojo-title {
    font-size: 2rem;
    letter-spacing: 1px;
  }
  
  .part-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .character-card img {
    height: 80px;
  }
  
  .character-name {
    font-size: 0.75rem;
  }
  
  .node-text {
    font-size: 8px;
  }
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 215, 0, 0.3);
  border-radius: 50%;
  border-top-color: var(--jojo-gold);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Tooltip Styles */
.tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 1000;
  border: 1px solid var(--jojo-gold);
  backdrop-filter: blur(5px);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--jojo-darker);
}

::-webkit-scrollbar-thumb {
  background: var(--jojo-gold);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 0, 0.8);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
button:focus,
.character-card:focus {
  outline: 2px solid var(--jojo-gold);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .character-card {
    border-width: 3px;
  }
  
  .node-circle {
    stroke-width: 4;
  }
  
  .link-line {
    stroke-width: 3;
  }
}