/* PropSaver global styles — Bootstrap 5 based (Tailwind removed) */

:root {
  --radius: 0.875rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);
  --radius-3xl: calc(var(--radius) + 12px);

  --font-display: "Fraunces", system-ui, sans-serif;
  --font-sans: "Inter", system-ui, sans-serif;

  /* PropSaver deep navy with turquoise/blue/green brand */
  --background: oklch(0.14 0.04 280);
  --foreground: oklch(0.98 0.005 280);

  --card: oklch(0.18 0.05 280);
  --card-foreground: oklch(0.98 0.005 280);

  --popover: oklch(0.18 0.05 280);
  --popover-foreground: oklch(0.98 0.005 280);

  --primary: oklch(0.75 0.15 200);
  --primary-foreground: oklch(0.14 0.04 230);

  --secondary: oklch(0.24 0.05 230);
  --secondary-foreground: oklch(0.98 0.005 230);

  --muted: oklch(0.22 0.04 230);
  --muted-foreground: oklch(0.72 0.03 220);

  --accent: oklch(0.30 0.10 200);
  --accent-foreground: oklch(0.98 0.005 230);

  --destructive: oklch(0.62 0.22 25);
  --destructive-foreground: oklch(0.98 0 0);

  --border: oklch(0.40 0.08 210 / 0.5);
  --input: oklch(0.24 0.05 230);
  --ring: oklch(0.75 0.15 200);

  --brand: oklch(0.78 0.15 195);
  --brand-glow: oklch(0.78 0.18 195 / 0.45);
  --brand-pink: oklch(0.82 0.14 185);
  --brand-purple: oklch(0.65 0.18 235);
  --brand-cyan: oklch(0.80 0.20 150);
  --success: oklch(0.80 0.20 150);

  --gradient-hero: radial-gradient(circle at center, oklch(0.32 0.10 255) 0%, oklch(0.18 0.06 255) 55%, oklch(0.08 0.04 255) 100%);
  --gradient-card: linear-gradient(180deg, oklch(0.20 0.05 225), oklch(0.16 0.05 230));
  --gradient-brand: linear-gradient(120deg, var(--brand-pink), var(--brand-purple) 50%, var(--brand-cyan));

  --shadow-glow: 0 0 60px -10px var(--brand-glow);
  --shadow-card: 0 10px 40px -10px oklch(0 0 0 / 0.6);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--gradient-hero);
  background-attachment: fixed;
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

