/* Command Directives & Rules – Applies To visual polish patch */

/* Main board */
.directive-applies-board,
.directive-scope-board,
.applies-to-board {
  border: 1px solid rgba(120, 148, 255, 0.22);
  border-radius: 16px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(18, 28, 66, 0.88), rgba(10, 15, 40, 0.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 14px 32px rgba(0,0,0,0.18);
}

.directive-applies-intro,
.directive-scope-intro,
.applies-to-intro {
  color: #c7d7ff;
  font-size: 13px;
  margin: 0 0 12px 0;
}

/* Group rows */
.directive-scope-group,
.applies-to-group {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: stretch;
  margin: 10px 0;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.015);
}

.directive-scope-group:nth-of-type(1),
.applies-to-group:nth-of-type(1) {
  background: linear-gradient(90deg, rgba(73,117,255,0.20), rgba(73,117,255,0.04));
  border-color: rgba(89,129,255,0.38);
}

.directive-scope-group:nth-of-type(2),
.applies-to-group:nth-of-type(2) {
  background: linear-gradient(90deg, rgba(58,171,123,0.18), rgba(58,171,123,0.04));
  border-color: rgba(80,196,143,0.32);
}

.directive-scope-group:nth-of-type(3),
.applies-to-group:nth-of-type(3) {
  background: linear-gradient(90deg, rgba(235,170,58,0.18), rgba(235,170,58,0.04));
  border-color: rgba(235,170,58,0.28);
}

.directive-scope-group:nth-of-type(4),
.applies-to-group:nth-of-type(4) {
  background: linear-gradient(90deg, rgba(164,108,255,0.18), rgba(164,108,255,0.04));
  border-color: rgba(164,108,255,0.32);
}

.directive-scope-group:nth-of-type(5),
.applies-to-group:nth-of-type(5) {
  background: linear-gradient(90deg, rgba(255,85,137,0.16), rgba(255,85,137,0.04));
  border-color: rgba(255,85,137,0.30);
}

.directive-scope-group-label,
.applies-to-group-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
  color: #d7e3ff;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  min-height: 44px;
}

.directive-scope-group-options,
.applies-to-group-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

/* Option cards */
.directive-scope-option,
.applies-to-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.11);
  background: linear-gradient(180deg, rgba(20,27,54,0.98), rgba(13,18,40,0.98));
  color: #eef3ff;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease, background .12s ease;
  cursor: pointer;
}

.directive-scope-option:hover,
.applies-to-option:hover {
  transform: translateY(-1px);
  border-color: rgba(116, 154, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(116,154,255,0.16), 0 10px 18px rgba(0,0,0,0.14);
}

.directive-scope-option input[type="checkbox"],
.applies-to-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #70a0ff;
  margin: 0;
  flex: 0 0 auto;
}

.directive-scope-option span,
.applies-to-option span,
.directive-scope-option strong,
.applies-to-option strong {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}

.directive-scope-option.is-selected,
.applies-to-option.is-selected,
.directive-scope-option:has(input:checked),
.applies-to-option:has(input:checked) {
  border-color: rgba(120, 160, 255, 0.72);
  background: linear-gradient(180deg, rgba(54,88,182,0.82), rgba(28,44,103,0.92));
  box-shadow: 0 0 0 1px rgba(100,144,255,0.22), 0 12px 20px rgba(0,0,0,0.18);
}

/* Special color emphasis by row */
.directive-scope-group:nth-of-type(1) .directive-scope-option:has(input:checked),
.applies-to-group:nth-of-type(1) .applies-to-option:has(input:checked) {
  background: linear-gradient(180deg, rgba(73,117,255,0.92), rgba(39,65,164,0.95));
}
.directive-scope-group:nth-of-type(2) .directive-scope-option:has(input:checked),
.applies-to-group:nth-of-type(2) .applies-to-option:has(input:checked) {
  background: linear-gradient(180deg, rgba(44,160,112,0.90), rgba(29,105,77,0.95));
}
.directive-scope-group:nth-of-type(3) .directive-scope-option:has(input:checked),
.applies-to-group:nth-of-type(3) .applies-to-option:has(input:checked) {
  background: linear-gradient(180deg, rgba(223,153,40,0.92), rgba(140,92,19,0.96));
}
.directive-scope-group:nth-of-type(4) .directive-scope-option:has(input:checked),
.applies-to-group:nth-of-type(4) .applies-to-option:has(input:checked) {
  background: linear-gradient(180deg, rgba(140,92,255,0.92), rgba(79,45,166,0.96));
}
.directive-scope-group:nth-of-type(5) .directive-scope-option:has(input:checked),
.applies-to-group:nth-of-type(5) .applies-to-option:has(input:checked) {
  background: linear-gradient(180deg, rgba(224,68,116,0.92), rgba(136,30,65,0.96));
}

/* Responsive */
@media (max-width: 980px) {
  .directive-scope-group,
  .applies-to-group {
    grid-template-columns: 1fr;
  }

  .directive-scope-group-options,
  .applies-to-group-options {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (max-width: 640px) {
  .directive-scope-group-options,
  .applies-to-group-options {
    grid-template-columns: 1fr;
  }
}
