body {
  font-family: Arial, sans-serif;
  padding: 10px;
  margin: 0 auto;
  background-color: #1a1a1a;
  color: #e0e0e0;
}
.container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
button {
  padding: 8px 12px;
  background-color: #2c5a2e;
  color: #e0e0e0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
button:hover {
  background-color: #367238;
}
.file-input {
  display: none;
}
table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 20px;
  overflow-x: auto;
}
th,
td {
  border: 1px solid #404040;
  padding: 4px 6px;
  text-align: left;
}
th {
  background-color: #2d2d2d;
  position: sticky;
  top: 0;
}
tr:nth-child(even) {
  background-color: #252525;
}
.editable:hover {
  background-color: #2a3744;
}
.editable:focus {
  background-color: #1c2834;
  outline: none;
}
.tabs {
  display: flex;
  margin-bottom: 10px;
}

/* Mobile tabs dropdown styling */
.mobile-tabs-container {
  display: none;
  margin-bottom: 15px;
}

.mobile-tabs-select {
  width: 100%;
  padding: 10px;
  background-color: #2d2d2d;
  color: #e0e0e0;
  border: 1px solid #404040;
  border-radius: 4px;
  font-size: 1rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.tab {
  padding: 8px 16px;
  background-color: #2d2d2d;
  border: 1px solid #404040;
  border-bottom: none;
  cursor: pointer;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  margin-right: 4px;
}
.tab.active {
  background-color: #1a1a1a;
  border-bottom: 1px solid #1a1a1a;
  margin-bottom: -1px;
  z-index: 1;
}
.tab-content {
  display: none;
  border: 1px solid #404040;
  padding: 15px;
  overflow-x: auto;
  position: relative;
}
.tab-content.active {
  display: block;
}
.results-container {
  overflow-x: auto;
  margin-bottom: 20px;
}
.highlight {
  background-color: #3d3c2f !important;
}
.column-header {
  cursor: default;
  user-select: none;
  position: relative;
}

.column-header span {
  cursor: pointer;
}

.column-header span:hover {
  opacity: 0.7;
}
#message {
  padding: 10px;
  margin-bottom: 10px;
  display: none;
}
#data-table img {
  width: 32px;
  vertical-align: middle;
  image-rendering: pixelated;
}



.damage-controls {
  margin-bottom: 10px;
}

#view-perspective {
  font-size: 0.9em;
  color: #aaa;
  font-style: italic;
}

.damage-controls label {
  margin-right: 15px;
  cursor: pointer;
}

.damage-controls input[type="checkbox"] {
  margin-right: 5px;
}

.column-hidden {
  display: none;
}

.analysis-section {
  margin-bottom: 20px;
  padding: 15px;
  background: #2d2d2d;
  border-radius: 5px;
  border: 1px solid #404040;
}

#monster-select {
  width: 200px;
  padding: 8px;
  margin-bottom: 15px;
  background-color: #1a1a1a;
  color: #e0e0e0;
  border: 1px solid #404040;
  border-radius: 4px;
}

#monster-select option {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.analysis-item {
  background: #252525;
  padding: 15px;
  border-radius: 5px;
  border: 1px solid #404040;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.analysis-item h4 {
  margin-top: 0;
  color: #e0e0e0;
  border-bottom: 2px solid #404040;
  padding-bottom: 5px;
  margin-bottom: 10px;
}

.analysis-item p {
  margin: 5px 0;
  color: #b0b0b0;
}

.monster-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.monster-select-option img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.analysis-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.analysis-header img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

#moves-table select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: inherit;
  font-size: inherit;
}

#moves-table select:focus {
  outline: none;
}

#moves-table select option {
  padding: 4px;
}

#moves-table td {
  transition: background-color 0.3s, color 0.3s;
}

#data-table select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: inherit;
  font-size: inherit;
}

#data-table select:focus {
  outline: none;
}

#data-table select option {
  padding: 4px;
}

#data-table td {
  transition: background-color 0.3s, color 0.3s;
}

.main-btn {
  background-color: #365d72;
}

.main-btn:hover {
  background-color: #40738c;
}
#save-indicator,
#moves-save-indicator {
  transition: all 0.3s ease;
  font-size: 16px;
  vertical-align: middle;
  user-select: none;
}

/* Specific column widths */
#moves-table th:nth-child(1),
#moves-table td:nth-child(1) { /* Name column */
  min-width: 150px;
}

#moves-table th:nth-child(2),
#moves-table td:nth-child(2) { /* Mon column */
  min-width: 150px;
}

#moves-table th:nth-child(3),
#moves-table td:nth-child(3) { /* Power column */
  min-width: 50px;
}

#moves-table th:nth-child(4),
#moves-table td:nth-child(4) { /* Stamina column */
  min-width: 50px;
}

#moves-table th:nth-child(5),
#moves-table td:nth-child(5) { /* Accuracy column */
  min-width: 50px;
}

#moves-table th:nth-child(6),
#moves-table td:nth-child(6) { /* Priority column */
  min-width: 50px;
}

#moves-table th:nth-child(7),
#moves-table td:nth-child(7) { /* Type column */
  min-width: 120px;
}

#moves-table th:nth-child(8),
#moves-table td:nth-child(8) { /* Class column */
  min-width: 100px;
}

#moves-table th:nth-child(9),
#moves-table td:nth-child(9) { /* Description column */
  min-width: 300px;
}

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #1a1a1a;
  padding: 10px 0;
  margin-bottom: 10px;
  border-bottom: 1px solid #404040;
}

