/* =========================================================
   Adversary Compendium CSS
   Styling for adversary catalog, stat blocks, and forms
   ========================================================= */

/* =========================================================
   Catalog Card Styling
   ========================================================= */

.adversary-card {
  text-decoration: none;
  transition: all 0.2s ease;
  display: block;
}

.adversary-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(10, 20, 20, 0.92);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.adversary-card h3 {
  color: var(--text);
  font-size: 1.2rem;
  margin: 0;
  transition: color 0.2s ease;
}

.adversary-card:hover h3 {
  color: var(--accent);
}

/* =========================================================
   Stat Block Styling - Daggerheart Style
   ========================================================= */

.stat-block {
  background: rgb(245, 241, 232);
  margin: 20px 10px;
  padding: 10px 0px;
  border: 2px solid #D4A574; /* mustard color */
  border-radius: 10px;
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1a1a1a; /* off-black */
  line-height: 1.6;
}

.stat-block h3,
.stat-block p,
.stat-block h4 {
  padding: 0px 20px;
}

.stat-block ul {
  padding: 0px 20px 0px 50px;
}

.stat-block h3,
.stat-block h3.stat-block-name {
  margin-top: 20px;
  color: #1a1a1a;
  font-family: 'Eveleth Clean', system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: 0.05em;
}

/* Meta section (tier, description, motives) */
.stat-block .stat-block-meta {
  margin: 10px 0px 20px;
}

.stat-block .stat-block-meta p.stat-block-tier em {
  font-family: 'Merriweather', serif;
  font-style: italic;
}

.stat-block .stat-block-meta p {
  line-height: 1;
  margin: 10px 0px;
}

.stat-block .stat-block-meta p.stat-block-description {
  font-family: 'Merriweather', serif;
  font-style: italic;
  color: #4a4a4a;
}

.stat-block .stat-block-meta p.stat-block-motives {
  font-size: 0.95rem;
  font-weight: 600;
}

.stat-block .stat-block-meta p.stat-block-motives strong {
  font-size: 0.95rem;
  font-weight: 800;
}

/* Stats section (difficulty, thresholds, HP, etc.) */
.stat-block .stat-block-stats {
  background: rgb(250, 250, 250);
  border-top: 1px solid #D4A574;
  border-bottom: 1px solid #D4A574;
  padding: 0px 20px;
  margin: 0px 5px;
}

.stat-block .stat-block-stats .stat-block-experiences {
  border-top: 1px dotted;
}

.stat-block .stat-block-stats p {
  margin: 10px 0px;
}

.stat-block .stat-block-stats p.adversary-stat {
  font-size: 0.95rem;
  line-height: 1.8;
}

.stat-block .stat-block-stats strong {
  font-weight: 800;
  color: #1a1a1a;
}

/* Features section */
.stat-block .stat-block-features h4::before {
  display: none;
}

.stat-block .stat-block-features h4 {
  text-transform: uppercase;
  color: #1a1a1a;
  margin: 20px 0px 0px;
  font-family: 'Montserrat', system-serif;
  font-weight: 700;
  font-size: 1.1rem;
}

.stat-block .stat-block-features p {
  margin: 15px 0px;
  line-height: 1.6;
}

.stat-block .stat-block-features p.adversary-feature strong {
  font-weight: 600;
  color: #1a1a1a;
}

.stat-block .stat-block-features p.adversary-feature em {
  font-family: 'Merriweather', serif;
  font-style: italic;
}

/* Environment block variant (if needed) */
.stat-block.environment-block {
  background-color: rgb(236, 237, 237);
  border-color: rgb(140, 141, 144);
}

/* =========================================================
   Tier and Type Badges
   ========================================================= */

.tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(90, 150, 200, 0.2);
  border: 1px solid rgba(90, 150, 200, 0.4);
  color: rgba(90, 150, 200, 1);
  white-space: nowrap;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  white-space: nowrap;
}

/* Type-specific badge colors */
.type-badge.minion {
  background: rgba(180, 180, 180, 0.2);
  border: 1px solid rgba(180, 180, 180, 0.4);
  color: rgba(200, 200, 200, 1);
}

