:root {
    --primary-color: #4B2B74;
    --error: #AA2419;
    --error-bg: #FFEDEF;
    --success: #319060;
    --success-bg: #B9E4CA;
    --success-border: #40AD75;
    --error-light-bg: #FFEDEF;
    --error-light: #FE5957;
    --warning-bg: #FFE9B2;
    --warning-color: #E59A2E;
    --body-text: #27272C;
    --btn-bg: #F2B94C;
    --btn-hover: #D28903;
    --btn-active: #F2B94C;
    --white: #fff;
    --primary-color-100: #DCD6E8;
}

main {
    min-height: 100vh;
}

.poll-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.poll-description {
    font-size: 15px;
    color: #777675;
    margin-bottom: 0;
    line-height: 1.7;
}

.poll-question,
.question-card {
    padding: 24px;
    background: #fff;
    border: 1px solid #E0DEE0;
    box-shadow: 0px 4px 24px 0px #0000000D;
    display: grid;
    gap: 24px;
}

.question-card {
    margin-bottom: 32px;
}

.poll-form {
    display: grid;
    gap: 32px;
}

.poll-question h4 {
    color: var(--body-text);
    font-size: 18px;
    padding: 0;
}

.poll-options label,
.question-answers label {
    color: #616161;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.poll-options,
.question-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 44px;
}

input[type="radio"],
input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    box-shadow: none !important;
    border: 1px solid #E0DEE0;
    margin: 0;
}


input[type="radio"]:after,
input[type="checkbox"]:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 7px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -65%) rotate(45deg);
    opacity: 0;
}




input[type="radio"]:checked,
input[type="checkbox"]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}


input[type="radio"]:checked:after,
input[type="checkbox"]:checked:after {
    opacity: 1;
}

.poll-options textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.poll-options textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.demographics-section {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.demographics-section h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
}

.demo-field {
    margin-bottom: 15px;
}

.demo-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
}

