/* SusFarm - Styles */

.susfarm-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--color-green);
  margin: 1rem 0;
  font-family: monospace;
  font-size: 0.9rem;
}

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

.susfarm-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.tab-btn {
  background: rgba(0, 0, 0, 0.8);
  color: var(--color-green);
  border: 1px solid var(--color-green);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: monospace;
  font-size: 0.9rem;
}

.tab-btn:hover {
  background: rgba(0, 255, 0, 0.1);
}

.tab-btn.active {
  background: var(--color-green);
  color: var(--color-bg);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Plots */
.plots-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.plot-card {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--color-green);
  padding: 1rem;
  font-family: monospace;
  font-size: 0.9rem;
}

.plot-card.ready {
  border-color: var(--color-pink);
  animation: pulse 2s infinite;
}

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

.plot-header {
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.plot-info {
  margin: 0.5rem 0;
  line-height: 1.6;
}

.plot-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.btn-small {
  background: rgba(0, 0, 0, 0.8);
  color: var(--color-green);
  border: 1px solid var(--color-green);
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-family: monospace;
  font-size: 0.8rem;
}

.btn-small:hover {
  background: rgba(0, 255, 0, 0.1);
}

.btn-small:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(0, 255, 0, 0.3);
}

.btn-harvest {
  background: var(--color-green);
  color: var(--color-bg);
  font-weight: bold;
}

.crop-select {
  background: rgba(0, 0, 0, 0.8);
  color: var(--color-green);
  border: 1px solid var(--color-green);
  padding: 0.25rem 0.5rem;
  font-family: monospace;
  font-size: 0.8rem;
  flex: 1;
  min-width: 150px;
}

/* Upgrades */
.upgrade-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.upgrade-card {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--color-green);
  padding: 1rem;
  font-family: monospace;
  font-size: 0.9rem;
}

.upgrade-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.upgrade-info {
  margin: 0.5rem 0;
  line-height: 1.6;
}

/* Rites */
.rites-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.rite-card {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--color-green);
  padding: 1rem;
  font-family: monospace;
  font-size: 0.9rem;
}

.rite-header {
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.rite-info {
  margin: 0.5rem 0;
  line-height: 1.6;
}

/* Log */
.log-container {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--color-green);
  padding: 1rem;
  font-family: monospace;
  font-size: 0.85rem;
  max-height: 400px;
  overflow-y: auto;
  margin: 1rem 0;
}

.log-entry {
  margin: 0.25rem 0;
  padding: 0.25rem;
  border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

.log-entry:last-child {
  border-bottom: none;
}

/* Dev Tools */
.dev-tools {
  background: rgba(255, 0, 0, 0.2);
  border: 1px solid var(--color-red);
  padding: 1rem;
  margin: 1rem 0;
  font-family: monospace;
}

.dev-tools button {
  margin: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-red);
  color: white;
  border: none;
  cursor: pointer;
  font-family: monospace;
}

.dev-tools button:hover {
  background: #cc0000;
}

/* Field Panel */
.susfarm-field-panel {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid var(--color-green);
  padding: 1rem;
  margin: 1rem 0;
  font-family: monospace;
  font-size: 0.9rem;
}

.field-header {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 255, 0, 0.3);
}

.field-header-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
  min-height: 120px;
}

.field-cell {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--color-green);
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  font-family: monospace;
  font-size: 1.1rem;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 60px;
}

.field-cell:hover {
  background: rgba(0, 255, 0, 0.1);
  border-color: var(--color-pink);
}

.field-cell.ready {
  border-color: var(--color-pink);
  animation: pulse 2s infinite;
}

.field-cell.occupied {
  border-width: 2px;
}

.field-plot-id {
  font-size: 0.7rem;
  opacity: 0.7;
}

.field-plot-visual {
  font-size: 1.5rem;
  line-height: 1.2;
}

.field-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 255, 0, 0.3);
  font-size: 0.8rem;
  opacity: 0.8;
}

.field-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Plot Inspector */
.plot-inspector {
  position: fixed;
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid var(--color-green);
  padding: 1rem;
  min-width: 280px;
  max-width: 320px;
  font-family: monospace;
  font-size: 0.9rem;
  z-index: 1000;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 255, 0, 0.3);
}

.inspector-close {
  background: transparent;
  border: none;
  color: var(--color-green);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.inspector-close:hover {
  color: var(--color-pink);
}

.inspector-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.inspector-info {
  line-height: 1.8;
}

.inspector-info div {
  margin: 0.25rem 0;
}

.inspector-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.inspector-actions .btn,
.inspector-actions .btn-small {
  width: 100%;
}

.inspector-actions .crop-select {
  width: 100%;
  margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 600px) {
  .plots-container,
  .upgrade-container,
  .rites-container {
    grid-template-columns: 1fr;
  }
  
  .susfarm-hud {
    font-size: 0.8rem;
  }
  
  .hud-item {
    flex: 1 1 50%;
  }
  
  .field-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .plot-inspector {
    right: 0.5rem;
    left: 0.5rem;
    max-width: none;
    transform: translateY(-50%);
  }
}

/* Market Goods */
.market-goods-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.market-good-card {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--color-green);
  padding: 1rem;
  font-family: monospace;
  font-size: 0.9rem;
}

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

.rare-badge {
  background: var(--color-pink);
  color: var(--color-bg);
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: bold;
}

.good-info {
  margin: 0.5rem 0;
  line-height: 1.6;
}

.good-info div {
  margin: 0.25rem 0;
}

.good-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 255, 0, 0.2);
}

.good-empty {
  color: rgba(0, 255, 0, 0.6);
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 0.5rem;
  width: 100%;
}

.market-log {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 255, 0, 0.3);
}

.market-log h4 {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

