/**
 * Monstro.cc Lists Styles
 * Minimal styles for list management features
 */

/* Add to List Button on Monster Pages */
.monster-actions {
  margin: 1rem 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.add-to-list-btn,
.add-to-list-btn-source {
  padding: 0.5rem 1rem;
  background: #000;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
}

.add-to-list-btn:hover,
.add-to-list-btn-source:hover {
  background: #333;
}

.add-to-list-btn-source {
  background: #666;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
}

/* Lists Management Page */
.lists-page {
  max-width: 1400px;
  margin: 0 auto;
}

.lists-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #000;
}

.lists-header h1 {
  margin: 0;
  font-size: 2rem;
}

/* Section Styling */
.encounter-tables-section,
.user-lists-section {
  margin-bottom: 3rem;
}

.encounter-tables-section h2,
.user-lists-section h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.section-description {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  font-style: italic;
}

#new-list-btn {
  padding: 0.75rem 1.5rem;
  background: #000;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

#new-list-btn:hover {
  background: #333;
}

.lists-fullwidth {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

/* List Item - Full Width Styling */
.list-item {
  border: 2px solid #000;
  padding: 1rem 1.5rem;
  background: white;
  transition: background-color 0.2s;
}

.list-item-readonly {
  background: #fafafa;
}

.list-item:hover {
  background: #f5f5f5;
}

.list-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.list-item-title-group {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: 1.3rem;
  font-weight: bold;
  margin: 0 0 0.5rem 0;
}

.list-item-title a {
  color: #000;
  text-decoration: none;
}

.list-item-title a:hover {
  text-decoration: underline;
}

.list-item-description {
  margin: 0.5rem 0 0 0;
  color: #666;
  font-size: 0.95rem;
  line-height: 1.4;
}

.list-description {
  color: #666;
  font-size: 1rem;
  line-height: 1.5;
  margin: 1rem 0;
  font-style: italic;
}

.list-item-monsters-preview {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.4;
}

.list-item-monsters-preview a {
  color: #333;
  text-decoration: none;
}

.list-item-monsters-preview a:hover {
  text-decoration: underline;
}

.list-item-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

.list-item-meta {
  font-size: 0.9rem;
  color: #666;
  white-space: nowrap;
}

.list-item-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.action-btn {
  padding: 0.5rem 1rem;
  background: #f0f0f0;
  border: 1px solid #000;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  color: #000;
  white-space: nowrap;
}

.action-btn:hover {
  background: #e0e0e0;
}

.action-btn.danger:hover {
  background: #fdd;
  border-color: #c00;
  color: #c00;
}

.source-badge,
.table-badge {
  display: inline-block;
  margin-right: 1rem;
  font-size: 0.85rem;
  color: #666;
}

.source-badge a {
  color: #000;
  text-decoration: none;
  font-weight: 500;
}

.source-badge a:hover {
  text-decoration: underline;
}

.list-monsters {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-monsters li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

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

.list-monsters a {
  color: #000;
  text-decoration: none;
}

.list-monsters a:hover {
  text-decoration: underline;
}

.monster-source {
  color: #666;
  font-size: 0.85rem;
  font-style: italic;
  margin-left: 0.5rem;
}

.list-empty {
  color: #999;
  font-style: italic;
  padding: 1rem 0;
  text-align: center;
}

.list-meta {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
  font-size: 0.85rem;
  color: #666;
}

.source-info {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.source-info a {
  color: #000;
  text-decoration: none;
}

.source-info a:hover {
  text-decoration: underline;
}

.table-info {
  margin-top: 0.25rem;
  color: #777;
  font-size: 0.8rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .list-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .list-item-actions {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .list-item-buttons {
    width: 100%;
    flex-wrap: wrap;
  }

  .action-btn {
    flex: 1;
  }

  .lists-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  #new-list-btn {
    width: 100%;
  }

  .monster-actions {
    flex-direction: column;
  }

  .add-to-list-btn,
  .add-to-list-btn-source {
    width: 100%;
    text-align: center;
  }
}

/* Dice Type Selector */
.dice-type-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.dice-type-selector label {
  font-weight: 500;
}

.dice-type-selector select {
  padding: 0.5rem;
  border: 2px solid #000;
  background: white;
  font-size: 1rem;
  cursor: pointer;
}

.dice-type-selector select:hover {
  background: #f5f5f5;
}

/* Drag and Drop */
.encounter-table-data tbody {
  position: relative;
}

.encounter-table-data tr.draggable {
  cursor: move;
  user-select: none;
}

.encounter-table-data tr.dragging {
  opacity: 0.5;
  background: #f0f0f0;
}

.encounter-table-data tr.drag-over {
  border-top: 3px solid #000;
}

.drag-handle {
  cursor: move;
  padding: 0.25rem 0.5rem;
  color: #999;
  user-select: none;
}

.drag-handle:hover {
  color: #000;
}

.reorder-mode-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.reorder-mode-controls button {
  padding: 0.5rem 1rem;
  border: 2px solid #000;
  background: white;
  cursor: pointer;
  font-size: 0.95rem;
}

.reorder-mode-controls button:hover {
  background: #f0f0f0;
}

.reorder-mode-controls button.primary {
  background: #000;
  color: white;
}

.reorder-mode-controls button.primary:hover {
  background: #333;
}

/* Print Styles */
@media print {
  .add-to-list-btn,
  .add-to-list-btn-source,
  .list-item-buttons,
  #new-list-btn,
  .dice-type-selector,
  .reorder-mode-controls,
  .drag-handle {
    display: none;
  }

  .list-item {
    page-break-inside: avoid;
    border: 1px solid #000;
  }
}
