/* ==========================================================
   patchnotes.css — Page Patch Notes (self-contained)
   BloodStreet RP
   ========================================================== */

@import url('../base/tokens.css');
@import url('../base/reset.css');
@import url('../base/animations.css');
@import url('../layout/header.css');
@import url('../layout/footer.css');
@import url('../components/buttons.css');

/* ==========================================================
   PATCHNOTES HERO
   ========================================================== */

.patchnotes__hero {
  background: linear-gradient(135deg, var(--color-red-deeper) 0%, #0a0a0a 60%);
  padding: calc(var(--header-height) + var(--space-16)) 0 var(--space-12);
  text-align: center;
}

.patchnotes__hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: var(--fw-black);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.patchnotes__hero-title i {
  color: var(--color-red);
}

.patchnotes__hero-sub {
  font-size: var(--fs-md);
  color: rgba(255,255,255,0.6);
}

/* ==========================================================
   MOBILE SELECT (version picker)
   ========================================================== */

.patchnotes__mobile-select {
  padding: var(--space-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.patchnotes__mobile-label {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.patchnotes__select {
  width: 100%;
  background: var(--bg-card);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-base);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%239A9A9A' d='M10 12l-5-5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 16px;
  padding-right: var(--space-8);
}

.patchnotes__select:focus {
  border-color: var(--color-red);
}

/* ==========================================================
   LAYOUT (sidebar + main)
   ========================================================== */

.patchnotes__layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding-top: var(--space-8);
  padding-bottom: var(--space-16);
}

/* ==========================================================
   SIDEBAR
   ========================================================== */

.patchnotes__sidebar {
  display: none; /* masqué sur mobile, visible desktop */
  flex-direction: column;
  gap: var(--space-4);
  background: var(--bg-secondary);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  height: fit-content;
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
}

.patchnotes__sidebar-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: var(--border-subtle);
}

.patchnotes__sidebar-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6);
}

.patchnotes__sidebar-loading p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ---- Spinner ---- */
.patchnotes__spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--color-red);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

.patchnotes__spinner--large {
  width: 48px;
  height: 48px;
  border-width: 3px;
}

/* ---- Versions list ---- */
.patchnotes__versions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.patchnotes__versions-list[hidden] {
  display: none !important;
}

.patchnotes__version-item {
  display: block;
}

.patchnotes__version-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.patchnotes__version-btn:hover {
  background: rgba(255,255,255,0.05);
}

.patchnotes__version-btn--active {
  background: rgba(177, 0, 0, 0.15);
  color: var(--color-red);
}

.patchnotes__version-tag {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.patchnotes__version-btn--active .patchnotes__version-tag {
  color: var(--color-red);
}

.patchnotes__version-date {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  flex: 1;
}

.patchnotes__version-badge {
  display: inline-block;
  background: rgba(177, 0, 0, 0.2);
  color: var(--color-red);
  border: 1px solid rgba(177, 0, 0, 0.35);
  border-radius: var(--radius-full);
  padding: 1px var(--space-2);
  font-size: 10px;
  font-weight: var(--fw-bold);
  flex-shrink: 0;
}

/* ==========================================================
   MAIN CONTENT
   ========================================================== */

.patchnotes__main {
  flex: 1;
  min-height: 400px;
}

/* ---- Loading state ---- */
.patchnotes__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  min-height: 300px;
  background: var(--bg-card);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-12);
}

.patchnotes__loading[hidden] {
  display: none !important;
}

.patchnotes__loading p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ---- Display (content rendered by JS) ---- */
.patchnotes__display {
  background: var(--bg-card);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}

.patchnotes__display[hidden] {
  display: none !important;
}

/* Typography for rendered patch notes */
.patchnotes__display h1,
.patchnotes__display h2,
.patchnotes__display h3 {
  color: var(--text-white);
  margin-bottom: var(--space-3);
  margin-top: var(--space-6);
}

.patchnotes__display h1 { font-size: var(--fs-2xl); }
.patchnotes__display h2 { font-size: var(--fs-xl); border-bottom: 1px solid rgba(177,0,0,0.3); padding-bottom: var(--space-2); }
.patchnotes__display h3 { font-size: var(--fs-lg); color: var(--color-red); }

.patchnotes__display p {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.7;
  margin-bottom: var(--space-3);
}

.patchnotes__display ul,
.patchnotes__display ol {
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.patchnotes__display li {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.6;
  position: relative;
}

.patchnotes__display ul li::before {
  content: '•';
  position: absolute;
  left: -1rem;
  color: var(--color-red);
}

/* ---- Rendered patchnote structure ---- */
.patchnote__header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid rgba(177, 0, 0, 0.3);
  margin-bottom: var(--space-5);
}

.patchnote__version-label {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-black);
  color: var(--text-white);
}

.patchnote__header .patchnote__date {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.patchnote__author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
}

.patchnote__author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.patchnote__author-avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: var(--fs-md);
}

.patchnote__author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.patchnote__author-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.patchnote__author-role {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}

.patchnote__sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.patchnote__section {
  margin-bottom: var(--space-2);
}

/* ---- Empty state ---- */
.patchnotes__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  text-align: center;
  min-height: 300px;
  background: var(--bg-card);
  border: 2px dashed rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-12);
}

.patchnotes__empty[hidden] {
  display: none !important;
}

.patchnotes__empty-icon {
  font-size: 3.5rem;
  color: var(--text-muted);
}

.patchnotes__empty-title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-white);
}

.patchnotes__empty-text {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  max-width: 400px;
  line-height: 1.6;
}

/* ---- Mobile version select: hide sidebar ---- */
@media (max-width: 63.99em) {
  .patchnotes__mobile-select {
    display: flex;
  }
}

/* ---- Desktop: show sidebar, hide mobile select ---- */
@media (min-width: 64em) {
  .patchnotes__mobile-select {
    display: none;
  }

  .patchnotes__layout {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-8);
  }

  .patchnotes__sidebar {
    display: flex;
    width: 260px;
    flex-shrink: 0;
  }
}
