/**
 * Character Arc Tracker Styles
 * Marvel Details - Feature 1c
 */

/* Character Grid Container */
.characters-section {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.characters-section h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.characters-section p {
  color: #666;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* Filter and Sort Controls */
.character-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: center;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.control-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}

.control-group select,
.control-group input {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background: white;
  color: #333;
}

.control-group select:hover,
.control-group input:hover {
  border-color: #999;
}

.control-group select:focus,
.control-group input:focus {
  outline: none;
  border-color: #e0303c;
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
}

.control-group input {
  min-width: 200px;
}

#character-result-count {
  font-size: 0.95rem;
  color: #666;
  margin-left: auto;
}

/* Character Grid */
#characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  #characters-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  #characters-grid {
    grid-template-columns: 1fr;
  }
}

/* Character Card */
.character-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.character-card:hover {
  border-color: #e0303c;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.character-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.character-info h3 {
  font-size: 1.4rem;
  margin: 0 0 0.25rem 0;
  color: #1a1a1a;
}

.character-actor {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

/* Favorite Button */
.character-favorite-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #ddd;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.character-favorite-btn:hover {
  color: #e0303c;
  transform: scale(1.15);
}

.character-favorite-btn.favorited {
  color: #e0303c;
}

/* Character Role Badge */
.character-role {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-hero {
  background: rgba(76, 175, 80, 0.15);
  color: #2e7d32;
}

.role-villain {
  background: rgba(244, 67, 54, 0.15);
  color: #c62828;
}

.role-anti-hero {
  background: rgba(156, 39, 176, 0.15);
  color: #6a1b9a;
}

.role-supporting {
  background: rgba(33, 150, 243, 0.15);
  color: #1565c0;
}

/* Character Thesis */
.character-thesis {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;
  margin: 0.75rem 0 1rem 0;
  font-style: italic;
}

/* Character Stats */
.character-stats {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.stat-item {
  font-size: 0.9rem;
  color: #666;
}

.stat-item strong {
  color: #1a1a1a;
  font-size: 1.1rem;
}

/* No Results */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
}

.no-results p {
  margin: 0.5rem 0;
}

.no-results-hint {
  font-size: 0.9rem;
}

/* Modal */
.character-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow-y: auto;
  padding: 1rem;
}

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

.character-modal-content {
  background: white;
  border-radius: 8px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  border-bottom: 2px solid #f5f5f5;
}

.modal-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.8rem;
}

.modal-full-name {
  margin: 0;
  color: #666;
  font-size: 1rem;
}

.character-modal-close {
  background: none;
  border: none;
  font-size: 2.5rem;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.character-modal-close:hover {
  color: #333;
}

/* Modal Body */
.modal-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  padding: 2rem;
}

@media (max-width: 768px) {
  .modal-body {
    grid-template-columns: 1fr;
  }
}

.modal-main {
  min-width: 0;
}

.modal-sidebar {
  border-left: 2px solid #f5f5f5;
  padding-left: 1.5rem;
}

@media (max-width: 768px) {
  .modal-sidebar {
    border-left: none;
    border-top: 2px solid #f5f5f5;
    padding-left: 0;
    padding-top: 1.5rem;
  }
}

/* Modal Sections */
.modal-section {
  margin-bottom: 2rem;
}

.modal-section h3 {
  font-size: 1.2rem;
  margin: 0 0 1rem 0;
  color: #1a1a1a;
}

.modal-section p {
  margin: 0;
  color: #555;
  line-height: 1.6;
}

/* Arc Stages */
.arc-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.arc-stage {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #f5f5f5;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #333;
  border-left: 3px solid #e0303c;
}

/* Stats Grid */
.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.modal-stat {
  background: #f9f9f9;
  padding: 1rem;
  border-radius: 6px;
  text-align: center;
  border: 1px solid #eee;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: bold;
  color: #e0303c;
}

/* Fact List */
.modal-fact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.modal-fact-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 0.95rem;
  color: #555;
}

.modal-fact-list li:last-child {
  border-bottom: none;
}

.modal-fact-list strong {
  color: #1a1a1a;
}

/* Similar Arcs */
.similar-arcs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.similar-arc-item {
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 6px;
  border-left: 3px solid #ddd;
  cursor: pointer;
  transition: all 0.2s;
}

.similar-arc-item:hover {
  background: #f5f5f5;
  border-left-color: #e0303c;
}

.similar-name {
  margin: 0 0 0.5rem 0;
  font-weight: 600;
  color: #1a1a1a;
  font-size: 1rem;
}

.similar-match {
  margin: 0.5rem 0;
  font-size: 0.85rem;
  color: #666;
}

.similarity-bar {
  display: inline-block;
  width: 60px;
  height: 6px;
  background: #eee;
  border-radius: 3px;
  margin-right: 0.5rem;
  overflow: hidden;
  vertical-align: middle;
}

.similarity-fill {
  display: block;
  height: 100%;
  background: #e0303c;
  border-radius: 3px;
}

.similar-thesis {
  margin: 0.5rem 0 0 0;
  font-size: 0.85rem;
  color: #999;
  font-style: italic;
}

/* Phase Color Classes */
.phase-1 { border-color: #FFD700; }
.phase-2 { border-color: #C0C0C0; }
.phase-3 { border-color: #CD7F32; }
.phase-4 { border-color: #808080; }
.phase-5 { border-color: #9370DB; }
.phase-6 { border-color: #DC143C; }

.phase-gold { color: #FFD700; }
.phase-silver { color: #C0C0C0; }
.phase-bronze { color: #CD7F32; }
.phase-gray { color: #808080; }
.phase-purple { color: #9370DB; }
.phase-red { color: #DC143C; }

/* Error Message */
.error-message {
  grid-column: 1 / -1;
  padding: 2rem;
  background: #ffebee;
  border-left: 4px solid #c62828;
  border-radius: 4px;
  color: #c62828;
}

.error-message p {
  margin: 0;
}

/* Loading State */
.loading {
  color: #999;
  font-size: 0.95rem;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .character-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .control-group input {
    min-width: 100%;
  }

  #character-result-count {
    margin-left: 0;
    margin-top: 0.5rem;
  }

  .modal-header {
    padding: 1.5rem;
  }

  .modal-body {
    padding: 1.5rem;
  }

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