/* ========================================================================
   Brahma Color Tool — Premium Stylesheet
   Gallinas Brahma Boyacá · v1.0.0
   ======================================================================== */

/* Google Font */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600&family=Montserrat:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens ────────────────────────────────────────────────────── */
:root {
  --bct-font: 'Montserrat', sans-serif;
  --bct-font-heading: 'Cormorant Garamond', serif;

  /* Palette */
  --bct-bg-deep:        #13100c;
  --bct-bg-card:        rgba(42, 32, 22, 0.65);
  --bct-bg-card-hover:  rgba(55, 40, 28, 0.75);
  --bct-bg-result:      rgba(30, 22, 15, 0.80);
  --bct-border:         rgba(212, 168, 83, 0.20);
  --bct-border-hover:   rgba(212, 168, 83, 0.45);
  --bct-gold:           #d4a853;
  --bct-gold-light:     #f0d48a;
  --bct-amber:          #e8a435;
  --bct-text:           #f5efe6;
  --bct-text-muted:     #b8a990;
  --bct-text-dim:       #7a6b5c;

  /* Verdict Colors */
  --bct-ideal:          #4caf50;
  --bct-ideal-bg:       rgba(76, 175, 80, 0.12);
  --bct-trabajo:        #2196f3;
  --bct-trabajo-bg:     rgba(33, 150, 243, 0.12);
  --bct-trabajo-b:      #03a9f4;
  --bct-trabajo-b-bg:   rgba(3, 169, 244, 0.12);
  --bct-rescate:        #ff9800;
  --bct-rescate-bg:     rgba(255, 152, 0, 0.12);
  --bct-no-rec:         #f44336;
  --bct-no-rec-bg:      rgba(244, 67, 54, 0.12);
  --bct-destructivo:    #d32f2f;
  --bct-destructivo-bg: rgba(211, 47, 47, 0.15);

  /* Spacing */
  --bct-radius:         16px;
  --bct-radius-sm:      10px;
  --bct-gap:            20px;

  /* Transitions */
  --bct-ease:           cubic-bezier(0.4, 0, 0.2, 1);
  --bct-duration:       0.3s;
}

/* ── Container ────────────────────────────────────────────────────────── */
.brahma-ct {
  font-family: var(--bct-font);
  max-width: 920px;
  margin: 40px auto;
  padding: 36px 32px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(212, 168, 83, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(232, 164, 53, 0.06) 0%, transparent 60%),
    linear-gradient(175deg, #1a1410 0%, #13100c 50%, #0f0d0a 100%);
  border: 1px solid var(--bct-border);
  border-radius: var(--bct-radius);
  color: var(--bct-text);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.brahma-ct *,
.brahma-ct *::before,
.brahma-ct *::after {
  box-sizing: border-box;
}

/* Ambient glow */
.brahma-ct::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 250px;
  background: radial-gradient(ellipse, rgba(212, 168, 83, 0.10) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.brahma-ct > * {
  position: relative;
  z-index: 1;
}

/* ── Header ───────────────────────────────────────────────────────────── */
.brahma-ct__header {
  text-align: center;
  margin-bottom: 32px;
}

.brahma-ct__icon {
  font-size: 48px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(212, 168, 83, 0.4));
  animation: bct-float 3s ease-in-out infinite;
}

@keyframes bct-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.brahma-ct__title {
  font-family: var(--bct-font-heading);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 600;
  margin: 0 0 8px 0;
  background: linear-gradient(135deg, var(--bct-gold-light) 0%, var(--bct-amber) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.brahma-ct__subtitle {
  font-size: 0.95rem;
  color: var(--bct-text-muted);
  margin: 0;
  font-weight: 300;
  letter-spacing: 0.02em;
}

/* ── Selectors ────────────────────────────────────────────────────────── */
.brahma-ct__selectors {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--bct-gap);
  align-items: start;
  margin-bottom: 28px;
}

.brahma-ct__selector {
  background: var(--bct-bg-card);
  border: 1px solid var(--bct-border);
  border-radius: var(--bct-radius);
  padding: 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color var(--bct-duration) var(--bct-ease),
              box-shadow var(--bct-duration) var(--bct-ease),
              background var(--bct-duration) var(--bct-ease);
}

.brahma-ct__selector:hover,
.brahma-ct__selector:focus-within {
  border-color: var(--bct-border-hover);
  box-shadow: 0 0 24px rgba(212, 168, 83, 0.08);
  background: var(--bct-bg-card-hover);
}

.brahma-ct__selector-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 14px;
  color: var(--bct-text);
}

.brahma-ct__selector-emoji {
  font-size: 1.6rem;
  line-height: 1;
}

.brahma-ct__selector select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(19, 16, 12, 0.7);
  color: var(--bct-text);
  border: 1px solid var(--bct-border);
  border-radius: var(--bct-radius-sm);
  font-family: var(--bct-font);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color var(--bct-duration) var(--bct-ease);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4a853' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.brahma-ct__selector select:focus {
  outline: none;
  border-color: var(--bct-gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}

.brahma-ct__selector select option {
  background: #1a1410;
  color: var(--bct-text);
  padding: 8px;
}

/* Photo preview */
.brahma-ct__photo-container {
  margin-top: 14px;
  width: 100%;
  height: 280px;
  border-radius: var(--bct-radius-sm);
  overflow: hidden;
  border: 1px solid var(--bct-border);
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brahma-ct__photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--bct-duration) var(--bct-ease);
}

/* Gene badge */
.brahma-ct__gene-badge {
  margin-top: 10px;
  font-size: 0.78rem;
  font-family: 'Courier New', monospace;
  color: var(--bct-gold);
  background: rgba(212, 168, 83, 0.08);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(212, 168, 83, 0.12);
  min-height: 32px;
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--bct-duration) var(--bct-ease);
}