.type-badge.standard {
  background: rgba(90, 200, 170, 0.2);
  border: 1px solid rgba(90, 200, 170, 0.4);
  color: rgba(90, 200, 170, 1);
}

.type-badge.elite {
  background: rgba(220, 190, 90, 0.2);
  border: 1px solid rgba(220, 190, 90, 0.4);
  color: rgba(220, 190, 90, 1);
}

.type-badge.boss {
  background: rgba(220, 80, 80, 0.2);
  border: 1px solid rgba(220, 80, 80, 0.4);
  color: rgba(220, 80, 80, 1);
}

.type-badge.solo {
  background: rgba(160, 120, 220, 0.2);
  border: 1px solid rgba(160, 120, 220, 0.4);
  color: rgba(160, 120, 220, 1);
}

/* =========================================================
   Search and Filter Form Styling
   ========================================================= */

.adversary-search-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: var(--gap);
  align-items: end;
}

.adversary-search-form .form-group {
  display: flex;
  flex-direction: column;
}

.adversary-search-form label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
}

.adversary-search-form input[type="text"],
.adversary-search-form select {
  width: 100%;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.95rem;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.adversary-search-form input[type="text"]:focus,
.adversary-search-form select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.4);
}

.adversary-search-form input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.adversary-search-form select option {
  background: var(--panel);
  color: var(--text);
}

.adversary-search-form .button-group {
  display: flex;
  gap: 8px;
}

/* =========================================================
   Responsive Design for Mobile
   ========================================================= */

@media (max-width: 768px) {
  .adversary-search-form {
    grid-template-columns: 1fr;
  }

  .adversary-search-form .button-group {
    width: 100%;
  }

  .adversary-search-form .button-group .btn {
    flex: 1;
  }

  .adversary-stat-block h1.adversary-name,
  .adversary-stat-block h1.statblock-name {
    font-size: 1.5rem;
  }

  .adversary-stat-block h2 {
    font-size: 1.2rem;
  }

  .adversary-stat-block .stats {
    padding: 0.75rem;
  }

  .adversary-stat-block .stats div div {
    font-size: 0.85rem;
  }

  .actions-block > div,
  .features-block > div,
  .moves-block > div {
    padding: 0.5rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .adversary-card .cardBody {
    flex-direction: column !important;
  }

  .adversary-stat-block h1.adversary-name,
  .adversary-stat-block h1.statblock-name {
    font-size: 1.3rem;
  }

  .tier-badge,
  .type-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
}

/* =========================================================
   Form Styling (Create/Edit)
   ========================================================= */

.adversary-form .form-row {
  margin-bottom: 1.5rem;
}

.adversary-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.adversary-form input[type="text"],
.adversary-form input[type="number"],
.adversary-form textarea,
.adversary-form select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.95rem;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.adversary-form textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.adversary-form input:focus,
.adversary-form textarea:focus,
.adversary-form select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.4);
}

.adversary-form .helptext {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.adversary-form .errorlist {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}

.adversary-form .errorlist li {
  color: rgba(255, 100, 100, 1);
  font-size: 0.9rem;
  padding: 0.5rem;
  background: rgba(255, 100, 100, 0.1);
  border-left: 3px solid rgba(255, 100, 100, 0.8);
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.adversary-form .form-actions {
  display: flex;
  gap: 12px;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* =========================================================
   Empty State Styling
   ========================================================= */

.adversary-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.adversary-empty-state p {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 1.5rem 0;
}

/* =========================================================
   Print Styles for Stat Blocks
   ========================================================= */

@media print {
  .stat-block {
    background: white;
    color: black;
  }

  .adversary-stat-block h1,
  .adversary-stat-block h2,
  .adversary-stat-block h3 {
    color: black;
  }

  .adversary-stat-block .stats {
    background: #f5f5f5;
    border-color: #ccc;
  }

  .actions-block > div,
  .features-block > div,
  .moves-block > div {
    background: #f9f9f9;
    border-left-color: #666;
    page-break-inside: avoid;
  }

  .btn,
  .adversary-search-form,
  nav[aria-label="breadcrumb"] {
    display: none;
  }
}