#add-move-btn {
  margin-bottom: 1rem;
}

.table-container {
  overflow-y: visible;
  max-height: none;
}

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

.keyboard-hint {
  color: #888;
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

#mon-container-name {
  font-size: 1.25rem;
  font-weight: bold;
  margin-top: 1rem;
}

.mon-name-element {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.stats-grid {
  max-width: 20rem;
  font-size: 1rem;
  margin-top: 1rem;
}

.hp-bar {
  background-color: #458b45;
}

.attack-bar {
  background-color: #8b4545;
}

.special-attack-bar {
  background-color: #6e458b;
}

.defense-bar {
  background-color: #45728b;
}

.special-defense-bar {
  background-color: #577b5c;
}

.speed-bar {
  background-color: #8b8245;
}

.stat-value {
  text-align: right;
  font-family: monospace;
}

.stat-bar-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.stat-bar-background {
  flex: 1;
  height: 0.4rem;
  background-color: #303633;
  border-radius: 0.2rem;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 0.2rem;
  transition: width 0.3s ease;
}

.stat-label {
  font-weight: bold;
}

.mon-sprite {
  image-rendering: pixelated;
  width: 192px;
}

/* Moves section styling */
.mon-moves-section {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  border-top: 1px solid #404040;
  padding-top: 1rem;
}

.moves-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.move-card {
  background-color: #2a2a2a;
  border-radius: 8px;
  padding: 0.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  border: 1px solid #3a3a3a;
}

.move-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #3a3a3a;
}

.mon-move-header {
  font-size: 1.5rem;
}

.move-name {
  font-weight: bold;
  font-size: 1.1rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.move-type {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.move-details {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.move-stat {
  background-color: #333;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.move-description {
  font-size: 0.9rem;
  color: #ccc;
  margin-top: 0.5rem;
  line-height: 1.4;
  border-top: 1px solid #3a3a3a;
  padding-top: 0.5rem;
  flex-grow: 1;
  overflow-wrap: break-word;
}

.stat-icon {
  margin-right: 0.25rem;
  font-size: 0.9rem;
}

.mon-abilities-section {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  border-top: 1px solid #404040;
  padding-top: 1rem;
}

.mon-container-columns {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

/* Media queries for responsive design */
@media (max-width: 767px) {
  /* Hide desktop tabs and show mobile dropdown on small screens */
  .desktop-tabs {
    display: none;
  }

  .mobile-tabs-container {
    display: block;
  }
}

/* On desktop, use two columns and show tabs */
@media (min-width: 768px) {
  .mon-container-columns {
    flex-direction: row;
  }

  .mon-column {
    flex: 1;
  }

  #mon-container-stats {
    max-width: 50%;
  }

  /* Remove border above abilities on desktop */
  #mon-container-abilities-moves .mon-abilities-section {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
  }

  /* Hide mobile dropdown on desktop */
  .mobile-tabs-container {
    display: none;
  }
}

.ability-card {
  background-color: #2a2a2a;
  border-radius: 8px;
  padding: 0.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  border: 1px solid #3a3a3a;
}

.ability-name {
  font-weight: bold;
  font-size: 1.1rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.ability-effect {
  font-size: 0.9rem;
  color: #ccc;
  margin-top: 0.5rem;
  line-height: 1.4;
  border-top: 1px solid #3a3a3a;
  padding-top: 0.5rem;
  flex-grow: 1;
  overflow-wrap: break-word;
}

/* Move damage table styling */
.move-damage-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.move-damage-table th,
.move-damage-table td {
  padding: 6px;
  text-align: left;
  border: 1px solid #404040;
}

.move-damage-table th {
  background-color: #2d2d2d;
  font-weight: bold;
}

.move-damage-table tr:nth-child(even) {
  background-color: #252525;
}

.move-damage-table tr:hover {
  background-color: #333333;
}

.move-damage-section {
  margin-top: 20px;
  grid-column: span 3;
}

.calculation-formula {
  display: block;
  font-family: monospace;
  white-space: nowrap;
  color: #b0b0b0;
  padding: 4px;
  background-color: #222;
  border-radius: 4px;
  margin-bottom: 6px;
}

.calculation-steps {
  display: block;
  font-family: monospace;
  color: #8a8a8a;
  font-size: 0.9em;
  padding-left: 8px;
  border-left: 2px solid #444;
  line-height: 1.4;
}

/* Max damage table styling */
.damage-badge-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.damage-type-badge {
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.damage-type-multiplier {
  font-size: 0.85em;
  font-weight: bold;
  margin-left: 2px;
}

.multiplier-super {
  color: #4CAF50; /* Green for super effective */
}

.multiplier-not-effective {
  color: #F44336; /* Red for not very effective */
}

.move-class-indicator {
  font-size: 0.9em;
}

.move-name-display {
  font-weight: bold;
  font-size: 1.05em;
  color: #ffffff;
}

/* High damage cell styling */
.high-damage-cell {
  background-color: rgba(27, 116, 172, 0.5) !important;
}

/* High damage row styling for Move Damage Analysis */
.high-damage-row {
  background-color: rgba(27, 116, 172, 0.3) !important;
}

.high-damage-row:hover {
  background-color: rgba(27, 116, 172, 0.4) !important;
}

/* Sortable header styling */
th.sortable {
  cursor: pointer;
}

th.sortable:hover {
  background-color: #3d3d3d;
}

.sort-indicator {
  display: inline-block;
  margin-left: 4px;
}

