/**
 * Results and Comparison Styles
 * For bull cards, match scores, and side-by-side comparisons
 */

/* ========================================
   RESULTS COMPONENT
   ======================================== */

.bf-results-container {
  max-width: 1400px;
  margin: 0 auto;
}

.bf-results-header {
  text-align: center;
  margin-bottom: 50px;
}

.bf-trophy-icon {
  font-size: 2em;
  display: inline-block;
  margin-right: 10px;
}

.bf-results-title {
  font-size: 2.5em;
  margin: 0 0 10px;
  color: var(--bf-primary);
}

.bf-results-subtitle {
  font-size: 1.1em;
  color: var(--bf-text-light);
  margin: 0;
}

/* No Results */
.bf-no-results {
  text-align: center;
  padding: 60px 20px;
}

.bf-no-results-icon {
  font-size: 5em;
  margin-bottom: 20px;
}

.bf-no-results h3 {
  margin: 0 0 10px;
  color: var(--bf-text);
}

.bf-no-results p {
  color: var(--bf-text-light);
}

/* Compare Bar */
.bf-compare-bar {
  position: sticky;
  top: 20px;
  background: var(--bf-primary);
  color: white;
  padding: 15px 25px;
  border-radius: var(--bf-radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin-bottom: 30px;
  z-index: 100;
}

.bf-compare-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.bf-compare-count {
  font-weight: 600;
}

.bf-compare-hint {
  font-size: 0.9em;
  opacity: 0.9;
}

/* Results Grid */
.bf-results-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
  gap: 30px !important;
  margin-bottom: 40px;
  width: 100%;
}

/* Ensure bull cards don't override grid */
.bf-results-grid > .bf-bull-card {
  width: auto !important;
  max-width: 100% !important;
  float: none !important;
  display: block !important;
}

