﻿
/**
 * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 * 
 * Appearance trait styling.
 */


/*
 * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 * 
 * Appearance indicator card partial styling.
 */

/* Card Layout */
.appearance-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 450px;
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.appearance-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.appearance-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.appearance-card-bottom {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #f1f3f5;
}

/* Header */
.appearance-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.appearance-icon {
  width: 60px;
  /* Keep icon perfectly circular without stretching */
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4285F4, #34A853);
  color: #ffffff;
  overflow: hidden;
}

.appearance-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.appearance-title {
  font-size: 24px;
  font-weight: 600;
  color: #333333;
  margin: 0;
}

.appearance-subtitle {
  font-size: 14px;
  color: #666666;
  line-height: 1.3;
  /* Reserve space for up to two lines to keep header height consistent */
  min-height: calc(1.3em * 2);
  /* Clamp to two lines so longer descriptions do not expand header */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Confidence Badge */
.appearance-card .confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 6px;
}

.appearance-card .confidence-badge.very-high {
  background-color: #d4edda;
  color: #155724;
}

.appearance-card .confidence-badge.moderate {
  background-color: #fff3cd;
  color: #856404;
}

.appearance-card .confidence-badge.low {
  background-color: #f8d7da;
  color: #721c24;
}

/* Dominant trait display */
.dominant-trait {
  font-size: 44px;
  font-weight: 700;
  color: #2E7D32;
  line-height: 1;
  margin: 12px 0 6px 0;
}

.dominant-label {
  font-size: 20px;
  color: #666666;
  font-weight: 500;
  margin-bottom: 16px;
}

/* Progress Bars */
.appearance-card .progress-container {
  width: 100%;
  height: 12px;
  background-color: #f1f3f5;
  border-radius: 25px;
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}

.appearance-card .progress-container.small {
  height: 6px;
  margin-bottom: 8px;
}

.appearance-card .progress-bar {
  height: 100%;
  width: 0;
  transition: width 0.8s ease-out;
  border-radius: 25px;
}

.appearance-card .progress-bar.progress-high {
  background: linear-gradient(90deg, #28a745 0%, #20c997 100%) !important;
}

.appearance-card .progress-bar.progress-moderate {
  background: linear-gradient(90deg, #ffc107 0%, #fd7e14 100%) !important;
}

.appearance-card .progress-bar.progress-low {
  background: linear-gradient(90deg, #dc3545 0%, #e74c3c 100%) !important;
}

.appearance-card .progress-bar.progress-bar-muted {
  background-color: #dee2e6 !important;
}

/* Other traits section */
.appearance-card .other-traits {
  margin-top: 15px;
  flex: 1;
  display: grid;
  gap: 12px;
}

/* Trait Rows */
.appearance-card .trait-row {
  margin-bottom: 12px;
}

.appearance-card .trait-row.muted {
  opacity: 0.8;
}

.appearance-card .trait-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #555555;
  flex-shrink: 0;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appearance-card .trait-percentage {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333333;
  flex-shrink: 0;
  min-width: 50px;
  text-align: right;
}

/* Bottom section styling */
.appearance-card .explanatory-text {
/*  font-size: 0.85rem;*/
  color: #6c757d;
  line-height: 1.4;
  margin-bottom: 15px;
}

.appearance-card .appearance-card-footer {
  font-size: 0.9rem;
  color: #495057;
}

/* Learn More Section Styling */
.appearance-card .learn-more-section {
  padding: 12px 0 8px 0;
  border-top: 1px solid #f1f3f5;
  margin-top: 12px;
}

.appearance-card .learn-more-section .btn {
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.appearance-card .learn-more-section .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Environmental Warning Styling */
.appearance-card .environmental-warning {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  text-align: center;
  font-size: 0.8rem;
}

.appearance-card .environmental-warning i {
  color: #ffc107;
  margin-right: 4px;
}

.appearance-card .environmental-warning .help-tooltip {
  margin-left: 4px;
  cursor: help;
}

.appearance-card .environmental-warning .help-tooltip i {
  font-size: 0.75rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.appearance-card .environmental-warning .help-tooltip:hover i {
  opacity: 1;
}

/* Enhanced Confidence Badge Styling */
.appearance-card .confidence-badge {
  transition: all 0.2s ease;
  cursor: help;
}

.appearance-card .confidence-badge:hover {
  transform: scale(1.05);
}

/* Influence Breakdown Section */
.appearance-card .influence-breakdown {
  background: rgba(248, 249, 250, 0.8);
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
}

.appearance-card .influence-header {
  text-align: center;
  margin-bottom: 10px;
}

.appearance-card .influence-header i {
  color: #4285F4;
}

.appearance-card .influence-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.appearance-card .influence-item {
  background: #ffffff;
  border-radius: 8px;
  padding: 8px 10px;
}

.appearance-card .influence-label {
  display: flex;
  align-items: center;
  font-weight: 500;
  color: #495057;
}

.appearance-card .influence-percentage {
  color: #212529;
}

.appearance-card .progress-bar.progress-genetic {
  background: linear-gradient(90deg, #4285F4 0%, #34A853 100%) !important;
}

.appearance-card .progress-bar.progress-environmental {
  background: linear-gradient(90deg, #34A853 0%, #66BB6A 100%) !important;
}

.appearance-card .influence-note {
  text-align: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.appearance-card .influence-note i {
  margin-right: 4px;
}

/* Footer Enhancement */
.appearance-card .appearance-card-footer {
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Animation for New Elements */
.learn-more-section,
.environmental-warning {
  animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .appearance-card {
    padding: 20px;
    min-height: 400px;
  }

  .dominant-trait {
    font-size: 36px;
  }

  .appearance-card .trait-name {
    max-width: 65%;
  }

  .appearance-card .learn-more-section .btn {
    font-size: 0.8rem;
    padding: 5px 10px;
  }

  .appearance-card .environmental-warning {
    font-size: 0.75rem;
    padding: 6px 10px;
  }

  .appearance-card .influence-breakdown {
    padding: 10px;
    margin: 10px 0;
  }

  .appearance-card .influence-item {
    padding: 6px 8px;
  }

  .appearance-card .influence-note {
    padding: 6px;
    font-size: 0.75rem;
  }
}