/* Soul Dashboard Styles */

:root {
  --primary: #0f0;
  --secondary: #0a0;
  --background: #000;
  --surface: #111;
  --text: #0f0;
  --text-dim: #090;
  --border: #030;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--background);
  color: var(--text);
  font-family: 'Berkeley Mono', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  border-bottom: 2px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 30px;
}

h1 {
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  text-shadow: 0 0 10px var(--primary);
}

nav {
  display: flex;
  gap: 20px;
  margin-top: 15px;
}

nav a {
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
  padding: 5px 10px;
  border: 1px solid var(--border);
  transition: all 0.3s;
}

nav a:hover, nav a.active {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 5px var(--primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  transition: all 0.3s;
}

.stat-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
  color: var(--primary);
  text-shadow: 0 0 5px var(--primary);
}

.stat-label {
  text-transform: uppercase;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 5px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

th, td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface);
  text-transform: uppercase;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: normal;
}

tr:hover {
  background: rgba(0, 255, 0, 0.05);
}

.soul-name {
  color: var(--primary);
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
}

.soul-name:hover {
  text-shadow: 0 0 5px var(--primary);
}

.soul-id {
  font-size: 11px;
  color: var(--text-dim);
  font-family: monospace;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 3px;
}

.badge.active {
  border-color: var(--primary);
  color: var(--primary);
  animation: pulse 2s infinite;
}

.badge.ended {
  border-color: var(--text-dim);
  color: var(--text-dim);
}

.badge.victory {
  border-color: gold;
  color: gold;
}

.badge.death {
  border-color: #f00;
  color: #f00;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  margin-top: 5px;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-20px); }
  100% { transform: translateX(20px); }
}

.section-title {
  font-size: 18px;
  text-transform: uppercase;
  margin: 30px 0 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

/* Soul Detail Styles */
.soul-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.soul-info h2 {
  font-size: 28px;
  margin-bottom: 5px;
}

.soul-subtitle {
  color: var(--text-dim);
  font-size: 14px;
}

.soul-stats {
  text-align: right;
}

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

.trait-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 15px;
}

.trait-card h4 {
  text-transform: uppercase;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.trait-value {
  color: var(--primary);
  font-size: 16px;
}

/* Real-time animations */
.pulse-animation {
  animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% {
    background-color: transparent;
  }
  50% {
    background-color: rgba(0, 255, 0, 0.1);
  }
}

turbo-frame {
  transition: opacity 0.3s ease;
}

turbo-frame[busy] {
  opacity: 0.7;
}

/* New row animation */
tbody tr {
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Stats update animation */
.stat-value {
  transition: all 0.3s ease;
}

.stat-card[data-updating] .stat-value {
  transform: scale(1.1);
  text-shadow: 0 0 15px var(--primary);
}

/* Incarnations Page */
.incarnations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.filters {
  display: flex;
  gap: 10px;
  align-items: center;
}

.filters form {
  display: flex;
  gap: 10px;
}

.filters select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
}

.filters select:hover {
  border-color: var(--primary);
  box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.filters select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Mini stats grid */
.stats-grid.mini {
  margin-bottom: 20px;
}

.stats-grid.mini .stat-card {
  padding: 15px;
}

.stats-grid.mini .stat-value {
  font-size: 24px;
}

/* Badge colors */
.badge.combat { 
  border-color: #f44; 
  color: #f44; 
}

.badge.collaboration { 
  border-color: #4af; 
  color: #4af; 
}

.badge.creation { 
  border-color: #f4f; 
  color: #f4f; 
}

.badge.diplomacy { 
  border-color: #ff4; 
  color: #ff4; 
}

.badge.exploration { 
  border-color: #4ff; 
  color: #4ff; 
}

.badge.caretaking { 
  border-color: #4f4; 
  color: #4f4; 
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 30px;
}

.pagination a,
.pagination span {
  padding: 5px 10px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: all 0.3s;
}

.pagination a:hover {
  border-color: var(--primary);
  background: var(--surface);
}

.pagination .current {
  background: var(--primary);
  color: var(--background);
  border-color: var(--primary);
}

/* Text utilities */
.text-dim {
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .soul-header {
    flex-direction: column;
  }
  
  .soul-stats {
    text-align: left;
    margin-top: 20px;
  }
  
  .incarnations-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .filters {
    flex-direction: column;
    width: 100%;
  }
  
  .filters form {
    flex-direction: column;
    width: 100%;
  }
  
  .filters select {
    width: 100%;
  }
}