/*
 * ForumX R49 — Poll Modern List Ultra Compact
 * Concept 3 production implementation, ultra-compact pass.
 * This is the only stylesheet that owns the .fx-poll component.
 */

.fx-poll {
  --fx-poll-accent: #3f8cff;
  --fx-poll-accent-strong: #5a9cff;
  --fx-poll-text: #eef4fc;
  --fx-poll-muted: #92a6c0;
  --fx-poll-line: rgba(122, 151, 188, .16);
  --fx-poll-row: rgba(14, 26, 41, .50);
  --fx-poll-track: rgba(99, 123, 153, .28);

  margin: 0 0 10px;
  border: 1px solid rgba(76, 119, 170, .28);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(14, 29, 46, .82), rgba(8, 18, 30, .74));
  box-shadow: none;
  overflow: hidden;
}

/* Header: icon + Anket + question on one visual line, metadata on right. */
.fx-poll-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 10px;
  padding: 7px 10px 6px;
  border-bottom: 0;
}

.fx-poll-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px 8px;
}

.fx-poll-title > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: #9db1ca;
  font-size: .68rem;
  line-height: 1.2;
  font-weight: 650;
  white-space: nowrap;
}

.fx-poll-title > span .forumx-icon {
  width: 14px;
  height: 14px;
  color: var(--fx-poll-accent-strong);
  stroke-width: 1.8;
}

.fx-poll-title > strong {
  min-width: 0;
  color: var(--fx-poll-text);
  font-size: .86rem;
  line-height: 1.25;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.fx-poll-head > small {
  color: var(--fx-poll-muted);
  font-size: .67rem;
  line-height: 1.25;
  font-weight: 560;
  white-space: nowrap;
}

/* One clean list row per option. No extra nested visual boxes. */
.fx-poll-options {
  display: grid;
  gap: 0;
  padding: 0 10px 7px;
}

.fx-poll-option {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 44px;
  padding: 6px 8px 8px;
  border: 0;
  border-top: 1px solid rgba(123, 151, 185, .11);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  cursor: pointer;
  transition: background-color .16s ease;
}

.fx-poll-option:hover {
  background: rgba(17, 31, 49, .30);
}

.fx-poll-option.is-selected {
  background: rgba(20, 44, 73, .28);
}

.fx-poll-option:first-child {
  border-top: 1px solid rgba(123, 151, 185, .11);
}

.fx-poll-option > input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1.6px solid #607994;
  border-radius: 50% !important;
  background: rgba(7, 16, 27, .22);
  box-shadow: none;
  outline: 0;
  cursor: inherit;
}

.fx-poll-option > input[type="checkbox"] {
  border-radius: 5px !important;
}

.fx-poll-option > input:checked {
  border-color: var(--fx-poll-accent);
  background: var(--fx-poll-accent);
  box-shadow: inset 0 0 0 4px #10233a;
}

.fx-poll-option > input[type="checkbox"]:checked {
  box-shadow: inset 0 0 0 4px #10233a;
}

.fx-poll-option > input:focus-visible {
  outline: 2px solid rgba(90, 156, 255, .40);
  outline-offset: 3px;
}

.fx-poll-option > input:disabled {
  opacity: .78;
  cursor: default;
}

.fx-poll-option-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  padding: 0 0 7px;
}

.fx-poll-option-main > strong {
  min-width: 0;
  color: #edf3fb;
  font-size: .81rem;
  line-height: 1.3;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.fx-poll-option-main > small {
  grid-column: 2;
  color: #91a8c4;
  font-size: .70rem;
  line-height: 1.2;
  font-weight: 620;
  white-space: nowrap;
}

.fx-poll-option.is-selected .fx-poll-option-main > small {
  color: #74adff;
}

/* Thin result line, aligned under option text rather than under the radio. */
.fx-poll-bar {
  position: absolute;
  left: 36px;
  right: 8px;
  bottom: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--fx-poll-track);
  overflow: hidden;
}

.fx-poll-bar > i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--fx-poll-accent);
  transform-origin: left center;
  transform: scaleX(var(--fx-poll-ratio));
}

/* Footer mirrors the Concept 3 mockup: total left, small outline action right. */
.fx-poll-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px 7px;
  border-top: 1px solid rgba(123, 151, 185, .13);
  color: #91a5bd;
  font-size: .72rem;
  line-height: 1.3;
}

.fx-poll-foot-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.fx-poll-closed {
  color: #b79198;
  font-weight: 650;
}

.fx-poll-foot .button {
  width: auto;
  min-width: 0;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid rgba(71, 145, 255, .82);
  border-radius: 6px;
  background: rgba(20, 42, 68, .24);
  color: #e8f2ff;
  box-shadow: none;
  font-size: .71rem;
  line-height: 1;
  font-weight: 720;
}

.fx-poll-foot .button .forumx-icon {
  width: 12px;
  height: 12px;
  color: #69a8ff;
  flex: 0 0 auto;
}

.fx-poll-foot .button:hover,
.fx-poll-foot .button:focus-visible {
  border-color: #63a5ff;
  background: rgba(46, 112, 205, .18);
  color: #fff;
}

/* Tablet/mobile: preserve the mockup hierarchy while preventing collisions. */
@media (max-width: 760px) {
  .fx-poll {
    border-radius: 9px;
  }

  .fx-poll-head {
    padding: 7px 9px 6px;
    gap: 5px 9px;
  }

  .fx-poll-title {
    gap: 5px 8px;
  }

  .fx-poll-options {
    gap: 0;
    padding: 0 9px 7px;
  }

  .fx-poll-option {
    grid-template-columns: 18px minmax(0, 1fr);
    min-height: 42px;
    gap: 14px;
    padding: 6px 7px 8px;
  }

  .fx-poll-option > input {
    width: 15px;
    height: 15px;
  }

  .fx-poll-bar {
    left: 34px;
    right: 7px;
    bottom: 7px;
  }

  .fx-poll-foot {
    padding: 7px 9px 7px;
  }
}

@media (max-width: 520px) {
  .fx-poll-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 6px;
  }

  .fx-poll-head > small {
    padding-left: 28px;
    white-space: normal;
  }

  .fx-poll-title {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 5px 9px;
  }

  .fx-poll-title > span {
    font-size: .69rem;
  }

  .fx-poll-title > strong {
    font-size: .84rem;
  }

  .fx-poll-option {
    min-height: 40px;
  }

  .fx-poll-option-main {
    gap: 4px 6px;
  }

  .fx-poll-option-main > strong {
    font-size: .79rem;
  }

  .fx-poll-option-main > small {
    font-size: .66rem;
  }
}

@media (max-width: 380px) {
  .fx-poll-options {
    padding-inline: 8px;
  }

  .fx-poll-option {
    padding-inline: 6px;
  }

  .fx-poll-bar {
    right: 6px;
  }

  .fx-poll-foot {
    padding-inline: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fx-poll-option,
  .fx-poll-foot .button {
    transition: none;
  }
}