/* Bull Card */
.bf-bull-card {
  background: white;
  border-radius: var(--bf-radius);
  box-shadow: var(--bf-shadow);
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

.bf-bull-card:hover {
  box-shadow: var(--bf-shadow-hover);
  transform: translateY(-8px);
}

.bf-bull-card.selected {
  border: 3px solid var(--bf-primary);
}

.bf-bull-card.top-match {
  border: 3px solid var(--bf-accent);
}

/* Top Badge */
.bf-top-badge {
  position: absolute;
  top: 15px;
  left: -35px;
  background: var(--bf-accent);
  color: white;
  padding: 8px 50px;
  font-weight: bold;
  font-size: 0.9em;
  transform: rotate(-45deg);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Selection Checkbox */
.bf-card-select {
  position: absolute;
  top: 15px;
  right: 15px;
  background: white;
  padding: 8px 12px;
  border-radius: var(--bf-radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.bf-card-select input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.bf-card-select label {
  margin: 0;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 600;
  color: var(--bf-primary);
}

/* Match Ring */
.bf-match-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 20px auto -60px;
  z-index: 5;
}

.bf-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.bf-ring-fill {
  transition: stroke-dashoffset 1.5s ease;
}

.bf-match-score {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: white;
  border-radius: 50%;
  width: 90px;
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bf-score-number {
  font-size: 1.8em;
  font-weight: bold;
  line-height: 1;
}

.bf-score-label {
  font-size: 0.75em;
  color: var(--bf-text-light);
  margin-top: 2px;
}

/* Card Image */
.bf-card-image {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.bf-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.bf-bull-card:hover .bf-card-image img {
  transform: scale(1.1);
}

.bf-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bf-bull-card:hover .bf-image-overlay {
  opacity: 1;
}

.bf-view-btn {
  background: white;
  color: var(--bf-primary);
  padding: 12px 24px;
  border-radius: var(--bf-radius-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.bf-view-btn:hover {
  background: var(--bf-primary);
  color: white;
}

/* Card Content */
.bf-card-title {
  margin: 70px 20px 10px;
  font-size: 1.5em;
  color: var(--bf-primary);
  text-align: center;
}

.bf-match-level {
  text-align: center;
  font-weight: 600;
  font-size: 1.1em;
  margin-bottom: 20px;
}

/* Match Reasons */
.bf-match-reasons {
  padding: 0 20px 20px;
}

.bf-match-reasons h4 {
  margin: 0 0 10px;
  font-size: 0.95em;
  color: var(--bf-text-light);
}

.bf-match-reasons ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bf-match-reasons li {
  padding: 5px 0;
  font-size: 0.9em;
  color: var(--bf-text);
}

.bf-check-icon {
  color: var(--bf-success);
  margin-right: 8px;
  font-weight: bold;
}

/* Key Traits */
.bf-key-traits {
  padding: 20px;
  background: var(--bf-bg);
}

.bf-trait-bars {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.bf-trait-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bf-trait-label {
  flex: 0 0 110px;
  font-size: 0.9em;
  font-weight: 600;
  color: var(--bf-text);
}

.bf-trait-bar-container {
  flex: 1;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.bf-trait-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.bf-trait-value {
  flex: 0 0 45px;
  text-align: right;
  font-size: 0.85em;
  font-weight: 600;
}

/* Trait Visuals (for dairy) */
.bf-trait-visual {
  margin-bottom: 15px;
}

.bf-milk-bottles,
.bf-cheese-wheels,
.bf-health-hearts {
  font-size: 1.5em;
  margin: 5px 0;
}

/* Card Price */
.bf-card-price {
  padding: 15px 20px;
  font-size: 1.3em;
  font-weight: bold;
  color: var(--bf-primary);
  text-align: center;
}

/* Card Actions */
.bf-card-actions {
  padding: 20px;
  border-top: 2px solid var(--bf-bg);
}

/* Results Tips */
.bf-results-tips {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 30px;
  border-radius: var(--bf-radius);
  margin-top: 40px;
}

.bf-results-tips h3 {
  margin: 0 0 15px;
  color: var(--bf-primary);
}

.bf-results-tips ul {
  margin: 0;
  padding-left: 25px;
}

.bf-results-tips li {
  margin: 8px 0;
  color: var(--bf-text);
}

/* ========================================
   COMPARISON COMPONENT
   ======================================== */

.bf-comparison-container {
  max-width: 1400px;
  margin: 0 auto;
}

.bf-comparison-header {
  margin-bottom: 40px;
}

.bf-comparison-title {
  font-size: 2em;
  margin: 20px 0 10px;
  color: var(--bf-primary);
  text-align: center;
}

.bf-comparison-subtitle {
  text-align: center;
  color: var(--bf-text-light);
  margin: 0 0 20px;
}

/* Comparison Table */
.bf-comparison-table-wrapper {
  background: white;
  border-radius: var(--bf-radius);
  padding: 30px;
  box-shadow: var(--bf-shadow);
  overflow-x: auto;
}

.bf-comparison-bulls {
  display: grid;
  grid-template-columns: 180px repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--bf-border);
}

.bf-comparison-trait-header {
  font-weight: bold;
  color: var(--bf-primary);
  font-size: 1.1em;
  display: flex;
  align-items: flex-end;
  padding-bottom: 10px;
}

.bf-comparison-bull-header {
  text-align: center;
  padding: 15px;
  background: var(--bf-bg);
  border-radius: var(--bf-radius);
}

.bf-comparison-bull-image {
  width: 100%;
  max-width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: var(--bf-radius);
  margin-bottom: 15px;
}

.bf-comparison-bull-name {
  margin: 0 0 10px;
  font-size: 1.2em;
  color: var(--bf-primary);
}

.bf-comparison-bull-price {
  font-size: 1.1em;
  font-weight: bold;
  color: var(--bf-accent);
  margin-bottom: 15px;
}

/* Comparison Rows */
.bf-comparison-traits {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bf-comparison-row {
  display: grid;
  grid-template-columns: 180px repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  align-items: center;
  padding: 20px;
  background: var(--bf-bg);
  border-radius: var(--bf-radius);
  transition: all 0.2s ease;
}

.bf-comparison-row:hover {
  background: #e8ece8;
}

.bf-comparison-trait-name {
  font-weight: 600;
  color: var(--bf-text);
}

.bf-trait-unit {
  display: block;
  font-size: 0.8em;
  color: var(--bf-text-light);
  font-weight: normal;
  margin-top: 2px;
}

.bf-comparison-bull-value {
  text-align: center;
  padding: 15px;
  background: white;
  border-radius: var(--bf-radius-sm);
  position: relative;
  transition: all 0.3s ease;
}

.bf-comparison-bull-value.winner {
  background: linear-gradient(135deg, #fffacd, #fff8dc);
  border: 2px solid var(--bf-accent);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.2);
}

/* Visual Elements */
.bf-comparison-visual {
  font-size: 1.5em;
  margin-bottom: 10px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bf-compare-bar-container {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

.bf-compare-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.bf-compare-bar-value {
  font-size: 0.85em;
  font-weight: 600;
}

.bf-compare-speedometer {
  padding: 5px;
}

.bf-speedometer-value {
  font-weight: 600;
  color: var(--bf-primary);
}

.bf-compare-thermometer {
  width: 20px;
  height: 60px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto 5px;
  position: relative;
}

.bf-thermometer-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 10px;
  transition: height 0.8s ease;
}

.bf-thermometer-value {
  font-size: 0.85em;
  font-weight: 600;
}

.bf-comparison-text-value {
  font-size: 0.9em;
  color: var(--bf-text);
  margin-top: 5px;
}

/* Winner Badge */
.bf-winner-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 1.5em;
  animation: bf-bounce 1s ease infinite;
}

@keyframes bf-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Comparison Legend */
.bf-comparison-legend {
  margin-top: 40px;
  padding: 25px;
  background: var(--bf-bg);
  border-radius: var(--bf-radius);
}

.bf-comparison-legend h3 {
  margin: 0 0 20px;
  color: var(--bf-primary);
}

.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: 12px;
  padding: 10px;
  background: white;
  border-radius: var(--bf-radius-sm);
}

.bf-legend-icon {
  font-size: 1.5em;
  flex: 0 0 50px;
  text-align: center;
}

.bf-legend-text {
  flex: 1;
  font-size: 0.9em;
  color: var(--bf-text);
}

/* Comparison Actions */
.bf-comparison-actions {
  display: flex;
  gap: 15px;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 3px solid var(--bf-border);
  flex-wrap: wrap;
  justify-content: center;
}

.bf-comparison-actions .bf-btn {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

/* No Comparison Data */
.bf-no-comparison {
  text-align: center;
  padding: 60px 20px;
  font-size: 1.1em;
  color: var(--bf-text-light);
}
