/* Conditionally opt-in based on localStorage setting */
@view-transition {
  navigation: auto;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, black 0%, #1a66bb 100%);
  min-height: 100vh;
  color: white;
}

.header {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

nav a {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.2s;
  display: inline-block;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.3);
}

nav a.active {
  background: white;
  color: #f5576c;
  view-transition-name: active-link;
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.toggle-label {
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  width: 60px;
  height: 30px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.6s;
}

.toggle-switch.active {
  background: #4caf50;
}

.toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  transition: transform 0.6s;
}

.toggle-switch.active .toggle-slider {
  transform: translateX(30px);
}

.mode-indicator {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mode-indicator strong {
  color: #4caf50;
}

.container {
  padding: 3rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

h1 {
  color: white;
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  view-transition-name: page-title;
}

.subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.3rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 16px;
  margin-top: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card h2 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

.card p {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.info-box {
  background: rgba(76, 175, 80, 0.2);
  border: 2px solid rgba(76, 175, 80, 0.5);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  color: white;
}

.info-box h3 {
  margin-bottom: 0.5rem;
  color: #4caf50;
}

/* Fallback animations */
@keyframes fallback-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.use-fallback {
  animation: fallback-fade-in 0.4s ease-out;
}

/* View transition styles */
::view-transition-old(page-title),
::view-transition-new(page-title) {
  animation-duration: 0.8s;
}

::view-transition-old(active-link) {
  animation: 0.6s ease-out both fade-out;
}

::view-transition-new(active-link) {
  animation: 0.6s ease-out both fade-in;
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.use-fallback {
    animation: none;
  }
}