/* Area sondaggio */
.poll-container {
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    margin-bottom: 22px;
    padding: 22px;
    color: #f5f5f5;
    background:
        radial-gradient(circle at 100% 0, rgba(255, 204, 0, 0.09), transparent 38%),
        linear-gradient(145deg, #202020, #181818);
    border: 1px solid #373737;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.poll-container::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    content: "";
    background: linear-gradient(#ffcc00, #ff8a00);
}

.poll-heading {
    max-width: 760px;
    margin-bottom: 20px;
}

.poll-status,
.poll-modal-kicker,
.feed-poll-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #ffcc00;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 1.25px;
    text-transform: uppercase;
}

.poll-status-dot {
    width: 7px;
    height: 7px;
    background: #ffcc00;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.12);
}

.poll-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 10px 0 5px;
    color: #fff;
    font-size: clamp(19px, 3.5vw, 25px);
    line-height: 1.25;
    letter-spacing: -0.25px;
}

.poll-title-icon {
    flex: 0 0 auto;
    font-size: 20px;
    line-height: 1.35;
}

.poll-author {
    margin: 0;
    color: #929292;
    font-size: 12px;
}

.poll-author strong {
    color: #c7c7c7;
    font-weight: 600;
}

/* Azioni amministratore */
.admin-poll-panel {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 12px;
}

.admin-poll-panel-empty {
    margin-bottom: 16px;
}

.admin-btn-delete,
.admin-btn-open-modal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    min-height: 34px;
    padding: 8px 13px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.15px;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.admin-btn-delete {
    color: #ff9a9a;
    background: rgba(255, 77, 77, 0.08);
    border: 1px solid rgba(255, 77, 77, 0.28);
}

.admin-btn-delete:hover,
.admin-btn-delete:focus-visible {
    color: #fff;
    background: rgba(255, 77, 77, 0.18);
    border-color: rgba(255, 77, 77, 0.58);
    transform: translateY(-1px);
}

.admin-btn-delete > span {
    color: #ff4d4d;
    font-size: 8px;
}

.admin-btn-open-modal {
    color: #181818;
    background: #ffcc00;
    border: 1px solid #ffcc00;
    cursor: pointer;
}

.admin-btn-open-modal:hover,
.admin-btn-open-modal:focus-visible {
    color: #111;
    background: #ffe063;
    border-color: #ffe063;
    transform: translateY(-1px);
}

.admin-btn-open-modal > span {
    font-size: 17px;
    font-weight: 400;
    line-height: 0;
}

/* Form di voto */
.poll-vote-form {
    margin: 0;
}

.poll-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    min-width: 0;
    margin: 0 0 14px;
    padding: 0;
    border: 0;
}

.poll-options legend {
    width: 100%;
    margin-bottom: 9px;
    color: #b6b6b6;
    font-size: 12px;
    font-weight: 600;
}

.poll-option-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    box-sizing: border-box;
    min-height: 48px;
    padding: 11px 13px;
    color: #dedede;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid #393939;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.poll-option-label:hover {
    color: #fff;
    background: rgba(255, 204, 0, 0.055);
    border-color: #6e622a;
    transform: translateY(-1px);
}

.poll-option-label:has(input:checked) {
    color: #fff;
    background: rgba(255, 204, 0, 0.09);
    border-color: #ffcc00;
    box-shadow: 0 0 0 1px rgba(255, 204, 0, 0.12);
}

.poll-option-label input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.poll-radio-mark {
    position: relative;
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    box-sizing: border-box;
    background: #151515;
    border: 2px solid #666;
    border-radius: 50%;
}

.poll-radio-mark::after {
    position: absolute;
    inset: 3px;
    content: "";
    background: #ffcc00;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.3);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.poll-option-label input:checked + .poll-radio-mark {
    border-color: #ffcc00;
}

.poll-option-label input:checked + .poll-radio-mark::after {
    opacity: 1;
    transform: scale(1);
}

