/* ===== Changelog Page Styles ===== */

.changelog-wrapper {
  padding: 2rem 0 4rem;
  max-width: 950px;
  margin: 0 auto;
}

.changelog-header {
  margin-bottom: 2rem;
  text-align: center;
}

.changelog-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.changelog-header .subtitle {
  color: #94a3b8;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Filters ===== */
.changelog-filters {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}

.filter-group {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  background: #111827;
  padding: 0.4rem 0.75rem;
  border-radius: 12px;
  border: 1px solid #1f2937;
}

.filter-label {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 500;
  margin-right: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-btn {
  padding: 0.35rem 0.85rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-btn:hover {
  background: #334155;
  border-color: #475569;
  color: #ffffff;
}

.filter-btn.active {
  background: #00d4ff;
  border-color: #00d4ff;
  color: #0a1929;
  font-weight: 600;
}

.filter-reset {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.filter-reset:hover {
  background: #00d4ff;
  border-color: #00d4ff;
  color: #0a1929;
  transform: rotate(90deg);
}

/* Active Filters Display */
.active-filters {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.5rem 1rem;
  background: #1e293b;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #cbd5e1;
  margin-top: 0.75rem;
}

.active-filter-tag {
  padding: 0.2rem 0.6rem;
  background: #00d4ff;
  color: #0a1929;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.8rem;
}

.clear-active-filters {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.clear-active-filters:hover {
  background: #7f1d1d;
}

/* ===== Changelog Items (Accordion) ===== */
.changelog-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.changelog-item {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.25s ease;
}

.changelog-item:hover {
  border-color: #00d4ff;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.15);
}

.changelog-item.filtered {
  display: none !important;
}

/* Toggle Button */
.changelog-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.4;
}

.changelog-toggle:hover {
  background: #1f2937;
}

.version-badge {
  padding: 0.3rem 0.8rem;
  background: #334155;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #94a3b8;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.version-badge.highlight {
  background: linear-gradient(135deg, #00d4ff, #7b2cbf);
  color: #0a1929;
  font-weight: 800;
}

.version-date {
  color: #64748b;
  font-size: 0.825rem;
  white-space: nowrap;
  font-weight: 500;
}

.version-title {
  flex: 1;
  font-weight: 500;
  color: #e2e8f0;
  min-width: 0;
}

/* Category Badges */
.category-badges {
  display: flex;
  gap: 0.35rem;
  margin-left: 0.25rem;
  flex-shrink: 0;
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 0.8rem;
  background: #1e293b;
  border: 1px solid #334155;
  cursor: default;
  transition: all 0.2s ease;
  user-select: none;
}

.cat-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cat-testmecode { 
  background: linear-gradient(135deg, #065f46, #047857); 
  border-color: #10b981;
}
.cat-site { 
  background: linear-gradient(135deg, #7c2d12, #9a3412); 
  border-color: #f97316;
}
.cat-forum { 
  background: linear-gradient(135deg, #4c1d95, #6d28d9); 
  border-color: #a78bfa;
}

.icon-chevron {
  color: #64748b;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.changelog-toggle[aria-expanded="true"] .icon-chevron {
  transform: rotate(180deg);
  color: #00d4ff;
}

/* Content Area */
.changelog-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out;
  background: #0b1220;
  border-top: 1px solid #1f2937;
}

.changelog-content.expanded {
  max-height: 3000px;
  transition: max-height 0.5s ease-in;
}

.changelog-content .content-placeholder {
  padding: 1.25rem 1.5rem;
  color: #cbd5e1;
  line-height: 1.65;
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  /*  padding: 1.5rem;  aws */
  color: #94a3b8;
  justify-content: center;
  font-size: 0.75rem;
}

.spinner {
  width: 10px; /* 20 */
  height: 10px;
  border: 2px solid #334155;
  border-top-color: #00d4ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== Loaded Content Styles ===== */
.changelog-content h3 {
  color: #ffffff;
  font-size: 1.15rem;
  margin: 1.25rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #1f2937;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.changelog-content h3:first-child {
  margin-top: 0;
}

.changelog-content h4 {
  color: #e2e8f0;
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
  font-weight: 600;
}

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

.changelog-content li {
  padding: 0.45rem 0;
  padding-left: 1.6rem;
  position: relative;
  color: #cbd5e1;
  font-size: 0.95rem;
}

.changelog-content li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #00d4ff;
  font-weight: bold;
  font-size: 1.2rem;
  line-height: 1;
  top: 0.35rem;
}

.changelog-content .tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 5px;
  font-size: 0.725rem;
  font-weight: 600;
  margin-right: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tag.feature { background: #065f46; color: #6ee7b7; }
.tag.fix { background: #7f1d1d; color: #fca5a5; }
.tag.improvement { background: #7c2d12; color: #fdba74; }

.changelog-content .cat-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
  background: #334155;
  color: #94a3b8;
}

.changelog-content .category-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed #1f2937;
}

.changelog-content .category-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.changelog-content .changelog-note {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: #1e293b;
  border-left: 3px solid #00d4ff;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.changelog-content code {
  background: #1e293b;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.9em;
  color: #fca5a5;
}

.changelog-content kbd {
  background: #334155;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.85em;
  border: 1px solid #475569;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2);
}

/* Pagination */
.changelog-pagination {
  text-align: center;
  margin-top: 2.5rem;
}

.btn-secondary {
  padding: 0.7rem 1.75rem;
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: 10px;
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover:not(:disabled) {
  background: #00d4ff;
  border-color: #00d4ff;
  color: #0a1929;
  transform: translateY(-2px);
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .changelog-wrapper {
    padding: 1.5rem 0 3rem;
  }
  
  .changelog-header h1 {
    font-size: 1.85rem;
  }
  
  .changelog-header .subtitle {
    font-size: 1rem;
  }
  
  .changelog-filters {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .filter-group {
    width: 100%;
    justify-content: center;
    padding: 0.5rem;
  }
  
  .changelog-toggle {
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.9rem 1rem;
  }
  
  .version-date {
    order: 3;
    width: 100%;
    margin-top: 0.2rem;
    margin-left: 4.2rem;
  }
  
  .category-badges {
    order: 2;
    margin-left: auto;
  }
  
  .version-title {
    order: 1;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .changelog-toggle {
    font-size: 0.9rem;
  }
  
  .version-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
  }
  
  .cat-badge {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }
}

/* ===== Accessibility ===== */
.changelog-toggle:focus,
.filter-btn:focus,
.filter-reset:focus,
.btn-secondary:focus {
  outline: 2px solid #00d4ff;
  outline-offset: 2px;
}

.changelog-toggle:focus-visible,
.filter-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.4);
}

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