/* CSS für Mischkulturtabelle - vollständig */

/* ===== ALLGEMEINE STILE ===== */
h3 {
  margin-bottom: 10px;
}

/* ===== ANSICHTSWECHSLER ===== */
.view-selector-container {
  margin-bottom: 20px;
}

.view-selector {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.view-selector label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.view-selector input {
  margin-right: 5px;
}

.view-selector span {
  font-size: 14px;
}

/* ===== MATRIX-ANSICHT ===== */
.mischkultur-table-container {
  overflow-x: auto;
  max-width: 100%;
  margin-top: 15px;
}

.mischkultur-table {
  border-collapse: collapse;
  width: auto;
  font-size: 12px; /* Kleinere Schriftgröße */
  text-align: left;
}

.mischkultur-table th, .mischkultur-table td {
  border: 1px solid #ddd;
  text-align: center;
  padding: 2px; /* Reduzierter Abstand */
  min-width: 24px; /* Schmalere Zellen */
}

.mischkultur-table th {
  background-color: #f5f5f5;
}

/* Vertikale Rotation für Spaltenüberschriften */
.mischkultur-table th.rotated {
  height: 120px; /* Reduzierte Höhe */
  white-space: nowrap;
  vertical-align: bottom;
  text-align: left;
  position: relative;
  padding: 0;
}

.mischkultur-table th.rotated > div {
  transform: rotate(-90deg);
  width: 24px; /* Reduzierte Breite */
  transform-origin: center left;
  position: absolute;
  bottom: 0;
  left: 50%;
}

.mischkultur-table th.rotated > div > span {
  padding: 3px 6px; /* Reduzierter Abstand */
  display: block;
}

.mischkultur-table .first-col {
  background-color: #f5f5f5;
  font-weight: bold;
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  padding-left: 5px;
  padding-right: 5px;
}

/* Symbole */
.mischkultur-table .heart {
  color: green;
  font-size: 14px; /* Kleineres Symbol */
}

.mischkultur-table .cross {
  color: red;
  font-size: 16px; /* Kleineres Symbol */
}

/* Legende */
.mischkultur-legende {
  margin-bottom: 10px;
  font-size: 13px;
  text-align: left;
}

/* ===== LISTENANSICHT ===== */
.mischkultur-list-container {
  margin-top: 15px;
  overflow-x: auto;
}

.mischkultur-list {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px; /* Kleinere Schriftgröße */
  text-align: left;
}

.mischkultur-list th, .mischkultur-list td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.mischkultur-list th {
  background-color: #f5f5f5;
  text-align: left;
}

.mischkultur-list .plant-name {
  font-weight: bold;
}

.mischkultur-list .good-neighbors {
  color: green;
}

.mischkultur-list .bad-neighbors {
  color: red;
}

/* ===== SUCHFUNKTION ===== */
.mischkultur-search-container {
  margin-bottom: 30px;
}

.mischkultur-search-container h3 {
  margin-bottom: 15px;
  text-align: left;
  font-size: 16px;
}

.search-input-wrapper {
  margin-bottom: 15px;
  width: 100%;
  max-width: 500px;
}

.search-input-wrapper input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

/* Suchergebnisse - schlichteres Design */
.mischkultur-search-results {
  background-color: #f9f9f9;
  padding: 15px;
  max-width: 500px;
}

.result-hint {
  color: #666;
  font-style: italic;
}

.mischkultur-search-results h4 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  border-bottom: 2px solid #eee;
  padding-bottom: 5px;
}

.result-container {
  display: flex;
  width: 100%;
}

.good-neighbors-results, 
.bad-neighbors-results {
  width: 50%;
  padding: 0 5px;
}

.good-neighbors-results {
  background-color: #f0f9f0;
}

.bad-neighbors-results {
  background-color: #fff0f0;
}

.good-neighbors-results h5, 
.bad-neighbors-results h5 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: bold;
}

.good-neighbors-results h5 {
  color: #2a7d2a;
}

.bad-neighbors-results h5 {
  color: #c42727;
}

/* Anzeige der Nachbarn */
.neighbor-item {
  display: block;
  padding: 2px 0;
  font-size: 13px;
}

.good-neighbors-results .neighbor-item {
  color: #2a7d2a;
}

.bad-neighbors-results .neighbor-item {
  color: #c42727;
}

.no-results {
  font-style: italic;
  opacity: 0.7;
}

/* ===== INTERAKTIVE GRID-ANSICHT ===== */
.interactive-grid-container {
  display: flex;
  max-width: 100%;
  border: 1px solid #eee;
  margin-top: 15px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.grid-sidebar {
  width: 150px;
  flex-shrink: 0;
  background-color: #f5f5f5;
  border-right: 2px solid #e0e0e0;
  overflow-y: auto;
  max-height: 500px;
}

.grid-content {
  flex-grow: 1;
  overflow-x: auto;
  max-height: 500px;
}

.grid-content-inner {
  min-width: 100%;
  display: flex;
  flex-direction: column;
}

.grid-row {
  display: flex;
  transition: background-color 0.2s;
}

.grid-row.highlight {
  background-color: rgba(220, 240, 255, 0.5);
}

.grid-item {
  padding: 6px 8px;
  min-width: 30px;
  min-height: 30px;
  font-size: 12px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #eee;
  border-right: 1px solid #eee;
  transition: all 0.15s;
  position: relative;
}

.grid-item.plant-name {
  justify-content: flex-start;
  padding-left: 10px;
  font-weight: 500;
  position: relative;
  z-index: 1;
  text-align: left;
  cursor: pointer;
}

.grid-item.plant-name:hover {
  background-color: #e8f4ff;
}

.grid-item.plant-name.active {
  background-color: #2196F3;
  color: white;
}

.relation-good {
  background-color: rgba(220, 255, 220, 0.6);
}

.relation-bad {
  background-color: rgba(255, 220, 220, 0.6);
}

.relation-self {
  background-color: #f9f9f9;
}

.grid-item.highlight-cell {
  box-shadow: inset 0 0 0 2px rgba(33, 150, 243, 0.5);
  z-index: 2;
}

.relation-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.relation-indicator.good {
  background-color: #4CAF50;
}

.relation-indicator.bad {
  background-color: #F44336;
}

.grid-hint {
  margin-bottom: 10px;
  font-size: 13px;
  color: #666;
  font-style: italic;
}

/* Detail-Panel */
.grid-detail-panel {
  margin-top: 15px;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 4px;
  min-height: 100px;
}

.grid-detail-default {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 20px 0;
}

.detail-header {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 2px solid #eee;
}

.detail-content {
  display: flex;
  gap: 30px;
}

.detail-good, .detail-bad {
  flex: 1;
}

.detail-good h5, .detail-bad h5 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: bold;
}

.detail-good h5 {
  color: #4CAF50;
}

.detail-bad h5 {
  color: #F44336;
}

.detail-neighbor {
  display: block;
  padding: 3px 0;
  font-size: 13px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .interactive-grid-container {
    flex-direction: column;
  }
  
  .grid-sidebar {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 2px solid #e0e0e0;
  }
  
  .detail-content {
    flex-direction: column;
    gap: 15px;
  }
  
  .result-container {
    flex-direction: column;
  }
  
  .good-neighbors-results, 
  .bad-neighbors-results {
    width: 100%;
    margin-bottom: 10px;
  }
}