.poll-option-label input:focus-visible + .poll-radio-mark {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.poll-option-text {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.3;
}

.poll-btn-vote,
.poll-btn-create {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 11px 15px;
    color: #151515;
    background: linear-gradient(100deg, #ffcc00, #ffb700);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 7px 18px rgba(255, 183, 0, 0.13);
    transition: filter 0.18s ease, transform 0.18s ease;
}

.poll-btn-vote:hover,
.poll-btn-vote:focus-visible,
.poll-btn-create:hover,
.poll-btn-create:focus-visible {
    color: #111;
    background: linear-gradient(100deg, #ffda3d, #ffc52c);
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.poll-privacy-note {
    margin: 9px 0 0;
    color: #737373;
    font-size: 10px;
    text-align: center;
}

/* Risultati del sondaggio attivo */
.poll-container:has(.poll-results) .poll-heading {
    margin-bottom: 14px;
}

.poll-results {
    display: grid;
    gap: 10px;
}

.poll-result-item {
    padding: 0;
}

.poll-result-info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 6px;
    font-size: 12px;
    line-height: 1.3;
}

.poll-result-option {
    color: #e5e5e5;
    overflow-wrap: anywhere;
}

.poll-result-count {
    display: flex;
    flex: 0 0 auto;
    align-items: baseline;
    gap: 6px;
    color: #858585;
    font-size: 10px;
    white-space: nowrap;
}

.poll-result-count strong {
    color: #e5e5e5;
    font-size: 12px;
}

.poll-result-leading-icon {
    margin-right: 6px;
    color: #ffcc00;
}

.poll-bar-bg {
    width: 100%;
    height: 6px;
    overflow: hidden;
    background: #303030;
    border-radius: 999px;
}

.poll-bar-fill {
    height: 100%;
    min-width: 0;
    background: linear-gradient(90deg, #ffb700, #ffe15a);
    border-radius: inherit;
    transition: width 0.5s ease;
}

.poll-footer-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 5px 0 0;
    padding-top: 12px;
    color: #777;
    border-top: 1px solid #303030;
    font-size: 10px;
}

.poll-vote-confirmed {
    color: #66c77a;
    font-weight: 650;
}

.poll-vote-confirmed > span {
    font-weight: 800;
}

.poll-total-participation {
    text-align: right;
}

.poll-total-participation strong {
    color: #aaa;
}

/* Stato vuoto */
.poll-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 64px;
    color: #858585;
    text-align: left;
}

.poll-empty-icon {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #aaa;
    background: #252525;
    border: 1px solid #383838;
    border-radius: 50%;
    filter: grayscale(1);
}

.poll-empty strong,
.poll-empty small {
    display: block;
}

.poll-empty strong {
    margin-bottom: 3px;
    color: #bdbdbd;
    font-size: 13px;
}

.poll-empty small {
    color: #737373;
    font-size: 10px;
}

/* Finestra di creazione */
.poll-modal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 18px;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
}

.poll-create-form {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0;
}

.poll-modal-content {
    position: relative;
    box-sizing: border-box;
    width: min(100%, 520px);
    padding: 27px;
    color: #fff;
    background:
        radial-gradient(circle at 100% 0, rgba(255, 204, 0, 0.1), transparent 38%),
        #1d1d1d;
    border: 1px solid #444;
    border-radius: 13px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    text-align: left;
}

.poll-modal-content h4 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 8px 38px 5px 0;
    color: #fff;
    font-size: 22px;
    line-height: 1.2;
}

.poll-modal-intro {
    max-width: 390px;
    margin: 0 35px 22px 0;
    color: #929292;
    font-size: 12px;
    line-height: 1.45;
}

.poll-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    display: grid;
    width: 32px;
    height: 32px;
    padding: 0;
    place-items: center;
    color: #999;
    background: #282828;
    border: 1px solid #3b3b3b;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
}

.poll-modal-close:hover,
.poll-modal-close:focus-visible {
    color: #fff;
    background: #343434;
    border-color: #555;
}

.poll-form-field {
    display: block;
    margin-bottom: 16px;
}

.poll-form-field > span {
    display: block;
    margin-bottom: 7px;
    color: #d6d6d6;
    font-size: 11px;
    font-weight: 700;
}

