/**
 * Bull Finder - Light Theme Card Styles
 * Matching Angus Product Category Design
 */

/* Results Grid - Force grid layout */
.bf-results-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  gap: 20px !important;
  margin-bottom: 40px;
  width: 100%;
}

.bf-results-grid > .bf-bull-card {
  width: auto !important;
  max-width: 100% !important;
  float: none !important;
  display: block !important;
}

/* Bull Card - Light Design */
.bf-bull-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.bf-bull-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.bf-bull-card.selected {
  border: 2px solid #164170;
  box-shadow: 0 4px 12px rgba(22, 65, 112, 0.2);
}

.bf-bull-card.top-match {
  border: 2px solid #2ecc71;
}

/* Top Badge - Gold for #1 */
.bf-top-badge {
  position: absolute;
  top: 30px;
  left: -15px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #333;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.85em;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Selection Checkbox - Clean Style */
.bf-card-select {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(255,255,255,0.7);
  padding: 0px 3px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  border: 1px solid #e0e0e0;
}

.bf-card-select input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #164170;
}

.bf-card-select label {
  margin: 0;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 600;
  color: #164170;
}

/* Product Header - Like Angus */
.bf-card-header {
  background: #164170;
  color: white;
  padding: 15px;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bf-card-title {
  margin: 0;
  font-size: 1.3em;
  font-weight: 600;
  color: white;
  line-height: 1.3;
}

/* Match Score Badge - Compact */
.bf-match-score-badge {
  position: absolute;
  top: 65px;
  right: 175px;
  background: white;
  border: 2px solid #2ecc71;
  border-radius: 50%;
  width: 70px;
  height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  z-index: 15;
}

.bf-score-number {
  font-size: 1.5em;
  font-weight: bold;
  line-height: 1;
  color: #2ecc71;
}

.bf-score-label {
  font-size: 0.65em;
  color: #666;
  margin-top: 2px;
  text-transform: uppercase;
}

/* Card Image - Standard */
.bf-card-image {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: #f8f9fa;
}

.bf-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.bf-bull-card:hover .bf-card-image img {
  transform: scale(1.05);
}

/* Image Overlay - Subtle */
.bf-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.6) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 15px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bf-bull-card:hover .bf-image-overlay {
  opacity: 1;
}

.bf-view-btn {
  background: white;
  color: #164170;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9em;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.bf-view-btn:hover {
  background: #164170;
  color: white;
  transform: translateY(-2px);
}

/* Match Level Badge */
.bf-match-level {
  text-align: center;
  font-weight: 600;
  font-size: 0.95em;
  padding: 8px 15px;
  margin: 15px;
  background: #f0f8ff;
  border-radius: 6px;
  border-left: 4px solid currentColor;
}

/* Match Reasons - Clean List */
.bf-match-reasons {
  padding: 0 15px 15px;
  background: #f8f9fa;
  margin: 0 15px 15px;
  border-radius: 6px;
}

.bf-match-reasons h4 {
  margin: 0 0 10px;
  padding: 10px 0 5px;
  font-size: 0.95em;
  color: #164170;
  border-bottom: 2px solid #164170;
}

.bf-match-reasons ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bf-match-reasons li {
  padding: 6px 0;
  font-size: 0.9em;
  color: #444;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.bf-check-icon {
  color: #2ecc71;
  font-weight: bold;
  font-size: 1.1em;
  flex-shrink: 0;
}

/* Key Traits - Horizontal Bars */
.bf-key-traits {
  padding: 15px;
  background: white;
}

.bf-trait-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bf-trait-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85em;
}

.bf-trait-label {
  min-width: 100px;
  font-weight: 600;
  color: #fff;
  font-size: 0.9em;
}

.bf-trait-bar-container {
  flex: 1;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.bf-trait-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
  background: #164170;
}

.bf-trait-value {
  min-width: 75px;
  text-align: right;
  font-weight: 600;
  color: #164170;
}

/* Card Actions */
.bf-card-actions {
  display: flex;
  gap: 10px;
  padding: 15px;
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
}

