/* ==========================================================================
   Competitive Analysis
   ========================================================================== */

.comp-analysis {
  background: #ebebf0;
  padding: 28px 24px 24px;
  color: rgba(0, 0, 0, 0.55);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

.comp-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.comp-scroll::-webkit-scrollbar {
  display: none;
}

.comp-grid {
  display: flex;
  flex-direction: column;
}

.comp-header,
.comp-row {
  display: grid;
  grid-template-columns: 160px repeat(6, 1fr);
  align-items: center;
}

/* Sticky left column (for mobile scroll) */
.comp-label-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #ebebf0;
}

/* Tool header cells */
.comp-tool-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  transition:
    opacity 0.3s ease,
    filter 0.3s ease;
}

.comp-tool-header img {
  height: 28px;
  width: auto;
  display: block;
}

.comp-tool-header span {
  font-size: 11px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

/* Row dividers */
.comp-row {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.comp-grid > .comp-row:nth-child(2) {
  border-top: none;
}

/* Feature label */
.comp-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px 14px 16px;
  cursor: pointer;
  margin: 0;
}

/* Hidden native checkbox */
.comp-checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Custom checkbox mark */
.comp-checkbox-mark {
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s ease;
  background: rgb(245, 245, 245);
}

.comp-checkbox-mark::after {
  content: "";
  width: 15px;
  height: 15px;
  display: block;
  background: rgba(0, 0, 0, 0.65);
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 6L5 8.5L9.5 3.5' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 6L5 8.5L9.5 3.5' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.comp-checkbox-input:checked ~ .comp-checkbox-mark {
  border-color: rgba(0, 0, 0, 0.45);
}

.comp-checkbox-input:checked ~ .comp-checkbox-mark::after {
  opacity: 1;
  transform: scale(1);
}

/* Feature text */
.comp-feature-text {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(0, 0, 0, 0.4);
  transition: color 0.2s ease;
  line-height: 1.3;
  white-space: nowrap;
}

.comp-checkbox-input:checked ~ .comp-feature-text {
  color: rgba(0, 0, 0, 0.7);
}

/* Dot cells */
.comp-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0;
  transition:
    opacity 0.3s ease,
    filter 0.3s ease;
}

.comp-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: block;
  background: currentColor;
}

/* Dot colors per tool */
.comp-cell[data-tool="origami"] .comp-dot {
  color: #0991ff;
}
.comp-cell[data-tool="protopie"] .comp-dot {
  color: #ff6661;
}
.comp-cell[data-tool="framerx"] .comp-dot {
  color: #1a1a1a;
}
.comp-cell[data-tool="uxpin"] .comp-dot {
  color: #c4c820;
}
.comp-cell[data-tool="invision"] .comp-dot {
  color: #dc395f;
}
.comp-cell[data-tool="axure"] .comp-dot {
  color: #74bb11;
}

/* Faded state for eliminated tools */
.comp-faded {
  opacity: 0.12;
  filter: grayscale(1);
}

/* Hover (pointer devices only) */
@media (hover: hover) {
  .comp-feature:hover .comp-checkbox-mark {
    border-color: rgba(0, 0, 0, 0.35);
  }
}

/* Mobile (max-width: 720px) */
@media screen and (max-width: 720px) {
  .comp-analysis {
    padding: 24px 16px 20px;
  }
  .comp-grid {
    min-width: 600px;
  }

  .comp-feature {
    padding-left: 16px;
  }
}

/* Small Mobile (max-width: 500px) */
@media screen and (max-width: 500px) {
  .comp-tool-header img {
    height: 22px;
  }
  .comp-tool-header span {
    font-size: 10px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .comp-faded,
  .comp-cell,
  .comp-tool-header,
  .comp-checkbox-mark,
  .comp-checkbox-mark::after,
  .comp-feature-text {
    transition-duration: 0.05s;
  }
}