.poll-form-field small {
    display: block;
    margin-top: 6px;
    color: #747474;
    font-size: 10px;
}

.poll-input {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 11px 12px;
    color: #fff;
    background: #151515;
    border: 1px solid #444;
    border-radius: 8px;
    outline: none;
    font: inherit;
    font-size: 13px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.poll-input::placeholder {
    color: #626262;
}

.poll-input:focus {
    border-color: #d7ae08;
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.1);
}

/* Post dei risultati nel feed */
.post.post-poll-closed {
    overflow: hidden;
    padding: 0;
    border-color: #3d3825;
}

.post-poll-closed > .post-header {
    padding: 17px 19px 0;
}

.post-poll-closed > .message {
    margin: 11px 0 0;
}

.post-poll-closed > .post-actions,
.post-poll-closed > .post-replies {
    margin-right: 19px;
    margin-left: 19px;
}

.post-poll-closed > .post-actions {
    margin-bottom: 14px;
}

.feed-poll-card {
    padding: 18px 19px;
    background:
        radial-gradient(circle at 100% 0, rgba(255, 204, 0, 0.1), transparent 34%),
        #191919;
    border-top: 1px solid #322f24;
    border-bottom: 1px solid #322f24;
}

.feed-poll-heading {
    margin-bottom: 15px;
}

.feed-poll-status {
    color: #82d390;
}

.feed-poll-status > span {
    display: inline-grid;
    width: 15px;
    height: 15px;
    place-items: center;
    color: #142117;
    background: #82d390;
    border-radius: 50%;
    font-size: 10px;
}

.feed-poll-heading h4 {
    margin: 8px 0 0;
    color: #fff;
    font-size: 17px;
    line-height: 1.3;
}

.feed-poll-results {
    display: grid;
    gap: 11px;
}

.feed-poll-result-info {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 6px;
    color: #d5d5d5;
    font-size: 12px;
    line-height: 1.3;
}

.feed-poll-result-info > span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.feed-poll-result-info > span:last-child {
    flex: 0 0 auto;
    color: #858585;
    font-size: 10px;
    white-space: nowrap;
}

.feed-poll-result-info strong {
    color: #e5e5e5;
    font-size: 12px;
}

.feed-poll-winner-icon {
    margin-right: 6px;
    color: #ffcc00;
}

.feed-poll-bar {
    height: 6px;
    overflow: hidden;
    background: #303030;
    border-radius: 999px;
}

.feed-poll-bar > span {
    display: block;
    height: 100%;
    background: #6a6a6a;
    border-radius: inherit;
}

.feed-poll-result-winner .feed-poll-bar > span {
    background: linear-gradient(90deg, #ffb700, #ffe15a);
}

.feed-poll-total {
    margin: 15px 0 0;
    padding-top: 12px;
    color: #777;
    border-top: 1px solid #303030;
    font-size: 10px;
    text-align: right;
}

.feed-poll-total strong {
    color: #aaa;
}

@keyframes fadeInPoll {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.poll-fade-in {
    animation: fadeInPoll 0.4s ease forwards;
}

@media (max-width: 600px) {
    .poll-container {
        padding: 18px 15px;
        border-radius: 10px;
    }

    .admin-poll-panel {
        justify-content: stretch;
        margin-top: 0;
    }

    .admin-btn-delete,
    .admin-btn-open-modal {
        width: 100%;
    }

    .poll-options {
        grid-template-columns: 1fr;
    }

    .poll-result-info,
    .feed-poll-result-info {
        gap: 9px;
    }

    .poll-footer-text {
        align-items: flex-end;
    }

    .poll-modal-content {
        padding: 23px 18px 20px;
    }

    .poll-modal-content h4 {
        font-size: 20px;
    }

    .post-poll-closed > .post-header {
        padding-right: 15px;
        padding-left: 15px;
    }

    .feed-poll-card {
        padding-right: 15px;
        padding-left: 15px;
    }

    .post-poll-closed > .post-actions,
    .post-poll-closed > .post-replies {
        margin-right: 15px;
        margin-left: 15px;
    }
}
