/* ============================================
   DOCS/CHANGELOG PAGE STYLES
   Colors are injected via banner.js from colors.json
============================================ */

:root {
  --banner-height: 5rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100%;
  background: transparent;
  color: var(--TEXT);
  font-family: 'Exo 2', sans-serif;
  overflow-x: hidden;
}

/* Transition overlay */
#transition-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 1;
  pointer-events: all;
  transition: opacity 0.6s ease;
  z-index: 9999;
}

#transition-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Fade animation */
.fade-slide-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-slide-in.show {
  opacity: 1;
  transform: translateY(0);
}

/* Layout */
.layout-padding {
  padding-top: var(--banner-height);
}

#banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--banner-height);
  pointer-events: none;
  z-index: -1;
}

#starfieldCanvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: transparent;
  pointer-events: none;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Page Header */
.page-header {
  text-align: center;
  margin-bottom: 3rem;
}

.back-link {
  display: inline-block;
  color: var(--BLUE);
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--WHITE);
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--WHITE);
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--TEXT);
}

/* Changelog Timeline */
.changelog-timeline {
  position: relative;
  padding-left: 2rem;
}

/* Timeline line */
.changelog-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--BLUE) 0%, var(--RED) 100%);
  border-radius: 2px;
}

/* Individual Entry */
.changelog-entry {
  position: relative;
  background: #0a0a0a;
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.changelog-entry:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Timeline dot */
.changelog-entry::before {
  content: '';
  position: absolute;
  left: -2.35rem;
  top: 1.5rem;
  width: 12px;
  height: 12px;
  background: var(--BLUE);
  border-radius: 50%;
  border: 2px solid #000;
  box-shadow: 0 0 10px var(--BLUE);
}

/* Entry Header (clickable) */
.entry-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--WHITE);
  font-family: 'Exo 2', sans-serif;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}

.entry-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.entry-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 120px;
}

.entry-date {
  font-size: 0.8rem;
  color: var(--TEXT, #aaa);
  font-weight: 500;
}

.entry-version {
  font-size: 0.75rem;
  color: var(--BLUE);
  background: rgba(74, 144, 226, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
  width: fit-content;
}

.entry-title {
  flex: 1;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--WHITE);
  margin: 0;
}

.entry-icon {
  font-size: 1.2rem;
  color: var(--BLUE);
  transition: transform 0.3s;
  margin-left: auto;
}

.changelog-entry.open .entry-icon {
  transform: rotate(45deg);
}

/* Entry Content (collapsible) */
.entry-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  padding: 0 1.5rem;
  background: #050505;
}

.entry-content.open {
  padding: 0 1.5rem 1.5rem;
}

.entry-content > p:first-child {
  padding-top: 0.5rem;
}

.entry-content h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--BLUE);
  margin: 1.25rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(141, 186, 197, 0.2);
  padding-bottom: 0.25rem;
}

.entry-content h3:first-of-type {
  margin-top: 0.75rem;
}

.entry-content ul {
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0 1rem;
}

.entry-content li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--TEXT);
}

.entry-content li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--BLUE);
  font-weight: bold;
}

.entry-content p {
  color: var(--TEXT);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.entry-content code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--WHITE);
}

/* Video embed */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  margin-top: 0.5rem;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Links */
.text-link,
.entry-content a {
  color: var(--BLUE);
  text-decoration: none;
  border-bottom: 1px solid rgba(141, 186, 197, 0.4);
  transition: color 0.2s, border-color 0.2s;
}

.text-link:hover,
.entry-content a:hover {
  color: var(--WHITE);
  border-bottom-color: var(--WHITE);
}

/* Footer */
.page-footer {
  text-align: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.page-footer p {
  color: var(--TEXT, #999);
  font-size: 0.9rem;
}

.page-footer a {
  color: var(--BLUE);
  text-decoration: none;
  border-bottom: 1px solid rgba(141, 186, 197, 0.4);
  transition: color 0.2s, border-color 0.2s;
}

.page-footer a:hover {
  color: var(--WHITE);
  border-bottom-color: var(--WHITE);
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 1.5rem 1rem 3rem;
  }

  .page-title {
    font-size: 2rem;
  }

  .changelog-timeline {
    padding-left: 1.5rem;
  }

  .changelog-entry::before {
    left: -1.85rem;
    width: 10px;
    height: 10px;
  }

  .entry-header {
    flex-wrap: wrap;
    padding: 1rem;
    gap: 0.75rem;
  }

  .entry-meta {
    min-width: 100px;
  }

  .entry-title {
    font-size: 1.1rem;
  }

  .entry-content {
    padding: 0 1rem;
  }

  .entry-content.open {
    padding: 0 1rem 1.25rem;
  }
}

@media (max-width: 400px) {
  .entry-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .entry-meta {
    flex-direction: row;
    gap: 0.75rem;
    align-items: center;
  }

  .entry-icon {
    position: absolute;
    right: 1rem;
    top: 1rem;
  }
}

/* Focus styles */
.entry-header:focus-visible {
  outline: 2px solid var(--BLUE);
  outline-offset: -2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fade-slide-in {
    transition: opacity 0.3s ease;
    transform: none;
  }
  
  .entry-content {
    transition: none;
  }
  
  .entry-icon {
    transition: none;
  }
}
