/* FMM Grid Layout Styles */
.fmm-grid-wrapper {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Filter Bar */
.fmm-grid-filters {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 20px;
  background: #ecf0f1;
  border-radius: 8px;
  flex-wrap: wrap;
}

.fmm-grid-filters .fmm-filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 150px;
}

.fmm-grid-filters .fmm-filter-group label {
  font-weight: 600;
  font-size: 14px;
  color: #2c3e50;
}

.fmm-grid-filters .fmm-filter-select {
  padding: 8px 12px;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
  background: white;
  font-size: 14px;
  cursor: pointer;
}

.fmm-grid-filters .fmm-filter-select:focus {
  outline: none;
  border-color: #2c3e50;
  box-shadow: 0 0 0 2px rgba(52, 73, 94, 0.1);
}

/* Main Grid Container */
.fmm-grid-container {
  display: grid;
  grid-template-columns: 250px 1fr 1fr 1fr;
  gap: 1px;
  background: #bdc3c7;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Grid Cells */
.fmm-grid-cell {
  background: white;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
}

/* Header Row */
.fmm-grid-header {
  display: contents;
}

.fmm-grid-header .fmm-grid-cell {
  background: #34495e;
  color: white;
  font-weight: 600;
  text-align: center;
}

.fmm-grid-header .fmm-grid-program-header {
  background: #2c3e50;
  text-align: left;
  font-size: 16px;
}

.fmm-grid-header .fmm-grid-pillar-header {
  padding: 12px;
}

.fmm-grid-header .fmm-grid-pillar-header[data-pillar="nature"] {
  background: #27ae60;
}

.fmm-grid-header .fmm-grid-pillar-header[data-pillar="people"] {
  background: #3498db;
}

.fmm-grid-header .fmm-grid-pillar-header[data-pillar="climate"] {
  background: #e74c3c;
}

.fmm-pillar-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.fmm-pillar-indicators {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fmm-indicator-header {
  font-size: 11px;
  opacity: 0.9;
  font-weight: 500;
  padding: 2px 0;
}

/* Program Rows */
.fmm-grid-row {
  display: contents;
}

.fmm-grid-row:hover .fmm-grid-cell {
  background: rgba(44, 62, 80, 0.02);
}

.fmm-grid-row .fmm-grid-program-cell {
  background: #f8f9fa;
  text-align: left;
  border-right: 2px solid #bdc3c7;
}

.fmm-program-name {
  font-weight: 600;
  font-size: 14px;
  color: #2c3e50;
  margin-bottom: 8px;
  line-height: 1.3;
}

.fmm-program-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.fmm-grid-pillar-scores {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.fmm-grid-pillar-scores[data-pillar="nature"] {
  border-left: 4px solid #27ae60;
}

.fmm-grid-pillar-scores[data-pillar="people"] {
  border-left: 4px solid #3498db;
}

.fmm-grid-pillar-scores[data-pillar="climate"] {
  border-left: 4px solid #e74c3c;
}

/* Score Items */
.fmm-score-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: rgba(236, 240, 241, 0.3);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.fmm-score-item:hover {
  background: rgba(44, 62, 80, 0.1);
  transform: translateX(2px);
}

.fmm-score-value {
  font-weight: 700;
  font-size: 16px;
  color: #2c3e50;
}

.fmm-score-label {
  font-size: 11px;
  color: #1a252f;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tag Styles */
.fmm-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid;
  background: white;
}

.fmm-tag.tag-coc {
  color: #3498db;
  border-color: #3498db;
  background: rgba(52, 152, 219, 0.1);
}

.fmm-tag.tag-sc {
  color: #e74c3c;
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

.fmm-tag.tag-org {
  color: #27ae60;
  border-color: #27ae60;
  background: rgba(39, 174, 96, 0.1);
}

.fmm-tag.tag-mat {
  color: #9b59b6;
  border-color: #9b59b6;
  background: rgba(155, 89, 182, 0.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .fmm-grid-container {
    grid-template-columns: 200px 1fr 1fr 1fr;
  }
  
  .fmm-grid-cell {
    padding: 12px;
    min-height: 70px;
  }
  
  .fmm-pillar-title {
    font-size: 16px;
  }
  
  .fmm-indicator-header {
    font-size: 10px;
  }
}

@media (max-width: 768px) {
  .fmm-grid-filters {
    flex-direction: column;
    gap: 15px;
  }
  
  .fmm-grid-filters .fmm-filter-group {
    min-width: 100%;
  }
  
  .fmm-grid-container {
    grid-template-columns: 1fr;
    gap: 8px;
    background: transparent;
  }
  
  .fmm-grid-header {
    display: none;
  }
  
  .fmm-grid-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .fmm-grid-row .fmm-grid-cell {
    border-radius: 0;
  }
  
  .fmm-grid-row .fmm-grid-pillar-scores {
    border-left: none;
    border-top: 4px solid;
  }
  
  .fmm-grid-row .fmm-grid-pillar-scores[data-pillar="nature"] {
    border-top-color: #27ae60;
  }
  
  .fmm-grid-row .fmm-grid-pillar-scores[data-pillar="people"] {
    border-top-color: #3498db;
  }
  
  .fmm-grid-row .fmm-grid-pillar-scores[data-pillar="climate"] {
    border-top-color: #e74c3c;
  }
  
  .fmm-grid-row .fmm-grid-pillar-scores::before {
    content: attr(data-pillar);
    font-weight: 700;
    text-transform: capitalize;
    margin-bottom: 8px;
    display: block;
    color: #2c3e50;
  }
}
