/* Character Database - Cyberpunk Neon Noir Style */

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

:root {
  --primary: #00d4ff;
  --accent: #ff006e;
  --secondary: #ffa500;
  --background: #0a0e27;
  --card-bg: #1a1f3a;
  --border: #00d4ff;
  --text: #e0e0e0;
  --text-muted: #a0a0a0;
  --glow: 0 0 20px rgba(0, 212, 255, 0.5);
  --glow-accent: 0 0 20px rgba(255, 0, 110, 0.5);
}

html, body {
  font-family: 'Courier New', monospace;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
}

/* Scanlines effect */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Header */
header {
  background: linear-gradient(135deg, rgba(26, 31, 58, 0.95), rgba(10, 14, 39, 0.95));
  border-bottom: 2px solid var(--primary);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--glow);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary);
  text-shadow: var(--glow);
  letter-spacing: 2px;
}

.header-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  margin-top: 0.5rem;
}

nav {
  display: flex;
  gap: 1rem;
}

nav button {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

nav button:hover {
  background: var(--primary);
  color: var(--background);
  box-shadow: var(--glow);
}

nav button.active {
  background: var(--primary);
  color: var(--background);
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Search Bar */
.search-container {
  margin: 2rem 0;
  position: relative;
}

.search-input {
  width: 100%;
  max-width: 700px;
  padding: 1rem 1.5rem;
  background: var(--card-bg);
  border: 2px solid var(--primary);
  color: var(--text);
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  border-radius: 0;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  box-shadow: var(--glow);
  background: rgba(0, 212, 255, 0.05);
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* Character Grid */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.character-icon {
  position: relative;
  cursor: pointer;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid var(--primary);
  background: var(--card-bg);
  transition: all 0.3s ease;
}

.character-icon:hover {
  box-shadow: var(--glow);
  transform: scale(1.05);
  border-color: var(--accent);
}

.character-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.character-icon-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  padding: 0.5rem;
  font-size: 0.75rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.character-icon:hover .character-icon-name {
  opacity: 1;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  overflow-y: auto;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--card-bg);
  border: 2px solid var(--primary);
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--glow);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--primary);
  border: none;
  color: var(--background);
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-close:hover {
  background: var(--accent);
}

.modal-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
  border-bottom: 2px solid var(--primary);
}

.modal-image {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--primary);
}

.modal-image img {
  width: 100%;
  height: auto;
  display: block;
}

.modal-image::before,
.modal-image::after {
  content: '';
  position: absolute;
  background: var(--accent);
}

.modal-image::before {
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-top: 3px solid var(--accent);
  border-right: 3px solid var(--accent);
}

.modal-image::after {
  bottom: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border-bottom: 3px solid var(--accent);
  border-left: 3px solid var(--accent);
}

.modal-info h2 {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  text-shadow: var(--glow);
}

.modal-info .role {
  display: inline-block;
  background: var(--primary);
  color: var(--background);
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  margin-bottom: 0.0rem;
  letter-spacing: 1px;
}

.modal-info .organization {
  background: var(--card-bg);
  border-left: 4px solid var(--primary);
  padding: 0.45rem 0.6rem;
  margin: 0 0 0.15rem 0;
  line-height: 1.2;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-info .organization:hover {
  background: rgba(0, 212, 255, 0.1);
  border-left-color: var(--accent);
}

.modal-info .org-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.modal-info .org-name {
  font-size: 1.2rem;
  color: var(--primary);
  margin-top: 0.3rem;
}

.modal-body {
  padding: 2rem;
}

.section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.2rem;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  letter-spacing: 1px;
}