.demo-field select,
.demo-field input {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.submit-poll {
    display: inline-block;
    width: auto;
    margin: 0 0 0 auto;
    padding: 21px 36px;
    background: var(--btn-bg);
    text-align: center;
    color: var(--body-text);
    font-size: 16px;
    font-weight: 600;
    vertical-align: middle;
    gap: 8px;
    transition: all 0.2s ease-in-out;
    border: 0;
}

.submit-poll:hover {
    box-shadow: 0px 4px 7px 0px #A9A7A373;
    background: var(--btn-hover);
    color: var(--white);
    cursor: pointer;

}

.submit-poll:active,
.submit-poll:focus,
.submit-poll:focus-visible {
    background: var(--btn-active);

}

button:disabled,
button:disabled:hover {
    background: #ccc;
    color: var(--body-text);
    opacity: 0.6;
    cursor: not-allowed !important;
    box-shadow: none;
    border: 0;
}

.button-completed:disabled,
.button-completed:disabled:hover {
    color: var(--success);
    background: var(--success-bg);
    opacity: 1;
}

/* Results Styles */
.poll-results {
    margin-top: 30px;
}

.results-filters {
    margin-bottom: 30px;
    padding: 25px;
    background: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.results-filters h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.filter-group {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 15px;
    vertical-align: top;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

.poll-filter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    min-width: 150px;
}

.apply-filters {
    padding: 10px 25px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.apply-filters:hover {
    background: #1976D2;
}

.chart-container {
    margin: 20px 0;
    padding: 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-container h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    border-bottom: 2px solid #2196F3;
    padding-bottom: 10px;
}

.bar-chart {
    margin: 20px 0;
}

.bar-item {
    margin-bottom: 20px;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.bar-label span:first-child {
    color: #555;
}

.bar-label span:last-child {
    color: #4CAF50;
    font-size: 16px;
}

.bar-track {
    height: 45px;
    background: #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #45a049 50%, #66BB6A 100%);
    display: flex;
    align-items: center;
    padding: 0 15px;
    color: white;
    font-weight: bold;
    transition: width 0.8s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    position: relative;
}

.bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.bar-fill:hover {
    background: linear-gradient(90deg, #45a049 0%, #3d8b40 50%, #4CAF50 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
}

.text-responses {
    max-height: 400px;
    overflow-y: auto;
}

.text-responses p {
    padding: 12px;
    margin-bottom: 10px;
    background: #f9f9f9;
    border-left: 3px solid #2196F3;
    border-radius: 4px;
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

/* poll design  */
.poll-badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-self: center;
}

.poll-button {
    width: 100%;
    padding: 14px 16px;
    background: #FFFFFF;
    border: 1px solid #E3E3E3;
    text-align: center;
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    line-height: 120%;
    vertical-align: middle;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease-in-out;
    flex-wrap: wrap;
}

.poll-button:hover {
    background: #F7F7F7;
    border: 1px solid #4D4061;
    animation-timing-function: ease-out;
    animation-duration: 300ms;
    transition: all 0.2s ease-in-out;
}

.poll-button:focus,
.poll-button:focus-visible {
    background: #FCF9FF;
    border: 1px solid #4D4061
}

.poll-badge {
      color: #fff;
    background: #14A08F;
    line-height: 120%;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    border-radius: 20px !important;
    padding: 6px 10px;
    gap: 6px;
    justify-content: center;
    margin: 0 3px;
    font-size: 12px;
    line-height: 120%;
    vertical-align: middle;
}

.poll-badge img {
    max-width: 12px;
}

.badge-status.status-open {
    background: var(--success);
}

.badge-type.non-national {
    background: #D6F5F1;
    color: #14A08F;
}

.badge-status.status-upcoming {
    background: #F2B94C;
    color: var(--body-text);
}
.badge-status.status-archived{
    background:#D7D7D7;
    color: #000;
}
.poll-badge.badge-no-votes{
    background: var(--primary-color-100);
    color: var(--primary-color);
}
.poll-badge.badge-votes{
    background: var(--primary-color);
}
/* // Status closed  */
.badge-status.status-past{
    background: #E8E8E8;
    color: #000;
}
/* Responsive Design */
@media (max-width: 768px) {
    .poll-container {
        padding: 20px;
        margin: 10px;
    }

    .filter-group {
        display: block;
        width: 100%;
        margin-right: 0;
    }

    .poll-filter {
        width: 100%;
    }

    .bar-label {
        font-size: 14px;
    }
}

.filter-icon {
    font-size: 18px;
    margin-right: 5px;
}

.filter-group.has-value label {
    color: #2196F3;
    font-weight: 700;
}

.filter-group.has-value label::after {
    content: " •";
    color: #2196F3;
    font-size: 20px;
}

.filter-group.has-value select {
    border-color: #2196F3;
    background-color: #eff6ff;
}

.login-required {
    background: #F8F7FA;
    border: 1px solid #E5E5E5;
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    margin: 40px auto;
    width: 90%;
    font-size: 19px;
    color: var(--body-text);
    box-shadow: 0px 4px 24px 0px #0000000D;
    align-content: center
}

.login-required a {
    color: #4b2b74;
    font-weight: 600;
    text-decoration: none;
}

.login-required a:hover {
    text-decoration: underline;
}


.no-polls-message {
    text-align: center;
    padding: 60px 20px;
    background: #F8F7FA;
    box-shadow: 0px 4px 24px 0px #0000000D;
    border: 1px solid #E5E5E5;
    color: var(--body-text);
    max-width: 100%;
    margin: 60px auto;
    transition: all 0.3s ease;
}

.no-polls-message:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.no-polls-message p {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.6;
    margin: 0;
}

.no-polls-message::before {
    content: "📊";
    display: block;
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.poll-details-header {
    display: flex;
    justify-content: start;
    gap: 10px;
}

.poll-details-header .poll-button {
    width: auto;
    /* border-radius: 5px; */
    /* font-size: 14px; */
    /* padding: 10px; */
}

.select2-container .select2-dropdown, 
.select2-container .select2-selection {
    border-color: #cccccc !important;
}

.poll-details-header .poll-button.back-button {
    width: 48px;
    height: 48px;
    font-size: 16px;
}

.poll-box-wrapper {
    background: #F8F7FA;
    box-shadow: 0px 4px 24px 0px #0000000D;
    border: 1px solid #E5E5E5;
    padding: 40px;
    gap: 18px;
    margin-bottom: 50px;
}

.poll-header-section {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    padding: 60px 20px;
    margin-bottom: 50px;
    border: 0;
    background: transparent;
    box-shadow: none;
    gap: 5px;
    background-image: linear-gradient(60deg, #2C1946 0%, #a949c8 100%) !important;
    position: relative;
}

.poll-header-section .poll-main-title {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-transform: capitalize;
    margin-bottom: 0;
    color: #fff;
    text-align: center;
    font-size: 42px;
}

.poll-header-section .poll-main-title::after {
    content: "";
    background-size: 100% 37px;
    background-image: url("../imgs/section-divider.svg");
    height: 37px;
    width: 160px;
    display: block;
}

.poll-header-section .poll-description {
    color: #66748B;
    font-size: 18px;
    font-weight: 500;
    line-height: 150%;
    margin-bottom: 10px;
    color: #d1d1d1;
    max-width: 80%;
    margin: 0 auto 15px;
    text-align: center;
}

.poll-header-section .poll-meta {
    align-items: center;
    justify-content: center;
}

.poll-header-section .poll-meta .poll-dates {
    display: flex;
    gap: 10px;
}

.poll-header-section .poll-meta .poll-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.poll-header-section .poll-meta .poll-date img {
    width: 14px;
    filter: brightness(0) invert(1);
}

.poll-date-wrapper {
    display: flex;
    /* flex-direction: column; */
    align-items: center;
    gap: 4px;
}

.poll-date-wrapper .date-label {
    font-size: 10px;
    font-weight: 600;
    line-height: normal;
    text-transform: uppercase;
    color: #fff;
}

.poll-date-wrapper .date-value {
    font-size: 14px;
    line-height: 14px;
    color: #d1d1d1;
}


/* .poll-details-page {
    padding: 20px 56px;
} */

.poll-details-page .container {
    width: 100%;
}

.poll-details-page .poll-title {
    font-size: 44px;
    line-height: 120%;
    text-transform: capitalize;
    padding: 0;
}

.poll-details-page .poll-badges {
    justify-self: start;
}

.poll-featured-image {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    mix-blend-mode: multiply;
    /* opacity: .5; */
    height: 100%;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poll-featured-image img {
    width: 100%;
    height: 100%;
    display: block;
    /* max-height: 354px; */
    object-fit: cover;
    object-position: center;
}

.poll-meta-item {
    display: flex;
    gap: 5px;
    font-size: 16px;
}

.poll-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.poll-meta-item img {
    width: 15px;
}

.date-label,
.meta-label {
    color: var(--body-text);
    font-weight: 400;
}

.poll-info-message {
    background: #F8F7FA;
    box-shadow: 0px 4px 7px 0px #0000000D;
    padding: 15px 20px;
    display: flex;
    gap: 15px;
    align-items: normal;
    border-left: 4px solid;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

.poll-info-message.active {
    border-color: var(--success-border);
}

.poll-info-message.active strong,
.poll-info-message.active i {
    color: var(--success);
}

.poll-info-message.past {
    border-color: var(--warning-color);
}

.poll-info-message.past strong,
.poll-info-message.past i {
    color: var(--warning-color);
}

.poll-info-message.archived {
    border-color: #6b7280;
}

.poll-info-message.archived strong,
.poll-info-message.archived i {
    color: #6b7280;
}

.poll-info-message.error {
    border-color: var(--error);
}

.poll-info-message.error strong,
.poll-info-message.error i {
    color: var(--error);
}

.info-icon {
    font-size: 20px;
}

.poll-info-message p {
    margin: 0;
    color: #374151;
    line-height: 1.6;
}

.poll-questions-section>h2 {
    font-size: 24px;
    color: #111827;
    margin-bottom: 20px;
}


.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;

}

.question-type-badge {
    font-size: 11px;
    padding: 4px 12px;
    background: #f3f4f6;
    color: var(--body-text);
    font-weight: 600;
}

.answer-option:not(.selected) input:disabled {
    background: #ccc;
    opacity: 0.5;
}

.answer-option:has(input:disabled) {
    cursor: not-allowed;
}

.question-text {
    color: var(--body-text);
    font-size: 20px;
    font-weight: 600;
    padding: 0;
    margin: 0;
    line-height: 130%;
}


.answer-option.selected {
    border-color: var(--primary-color);
    padding: 5px 20px;
    background: var(--primary-color-100);
}

.answer-option input {
    cursor: not-allowed;
}

.option-text {
    flex: 1;
    color: #374151;
    font-size: 15px;
    font-weight: 500;
}

.selected-indicator {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 13px;
}

.text-answer-display {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.text-answer-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.text-answer-content {
    color: #111827;
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.poll-details-footer {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.poll-details-footer .poll-button {
    width: auto;
    margin-inline-start: auto;
}

/* .button-primary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4);
}

.button-secondary {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.button-secondary:hover {
    background: #f3f4f6;
    border-color: #2196F3;
    color: #2196F3;
} */

.poll-not-found {
    text-align: center;
    background: #f8f4f4;
    border: 1px solid #f8f4f4;
    color: #b91c1c;
    padding: 50px 20px;
    border-radius: 10px;
    margin: 40px auto;
    font-size: 18px;
    font-weight: 500;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
    position: relative;
}

.poll-not-found::before {
    content: "⚠️";
    display: block;
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.85;
}

.poll-not-found:hover {
    background: #f8f4f4;
    border-color: #f8f4f4;
}

/* Overlay (covers entire screen) */
.popup-message {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* dark background overlay */
    z-index: 9999;
    display: flex;
    /* enable flexbox */
    justify-content: center;
    /* center horizontally */
    align-items: center;
    /* center vertically */
}

/* Popup box */
.popup-content {
    background: #fff;
    border-radius: 10px;
    padding: 25px 40px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    animation: popupFadeIn 0.3s ease;
}

/* Text inside popup */
.popup-content p {
    font-size: 16px;
    color: var(--body-text);
    margin-bottom: 20px;
}

/* OK button */
#popupClose {
    background: var(--btn-bg);
    border: none;
    color: var(--body-text);
    padding: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
    width: 100px;
}

#popupClose:hover {
    background: var(--btn-hover);
    color: var(--white);
}

#popupClose:focus,
#popupClose:focus-visible {
    background: var(--btn-active);
}

/* Smooth fade animation */
@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}


.poll-results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.poll-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

.poll-details-container {
    display: grid;
    gap: 40px;
}

.poll-header-content {
    display: grid;
    gap: 5px;
    z-index: 1;
}

.question-results {
    margin-bottom: 40px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

.poll-access-denied {
    text-align: center;
    padding: 40px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
}

@media (max-width:980px) {
    .poll-details-page {
        padding: 20px;
    }

    .question-text {
        font-size: 16px;
    }

    .poll-box-wrapper {
        padding: 20px 10px;
    }

    .poll-details-page .poll-title {
        font-size: 28px;
    }

    .poll-details-container {
        gap: 30px;
    }

    .login-required {
        font-size: 15px;
    }

    .poll-options,
    .question-answers {
        display: flex;
        gap: 20px;
        flex-wrap: wrap;
    }

    .answer-option.selected {
        padding: 5px 10px;
    }

    .poll-badge {
        font-size: 10px;
    }

    .poll-badge img {
        width: 12px;
    }
}

@media (max-width: 768px) {}