.bf-card-actions .bf-btn {
  flex: 1;
  padding: 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9em;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.bf-btn-primary {
  background: #164170;
  color: white;
}

.bf-btn-primary:hover {
  background: #0d2b4a;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(22, 65, 112, 0.3);
}

.bf-btn-secondary {
  background: white;
  color: #164170;
  border: 1px solid #164170;
}

.bf-btn-secondary:hover {
  background: #164170;
  color: white;
}

/* Price Display */
.bf-card-price {
  background: #d9eaf9;
  color: #164170;
  text-align: center;
  padding: 12px;
  font-weight: bold;
  font-size: 1.2em;
  margin: 0 15px 15px;
  border-radius: 6px;
}

/* Responsive Grid Adjustments */
@media (min-width: 1800px) {
  .bf-results-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

@media (max-width: 1799px) {
  .bf-results-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 1359px) {
  .bf-results-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .bf-results-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .bf-card-header {
    min-height: auto;
    padding: 12px;
  }

  .bf-card-title {
    font-size: 1.1em;
  }
}

/* Milk Volume Visual - Special Layout */
.bf-milk-visual {
  background: #164170;
  padding: 12px;
  border-radius: 6px;
}

.bf-visual-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.bf-milk-visual .bf-trait-label {
  color: white;
  font-weight: 600;
  font-size: 1em;
  min-width: auto;
}

.bf-milk-visual .bf-trait-value {
  color: white;
  font-weight: 700;
  font-size: 1.1em;
}

.bf-milk-bottles {
  display: flex;
  gap: 8px;
  justify-content: center;
  font-size: 2em;
}

/* Price on Request styling */
.price-on-request,
.bf-price-contact {
  font-style: italic;
  opacity: 0.8;
}

/* ========================================
   COMPARISON SECTION - LIGHT THEME
   ======================================== */

/* Override dark backgrounds */
.bf-comparison-table-wrapper {
  background: white !important;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.bf-comparison-bulls {
  border-bottom: 2px solid #164170;
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.bf-comparison-bull-header {
  background: #f8f9fa !important;
  border: 1px solid #e0e0e0;
  padding: 15px;
  border-radius: 8px;
}

.bf-comparison-bull-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 10px;
}

.bf-comparison-bull-name {
  color: #164170;
  font-size: 1.1em;
  margin: 10px 0;
}

.bf-comparison-bull-price {
  background: #d9eaf9;
  color: #164170;
  padding: 8px;
  border-radius: 6px;
  margin: 10px 0;
  font-weight: 600;
}

/* Comparison Rows - Light Theme */
.bf-comparison-row {
  background: white !important;
  border-bottom: 1px solid #e0e0e0;
  padding: 15px 0;
}

.bf-comparison-row:hover {
  background: #f8f9fa !important;
}

.bf-comparison-trait-name {
  color: #333;
  font-weight: 600;
  font-size: 0.95em;
}

.bf-comparison-bull-value {
  background: white !important;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}

.bf-comparison-bull-value.winner {
  background: #f0f8ff !important;
  border: 2px solid #164170;
}

.bf-comparison-text-value {
  font-weight: bold;
  color: #164170;
  font-size: 1.1em;
  margin-top: 8px;
}

/* Winner Badge */
.bf-winner-badge {
  background: #FFD700;
  color: #333;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.9em;
  margin-top: 8px;
  display: inline-block;
}

/* Legend - Light Theme */
.bf-comparison-legend {
  background: #f8f9fa !important;
  border: 1px solid #e0e0e0;
  padding: 20px;
  border-radius: 8px;
  margin-top: 30px;
}

.bf-comparison-legend h3 {
  color: #164170;
  margin: 0 0 15px;
  font-size: 1.2em;
}

.bf-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.bf-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.bf-legend-icon {
  font-size: 1.5em;
  min-width: 60px;
  text-align: center;
}

.bf-legend-text {
  color: #444;
  font-size: 0.9em;
}

/* Comparison Actions */
.bf-comparison-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.bf-comparison-actions .bf-btn {
  flex: 1;
  min-width: 200px;
}

/* Hide missing data - show placeholder */
.bf-comparison-bull-value .bf-comparison-text-value:empty::before,
.bf-comparison-text-value:-moz-only-whitespace::before {
  content: 'N/A';
  color: #999;
  font-style: italic;
}

/* Style for missing data text */
.bf-comparison-text-value.missing {
  color: #999;
  font-style: italic;
  font-size: 0.9em;
}

/* Hide visuals when data is missing */
.bf-comparison-visual:has(+ .bf-comparison-text-value.missing) {
  opacity: 0.3;
  filter: grayscale(100%);
}