/* Brand utility classes (kept for backwards compat with existing markup) */
.text-gradient-brand,
.text-gradient-emerald {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bg-gradient-brand,
.bg-gradient-emerald {
  background: var(--gradient-brand);
}
.bg-gradient-card {
  background: var(--gradient-card);
}
.shadow-brand-glow,
.shadow-emerald-glow {
  box-shadow: var(--shadow-glow);
}
.ring-brand-soft,
.ring-emerald-soft {
  box-shadow: 0 0 0 1px oklch(0.75 0.15 200 / 0.25),
              0 0 30px oklch(0.75 0.18 195 / 0.18);
}

/* Layout helpers used by RootComponent */
.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.min-h-screen { min-height: 100vh; }

/* ===== Compact data table to fit all columns on one screen ===== */
.propsaver-dt table.dataTable {
  font-size: 0.72rem;
  width: 100% !important;
}
.propsaver-dt table.dataTable thead th,
.propsaver-dt table.dataTable tbody td {
  padding: 0.35rem 0.4rem;
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
  vertical-align: middle;
}
.propsaver-dt table.dataTable thead th {
  font-size: 0.7rem;
  font-weight: 600;
}
.propsaver-dt .prop-name-text { font-size: 0.78rem; }
.propsaver-dt .prop-visit-btn { font-size: 0.65rem; padding: 0.15rem 0.4rem; }

/* DataTables Responsive controls: keep Prop Name visible and make the first cell the expander. */
.propsaver-dt table.dataTable.dtr-inline.collapsed > tbody > tr > td.prop-name-cell.dtr-control,
.propsaver-dt table.dataTable.dtr-inline.collapsed > tbody > tr > th.prop-name-cell.dtr-control {
  cursor: pointer;
  white-space: normal;
  min-width: 210px;
}
.propsaver-dt table.dataTable.dtr-inline.collapsed > tbody > tr > td.prop-name-cell.dtr-control:before,
.propsaver-dt table.dataTable.dtr-inline.collapsed > tbody > tr > th.prop-name-cell.dtr-control:before {
  border-left-color: var(--brand);
  margin-right: 0.55rem;
  vertical-align: middle;
}
.propsaver-dt table.dataTable.dtr-inline.collapsed > tbody > tr.dtr-expanded > td.prop-name-cell.dtr-control:before,
.propsaver-dt table.dataTable.dtr-inline.collapsed > tbody > tr.dtr-expanded > th.prop-name-cell.dtr-control:before {
  border-top-color: var(--brand);
  border-left-color: transparent;
}
.propsaver-dt table.dataTable > tbody > tr.child ul.dtr-details {
  width: 100%;
}
.propsaver-dt table.dataTable > tbody > tr.child ul.dtr-details > li {
  border-bottom-color: color-mix(in oklab, var(--brand) 22%, transparent);
  padding: 0.45rem 0;
}
.propsaver-dt table.dataTable > tbody > tr.child span.dtr-title {
  color: var(--brand);
  min-width: 150px;
}
@media (max-width: 1699.98px) {
  .propsaver-dt table.dataTable {
    font-size: 0.68rem;
  }
  .propsaver-dt table.dataTable thead th,
  .propsaver-dt table.dataTable tbody td {
    padding: 0.3rem 0.3rem;
  }
}

/* ===== Prop tier badges & row tinting ===== */
.prop-name-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
}
.prop-tier-legend {
  display: inline-flex;
  gap: 0.35rem;
}
.tier-badge {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.78);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 3px rgba(0, 0, 0, 0.28),
    0 2px 4px rgba(0, 0, 0, 0.45);
  position: relative;
}
.tier-badge.tier-gold {
  background: linear-gradient(160deg, #fff1b8 0%, #f4c64a 35%, #b8801c 70%, #8a5a10 100%);
}
.tier-badge.tier-silver {
  background: linear-gradient(160deg, #ffffff 0%, #d9dde2 35%, #8d949c 70%, #5b6168 100%);
}
.tier-badge.tier-yellow {
  background: linear-gradient(160deg, #ffffff 0%, #fffba8 40%, #fff170 80%, #f0d84a 100%);
}
.tier-badge.tier-pink {
  background: linear-gradient(160deg, #ffd6e5 0%, #ff7fb1 40%, #c43a72 80%, #7a1f44 100%);
}

/* Tooltip that appears on tier-badge hover */
.tier-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #0a1828;
  border: 1px solid rgba(0, 0, 0, 0.45);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: #1a1a1a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3),
    0 8px 20px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 100;
}
.tier-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.5) transparent transparent transparent;
}
/* 3D color-matched tooltip backgrounds per tier */
.tier-badge.tier-gold .tier-tooltip {
  background: linear-gradient(160deg, #fff1b8 0%, #f4c64a 40%, #b8801c 80%, #8a5a10 100%);
}
.tier-badge.tier-silver .tier-tooltip {
  background: linear-gradient(160deg, #ffffff 0%, #d9dde2 40%, #8d949c 80%, #5b6168 100%);
}
.tier-badge.tier-yellow .tier-tooltip {
  background: linear-gradient(160deg, #ffffff 0%, #fffba8 40%, #fff170 80%, #f0d84a 100%);
}
.tier-badge.tier-pink .tier-tooltip {
  background: linear-gradient(160deg, #ffd6e5 0%, #ff7fb1 40%, #c43a72 80%, #7a1f44 100%);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
/* Align gold & silver tooltips to the left */
.tier-badge.tier-gold .tier-tooltip,
.tier-badge.tier-silver .tier-tooltip {
  left: 0;
  transform: none;
}
.tier-badge.tier-gold .tier-tooltip::after,
.tier-badge.tier-silver .tier-tooltip::after {
  left: 10px;
  transform: none;
}
.tier-badge:hover .tier-tooltip {
  opacity: 1;
}

/* Small colored dot next to company name */
.tier-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 2px rgba(0, 0, 0, 0.28),
    0 1px 2px rgba(0, 0, 0, 0.45);
  margin-right: 0.35rem;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.tier-dot.tier-gold {
  background: linear-gradient(160deg, #fff1b8 0%, #f4c64a 35%, #b8801c 70%, #8a5a10 100%);
}
.tier-dot.tier-silver {
  background: linear-gradient(160deg, #ffffff 0%, #d9dde2 35%, #8d949c 70%, #5b6168 100%);
}
.tier-dot.tier-yellow {
  background: linear-gradient(160deg, #ffffff 0%, #fffba8 40%, #fff170 80%, #f0d84a 100%);
}
.tier-dot.tier-pink {
  background: linear-gradient(160deg, #ffd6e5 0%, #ff7fb1 40%, #c43a72 80%, #7a1f44 100%);
}
/* Prop name row layout */
.prop-name-main {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 0.15rem;
}

/* Row name-cell tint based on tier */
.prop-name-wrap.prop-tier-gold {
  background: linear-gradient(135deg, rgba(244, 198, 74, 0.22), rgba(184, 128, 28, 0.10));
  border-left: 3px solid #f4c64a;
  padding-left: 0.5rem;
  border-radius: 4px;
}
.prop-name-wrap.prop-tier-silver {
  background: linear-gradient(135deg, rgba(217, 221, 226, 0.20), rgba(141, 148, 156, 0.10));
  border-left: 3px solid #d9dde2;
  padding-left: 0.5rem;
  border-radius: 4px;
}
.prop-name-wrap.prop-tier-yellow {
  background: linear-gradient(135deg, rgba(255, 251, 168, 0.30), rgba(240, 216, 74, 0.10));
  border-left: 3px solid #fff170;
  padding-left: 0.5rem;
  border-radius: 4px;
}
.prop-name-wrap.prop-tier-pink {
  background: linear-gradient(135deg, rgba(255, 127, 177, 0.22), rgba(196, 58, 114, 0.10));
  border-left: 3px solid #ff7fb1;
  padding-left: 0.5rem;
  border-radius: 4px;
}

/* ===== Fade-in animation for compare results ===== */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(24px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ===== Fade-out animation for compare clear ===== */
@keyframes fadeOutDown {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(20px);
  }
}

.animate-fade-out {
  animation: fadeOutDown 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Stagger table rows inside animated container */
.animate-fade-in tbody tr {
  opacity: 0;
  animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.animate-fade-in tbody tr:nth-child(1) { animation-delay: 0.10s; }
.animate-fade-in tbody tr:nth-child(2) { animation-delay: 0.18s; }
.animate-fade-in tbody tr:nth-child(3) { animation-delay: 0.26s; }
.animate-fade-in tbody tr:nth-child(4) { animation-delay: 0.34s; }
.animate-fade-in tbody tr:nth-child(5) { animation-delay: 0.42s; }
.animate-fade-in tbody tr:nth-child(6) { animation-delay: 0.50s; }
.animate-fade-in tbody tr:nth-child(7) { animation-delay: 0.58s; }
.animate-fade-in tbody tr:nth-child(8) { animation-delay: 0.66s; }
.animate-fade-in tbody tr:nth-child(9) { animation-delay: 0.74s; }
.animate-fade-in tbody tr:nth-child(10) { animation-delay: 0.82s; }
.animate-fade-in tbody tr:nth-child(11) { animation-delay: 0.90s; }
.animate-fade-in tbody tr:nth-child(12) { animation-delay: 0.98s; }

/* Tier badge: click-to-sort affordance */
.tier-badge[data-tier] { cursor: pointer; user-select: none; }
.tier-badge[data-tier]:hover { transform: translateY(-1px); }
.tier-badge.tier-filter-active {
  outline: 2px solid rgba(77,212,196,0.9);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(77,212,196,0.25);
}