.brahma-ct__gene-badge.active {
  opacity: 1;
  transform: translateY(0);
}

/* Swap button */
.brahma-ct__swap-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 44px;
}

.brahma-ct__swap-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--bct-border);
  background: var(--bct-bg-card);
  color: var(--bct-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--bct-duration) var(--bct-ease);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.brahma-ct__swap-btn:hover {
  background: rgba(212, 168, 83, 0.15);
  border-color: var(--bct-gold);
  transform: rotate(180deg);
  box-shadow: 0 0 16px rgba(212, 168, 83, 0.2);
}

.brahma-ct__swap-btn:active {
  transform: rotate(180deg) scale(0.92);
}

.brahma-ct__swap-btn svg {
  width: 20px;
  height: 20px;
}

/* ── Result Panel ─────────────────────────────────────────────────────── */
.brahma-ct__result {
  background: var(--bct-bg-result);
  border: 1px solid var(--bct-border);
  border-radius: var(--bct-radius);
  padding: 28px;
  min-height: 140px;
  margin-bottom: 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.5s var(--bct-ease),
              box-shadow 0.5s var(--bct-ease);
}

/* Verdict-based border glow */
.brahma-ct__result[data-verdict="ideal"] {
  border-color: rgba(76, 175, 80, 0.4);
  box-shadow: 0 0 30px rgba(76, 175, 80, 0.08), inset 0 0 30px rgba(76, 175, 80, 0.03);
}
.brahma-ct__result[data-verdict="trabajo"] {
  border-color: rgba(33, 150, 243, 0.4);
  box-shadow: 0 0 30px rgba(33, 150, 243, 0.08), inset 0 0 30px rgba(33, 150, 243, 0.03);
}
.brahma-ct__result[data-verdict="trabajo-b"] {
  border-color: rgba(3, 169, 244, 0.35);
  box-shadow: 0 0 30px rgba(3, 169, 244, 0.07), inset 0 0 30px rgba(3, 169, 244, 0.03);
}
.brahma-ct__result[data-verdict="rescate"] {
  border-color: rgba(255, 152, 0, 0.4);
  box-shadow: 0 0 30px rgba(255, 152, 0, 0.08), inset 0 0 30px rgba(255, 152, 0, 0.03);
}
.brahma-ct__result[data-verdict="no-recomendado"] {
  border-color: rgba(244, 67, 54, 0.35);
  box-shadow: 0 0 30px rgba(244, 67, 54, 0.07), inset 0 0 30px rgba(244, 67, 54, 0.03);
}
.brahma-ct__result[data-verdict="destructivo"] {
  border-color: rgba(211, 47, 47, 0.5);
  box-shadow: 0 0 30px rgba(211, 47, 47, 0.10), inset 0 0 30px rgba(211, 47, 47, 0.04);
}

/* Placeholder state */
.brahma-ct__result-placeholder {
  text-align: center;
  padding: 20px 0;
}

.brahma-ct__placeholder-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.6;
  animation: bct-pulse 2s ease-in-out infinite;
}

@keyframes bct-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.05); }
}

.brahma-ct__result-placeholder p {
  color: var(--bct-text-dim);
  font-size: 0.9rem;
  margin: 0;
  font-weight: 300;
}

/* Filled result */
.brahma-ct__result-content {
  animation: bct-fadeSlide 0.5s var(--bct-ease) forwards;
}

@keyframes bct-fadeSlide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.brahma-ct__result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.brahma-ct__result-cross {
  font-size: 0.85rem;
  color: var(--bct-text-muted);
  font-weight: 400;
}

.brahma-ct__result-cross strong {
  color: var(--bct-gold-light);
  font-weight: 600;
}

