.archive-header {
  text-align: center;
  color: var(--green);
  font-weight: bold;
  margin: 1rem 0;
}

/* Archive-specific styles */
.filter-section {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.filter-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  color: var(--green);
  font-weight: bold;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select {
  padding: 0.75rem;
  background: var(--sec-color);
  color: var(--white);
  border: 2px solid var(--sec-color-2);
  border-radius: var(--border-radius);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.filter-select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(86, 222, 147, 0.2);
}

.filter-select optgroup {
  font-weight: bold;
  color: var(--green);
}

.filter-select option {
  padding: 0.5rem;
  background: var(--sec-color);
  color: var(--white);
}

/* Active Filters */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 2rem;
}

.filter-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bg-color);
  cursor: pointer;
  transition: var(--transition);
}

.filter-bubble:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.filter-bubble .remove-filter {
  background: rgba(0, 0, 0, 0.2);
  border: none;
  color: inherit;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
}

/* Filter bubble colors */
.filter-bubble.project {
  background: #ff6b6b;
}
.filter-bubble.background {
  background: #4ecdc4;
}
.filter-bubble.filter {
  background: #45b7d1;
}
.filter-bubble.history {
  background: #96ceb4;
}
.filter-bubble.character {
  background: var(--green);
}
.filter-bubble.species {
  background: #feca57;
}
.filter-bubble.gender {
  background: #ff9ff3;
}
.filter-bubble.bodyType {
  background: #54a0ff;
}
.filter-bubble.furColor {
  background: #5f27cd;
}

/* Character Profile Section */
.character-profile-section {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.character-profile-card {
  background: var(--sec-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.character-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.character-header img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.character-info h2 {
  color: var(--green);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.character-info p {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.character-details {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
}

.character-traits h3,
.character-background h3 {
  color: var(--green);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.character-traits div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.trait-tag {
  background: var(--green);
  color: var(--bg-color);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Gallery Section - Hidden by default */
.gallery-section {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: none; /* Hidden until search is performed */
}

.gallery-section.visible {
  display: block;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
  margin-left: auto;
  margin-right: auto;
}

/* Cap width *only when few items are shown* or on smaller viewports */
@media (min-width: 1024px) {
  .gallery-grid {
    max-width: 1200px; /* enough for 3 full columns + gap */
  }
}

.gallery-item {
  background: var(--sec-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.gallery-item-image {
  width: 100%;
  height: 250px;
  position: relative;
  overflow: hidden;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item-image img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  transition: var(--transition);
  position: absolute;
  top: 0;
  left: 0;
}

.gallery-item {
  aspect-ratio: 1 / 1; /* Forces square shape */
  width: 100%; /* or fixed width */
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gallery-item-image {
  flex-grow: 1;
  width: 100%;
  overflow: hidden;
}

.gallery-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.gallery-item:hover .gallery-item-image img {
  transform: scale(1.05);
}

.image-placeholder {
  width: 100%;
  height: 100%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--bg-color);
  font-weight: bold;
  position: absolute;
  top: 0;
  left: 0;
}

.gallery-item-info {
  padding: 1rem;
}

.gallery-item-title {
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.gallery-item-filter {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  margin-left:10px;
  gap:20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.filter-safe, .filter-species, .filter-svg {
  background: #4ecdc4;
  color: var(--bg-color);
}

.filter-hidden {
  background: #feca57;
  color: var(--bg-color);
}

.filter-violent {
  background: #ff6b6b;
  color: var(--white);
}

.filter-explicit {
  background: rgb(222, 86, 86);
  color: var(--white);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.page-btn {
  padding: 0.75rem 1rem;
  background: var(--sec-color);
  color: var(--white);
  border: 2px solid var(--sec-color-2);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}

.page-btn:hover:not(:disabled) {
  background: var(--green);
  color: var(--bg-color);
  border-color: var(--green);
}

.page-btn.active {
  background: var(--green);
  color: var(--bg-color);
  border-color: var(--green);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal Scrollbar */
.modal-content::-webkit-scrollbar {
  width: 10px;
}
.modal-content::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: 10px;
}
.modal-content {
  scrollbar-width: thin;
  scrollbar-color: var(--green) var(--sec-color);
}

/* Image Modal */
.image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 600px;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.blurred-thumbnail {
  filter: blur(8px);
  transition: filter 0.3s ease;
  pointer-events: none;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  margin: 5vh auto;
  border-radius: var(--border-radius);
  overflow-y: scroll;
  overflow-x: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.gallery-thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  display: block;
  border-radius: 25px;
  max-height: 100%;
}

.modal-close {
  position: flex;
  margin-bottom: 20px;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.7);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--green);
  color: var(--bg-color);
}

.modal-image-container {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-color);
  border-radius: 25px;
  max-height: 90vh;
  overflow: hidden;
}

.modal-image-container img {
  max-width: 100%;
  max-height: 600px;
  width: auto;
  height: auto;
  border-radius: 25px;
  object-fit: contain;
  display: block;
}

.modal-image-container svg {
  max-width: 100%;
  max-height: 600px;
  width: auto;
  height: auto;
  display: block;
}

.modal-info {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 300px;
  overflow-y: auto;
}

.modal-info h3 {
  color: var(--green);
  font-size: 1.5rem;
  margin: 0;
}

.modal-meta p {
  color: var(--white);
  margin: 0.5rem 0;
}

.modal-mirrors {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.mirror-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-color);
  color: var(--white);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.mirror-link:hover {
  background: var(--green);
  color: var(--bg-color);
}

.mirror-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.view-tags-btn {
  padding: 0.75rem 1.5rem;
  background: var(--green);
  color: var(--bg-color);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.view-tags-btn:hover {
  background: var(--white);
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  background: var(--sec-color-2);
  color: var(--white);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.9rem;
}

/* Search Section */
.search-section {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 0 1rem;
  text-align: center;
}

.search-btn {
  padding: 1rem 2rem;
  background: var(--green);
  color: var(--bg-color);
  border: none;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-width: 150px;
}

.search-btn:hover {
  background: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(86, 222, 147, 0.3);
}

.search-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Progress Bar */
.progress-container {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.progress-bar {
  width: 100%;
  max-width: 300px;
  height: 8px;
  background: var(--sec-color-2);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #4ecdc4);
  border-radius: 20px;
  width: 0%;
  transition: width 0.1s ease;
  box-shadow: 0 2px 4px rgba(86, 222, 147, 0.4);
}

.progress-text {
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Error Display */
.error-display {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 1rem;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: var(--border-radius);
  color: #ffb3b3;
  text-align: center;
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
  .character-header {
    flex-direction: column;
    text-align: center;
  }

  .character-details {
    grid-template-columns: 1fr;
  }

  .modal-content {
    flex-direction: column;
    max-height: 95vh;
  }

  .modal-info {
    min-width: auto;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-item-info {
    display: none;
  }

  .search-btn {
    width: 100%;
    max-width: 250px;
  }

  .progress-bar {
    max-width: 250px;
  }
}

.gallery-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: rgba(0,0,0,0.6);
}


/* Added styles for interactive SVG layers */
.interactive-svg-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.interactive-layer {
  transition: filter 0.3s ease, transform 0.3s ease;
}

.interactive-layer:hover {
  filter: brightness(1.2) !important;
}

.interactive-layer.animating {
  pointer-events: none;
}

/* Animation keyframes for layer interactions */
@keyframes layerDisappear {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  50% {
    transform: translateY(-30px);
    opacity: 0.7;
  }
  100% {
    transform: translateY(-70px);
    opacity: 0;
  }
}
