/* Sub Character Page Specific Styles (Dark Mode) */

.sub-char-container {
  width: 1000px;
  margin: 20px auto;
  padding: 30px;
  background: #2c3e50;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  color: #ecf0f1;
}

.control-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: #34495e;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  align-items: center;
  justify-content: center;
}

.control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.control-group label {
  font-weight: bold;
  margin-bottom: 8px;
  color: #ecf0f1;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Custom Select Styling */
.custom-select-wrapper {
  position: relative;
  width: 200px;
}

select {
  /* width: 100%; */
  padding: 10px 15px;
  font-size: 16px;
  border: 1px solid #555;
  border-radius: 6px;
  background-color: #2c3e50;
  color: #ecf0f1;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%233498db%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
  background-repeat: no-repeat;
  background-position: right 10px top 50%;
  background-size: 12px auto;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}

select:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
  outline: none;
}

/* Results Area */
.results-area {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.result-section {
  background: #34495e;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.result-section h2 {
  margin-top: 0;
  border-bottom: 2px solid #555;
  padding-bottom: 10px;
  margin-bottom: 15px;
  color: #ecf0f1;
  font-size: 1.2em;
}

.card-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.char-card {
  background: #2c3e50;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 10px;
  width: 140px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.char-card:hover {
  transform: translateY(-3px);
}

.char-card img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
  border: 2px solid #ecf0f1;
}

.char-card .name {
  font-weight: bold;
  font-size: 0.9em;
  margin-bottom: 4px;
  color: #ecf0f1 !important;
}

.char-card .stat {
  font-size: 0.8em;
  color: #bdc3c7 !important;
}

.char-card .stat-value {
  font-weight: bold;
  color: #ecf0f1 !important;
}

.empty-state {
  text-align: center;
  color: #95a5a6;
  padding: 40px;
  font-style: italic;
}

/* Responsive Design */
@media (max-width: 840px) {
  .sub-char-container {
    max-width: 90%;
    padding: 15px;
    margin: 10px auto;
    border-radius: 8px;
  }

  .control-panel {
    padding: 15px;
    gap: 15px;
  }

  select {
    font-size: 14px;
    padding: 8px 12px;
  }

  .result-section {
    padding: 15px;
  }

  .card-list {
    gap: 8px; /* Reduce gap for mobile to fit 3 columns */
  }

  .char-card {
    width: calc(
      33.333% - 6px
    ); /* 3 columns with small gap consideration (approx) */
    min-width: 80px; /* Lower min-width to ensure it doesn't break to 2 columns on very small screens */
    padding: 5px;
  }

  .char-card img {
    width: 40px;
    height: 40px;
  }

  .char-card .name {
    font-size: 0.75em;
  }

  .char-card .stat {
    font-size: 0.7em;
  }

  .char-card .stat-value {
    font-size: 0.8em;
  }
}

#selected-char-display {
  display: none;
  justify-content: center;
  align-items: center;
  margin-left: 20px;
  /* margin-top: 20px; Removed to fit in same line */
  /* width: 100%; Removed to fit in same line */
}

#selected-char-display.active {
  display: flex;
}

.selected-card {
  cursor: default;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
}

.modal-content {
  position: relative;
  background: #2c3e50;
  border: 2px solid #555;
  border-radius: 12px;
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 1001;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid #555;
  background: #34495e;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  margin: 0;
  color: #ecf0f1;
  font-size: 1.3em;
}

.modal-close {
  background: transparent;
  border: none;
  color: #ecf0f1;
  font-size: 2em;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #e74c3c;
}

.modal-body {
  padding: 20px;
}

@media (max-width: 840px) {
  .modal-content {
    max-width: 95%;
    max-height: 85vh;
  }

  .modal-header {
    padding: 15px;
  }

  .modal-body {
    padding: 15px;
  }
}