/* Verdict badge */
.brahma-ct__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.brahma-ct__badge--ideal {
  background: var(--bct-ideal-bg);
  color: var(--bct-ideal);
  border: 1px solid rgba(76, 175, 80, 0.25);
}
.brahma-ct__badge--trabajo {
  background: var(--bct-trabajo-bg);
  color: var(--bct-trabajo);
  border: 1px solid rgba(33, 150, 243, 0.25);
}
.brahma-ct__badge--trabajo-b {
  background: var(--bct-trabajo-b-bg);
  color: var(--bct-trabajo-b);
  border: 1px solid rgba(3, 169, 244, 0.25);
}
.brahma-ct__badge--rescate {
  background: var(--bct-rescate-bg);
  color: var(--bct-rescate);
  border: 1px solid rgba(255, 152, 0, 0.25);
}
.brahma-ct__badge--no-recomendado {
  background: var(--bct-no-rec-bg);
  color: var(--bct-no-rec);
  border: 1px solid rgba(244, 67, 54, 0.25);
}
.brahma-ct__badge--destructivo {
  background: var(--bct-destructivo-bg);
  color: var(--bct-destructivo);
  border: 1px solid rgba(211, 47, 47, 0.3);
}

/* Result body */
.brahma-ct__result-body {
  margin-top: 16px;
}

.brahma-ct__result-f1 {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--bct-text);
  margin: 0 0 12px 0;
}

.brahma-ct__result-nota {
  font-size: 0.85rem;
  color: var(--bct-text-muted);
  margin: 0;
  padding: 10px 14px;
  background: rgba(212, 168, 83, 0.06);
  border-left: 3px solid var(--bct-gold);
  border-radius: 0 8px 8px 0;
  line-height: 1.55;
  font-style: italic;
}

/* Direction note */
.brahma-ct__result-direction {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(33, 150, 243, 0.06);
  border: 1px solid rgba(33, 150, 243, 0.12);
  border-radius: var(--bct-radius-sm);
  font-size: 0.85rem;
  color: var(--bct-text-muted);
  line-height: 1.55;
}

.brahma-ct__result-direction-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Actions ──────────────────────────────────────────────────────────── */
.brahma-ct__actions {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.brahma-ct__reset-btn {
  padding: 10px 28px;
  border: 1px solid var(--bct-border);
  border-radius: var(--bct-radius-sm);
  background: transparent;
  color: var(--bct-text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--bct-duration) var(--bct-ease);
  letter-spacing: 0.02em;
}

.brahma-ct__reset-btn:hover {
  color: var(--bct-text);
  border-color: var(--bct-border-hover);
  background: rgba(212, 168, 83, 0.06);
}

/* ── Legend ────────────────────────────────────────────────────────────── */
.brahma-ct__legend {
  border: 1px solid var(--bct-border);
  border-radius: var(--bct-radius-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.brahma-ct__legend summary {
  padding: 14px 20px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--bct-text-muted);
  background: rgba(42, 32, 22, 0.3);
  transition: all var(--bct-duration) var(--bct-ease);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brahma-ct__legend summary::-webkit-details-marker {
  display: none;
}

.brahma-ct__legend summary::after {
  content: '▸';
  margin-left: auto;
  font-size: 0.8rem;
  transition: transform var(--bct-duration) var(--bct-ease);
  color: var(--bct-gold);
}

.brahma-ct__legend[open] summary::after {
  transform: rotate(90deg);
}

.brahma-ct__legend summary:hover {
  color: var(--bct-text);
  background: rgba(42, 32, 22, 0.5);
}

.brahma-ct__legend-content {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brahma-ct__legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--bct-text-muted);
}

.brahma-ct__legend-item .brahma-ct__badge {
  min-width: 160px;
  justify-content: center;
  font-size: 0.78rem;
}

/* ── Credits ──────────────────────────────────────────────────────────── */
.brahma-ct__credits {
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid rgba(212, 168, 83, 0.08);
}

.brahma-ct__credits p {
  font-size: 0.78rem;
  color: var(--bct-text-dim);
  margin: 0;
  line-height: 1.5;
}

.brahma-ct__credits a {
  color: var(--bct-gold);
  text-decoration: none;
  transition: color var(--bct-duration) var(--bct-ease);
}

.brahma-ct__credits a:hover {
  color: var(--bct-gold-light);
  text-decoration: underline;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .brahma-ct {
    margin: 20px 12px;
    padding: 24px 16px;
  }

  .brahma-ct__selectors {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .brahma-ct__swap-container {
    padding-top: 0;
    order: 1;
    margin: 10px 0;
  }

  #brahma-ct-selector-gallo  { order: 0; }
  #brahma-ct-selector-gallina { order: 2; }

  .brahma-ct__photo-container {
    height: 240px;
  }

  .brahma-ct__swap-btn {
    width: 40px;
    height: 40px;
  }

  .brahma-ct__swap-btn svg {
    transform: rotate(90deg);
  }

  .brahma-ct__swap-btn:hover svg {
    transform: rotate(270deg);
  }

  .brahma-ct__result {
    padding: 20px 16px;
  }

  .brahma-ct__legend-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .brahma-ct__legend-item .brahma-ct__badge {
    min-width: auto;
  }

  .brahma-ct__result-header {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .brahma-ct__title {
    font-size: 1.35rem;
  }

  .brahma-ct__subtitle {
    font-size: 0.85rem;
  }

  .brahma-ct__selector {
    padding: 16px;
  }
}