.description {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.info-item {
  background: rgba(0, 212, 255, 0.05);
  border-left: 3px solid var(--primary);
  padding: 0.8rem;
}

.info-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.info-value {
  font-size: 1rem;
  color: var(--primary);
  margin-top: 0.3rem;
}

.ability-list,
.weapon-list {
  list-style: none;
}

.ability-item,
.weapon-item {
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid var(--primary);
  padding: 1rem;
  margin-bottom: 0.8rem;
  border-radius: 2px;
}

.ability-name,
.weapon-name {
  color: var(--primary);
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.ability-description,
.weapon-description {
  color: var(--text);
  font-size: 0.9rem;
}

/* Related Characters */
.related-characters {
  background: rgba(255, 0, 110, 0.05);
  border: 1px solid var(--accent);
  padding: 1rem;
  margin-top: 1rem;
}

.related-title {
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.related-icon {
  aspect-ratio: 1;
  border: 2px solid var(--accent);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
}

.related-icon:hover {
  box-shadow: var(--glow-accent);
  transform: scale(1.05);
}

.related-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Organization Page */
.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.org-card {
  background: var(--card-bg);
  border: 2px solid var(--primary);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.org-card:hover {
  box-shadow: var(--glow);
  transform: translateY(-5px);
  border-color: var(--accent);
}

.org-logo {
  width: 100%;
  height: 150px;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 1px solid var(--primary);
}

.org-name {
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  text-shadow: var(--glow);
}

.org-description {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

/* Organization Detail */
.org-detail-header {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--primary);
}

.org-detail-logo {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.org-detail-info h2 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 1rem;
  text-shadow: var(--glow);
}

.org-detail-description {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.members-list {
  list-style: none;
  margin-top: 1rem;
}

.member-item {
  background: rgba(0, 212, 255, 0.05);
  border-left: 3px solid var(--primary);
  padding: 1rem;
  margin-bottom: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.member-item:hover {
  background: rgba(0, 212, 255, 0.1);
  border-left-color: var(--accent);
}

.member-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.member-name {
  font-size: 1.1rem;
  color: var(--primary);
  margin-top: 0.3rem;
}

/* Buttons */
button {
  font-family: 'Courier New', monospace;
}

.btn {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  display: inline-block;
  margin: 0.5rem 0.5rem 0.5rem 0;
}

.btn:hover {
  background: var(--primary);
  color: var(--background);
  box-shadow: var(--glow);
}

.btn-back {
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  .header-container {
    flex-direction: column;
    gap: 1rem;
  }

  nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .character-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
  }

  .modal-header {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

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

  .org-detail-header {
    grid-template-columns: 1fr;
  }

  .org-detail-logo {
    width: 100%;
    height: auto;
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.character-quote {
  margin-top: 0.3rem;
  margin-bottom: 0.3rem;
  padding: 0.45rem 0.8rem;
  border-left: 3px solid var(--accent);
  background: rgba(255, 0, 110, 0.08);
  color: var(--accent);
  font-style: italic;
  letter-spacing: 1px;
  line-height: 1.6;
  text-shadow: 0 0 8px rgba(255, 0, 110, 0.4);
  position: relative;
}

.character-quote::before {
  content: "";
  opacity: 0.8;
}

.character-name {
  font-size: 1.8rem;
  color: var(--primary);
  text-shadow: var(--glow);
  line-height: 1.1;
}

.character-name .name-en {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  margin-top: 0.2rem;
  text-transform: uppercase;
  opacity: 0.85;
  border-left: 2px solid var(--accent);
  padding-left: 0.5rem;
}

.weapon-description,
.ability-description,
.description {
  white-space: pre-line;
}

header {
  padding: 1rem 0;
  border-bottom: 1px solid var(--accent);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

header.collapsed .header-title {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.35s ease,
    opacity 0.25s ease,
    transform 0.25s ease;
  margin: 0;
  padding: 0;
}

.header-title {
  transition: all 0.25s ease;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-toggle {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.9rem;
}

.modal-content {
  max-width: 800px;
}

.modal-content.org-modal {
  max-width: 1000px;
}

.organizations {
  margin-top: 0.15rem;
}

.organization {
  background: var(--card-bg);
  border-left: 4px solid var(--primary);
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.15rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.organization:hover {
  background: rgba(0, 212, 255, 0.1);
  border-left-color: var(--accent);
}

.org-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.org-tags {
  margin-top: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.org-tag {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(255, 0, 110, 0.1);
  box-shadow: 0 0 6px rgba(255, 0, 110, 0.4);
}
