/* poll-results.css */

/* .poll-results-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 15px;
}

@media (min-width: 980px) {
    .poll-results-wrapper {
        max-width: 100%;
    }
}

@media (min-width: 1200px) {
    .poll-results-wrapper {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .poll-results-wrapper {
        max-width: 1330px;
    }
} */

: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;
}

.poll-results-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    border-radius: 12px;
}

.poll-header-image {
    max-width: 200px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.poll-main-title {
    /* font-size: 2.5em; */
    margin: 0 0 15px 0;
    font-weight: 700;
}

.poll-description {
    font-size: 1.1em;
    opacity: 0.95;
    margin-bottom: 20px;
}

.poll-meta-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    font-size: 0.95em;
}

.poll-type-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
}

/* Filter Panel */
.poll-filter-panel {
    /* background: white; */
    /* padding: 30px; */
    /* border-radius: 12px; */
    /* box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); */
    margin-bottom: 40px;
}

.filter-panel-header h2 {
    /* font-size: 1.8em; */
    margin: 0 0 10px 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-panel-header h2 .dashicons {
    padding: 10px;
    background-color: #f2b94c;
    display: flex;
    color: #fff;
    width: auto;
    height: auto;
    border-radius: 50%;
}

.filter-description {
    margin-bottom: 25px;

    color: #989898;
    font-style: italic;
    line-height: 120%;
    font-size: 12px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.filter-description::before {
    content: url("../imgs/check-protect-icon.svg");
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
}

.poll-filter {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.poll-filter:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Group By Section - Separated Style */
.group-by-section {
    margin-bottom: 25px;
    background: linear-gradient(180deg, #FFFFFF 0%, #FCF9FF 100%);
    border: 1px solid #e0dee0;
    box-shadow: 2px 2px 8px 0px #0000000A;
    padding: 16px;
}

.group-by-section label {
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
    color: var(--body-text);
    font-weight: 700;
}

.group-by-select {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    font-size: 15px;
    background: white;
}

.group-by-select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

.group-by-hint {
    margin-top: 10px;
    color: #989898;
    font-style: italic;

    line-height: 120%;
    font-size: 12px;
}

/* Filter Actions */
.filter-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-action-buttons .btn {
    flex: 1 0 auto;
}

.btn.export-csv-btn,
.btn.export-pdf-btn {
    font-size: 24px;
    padding: 15px 18px;
    flex: 0 0 auto;
    line-height: 120%;
    border-radius: 50%;
}

/* .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
} */

/* Active Filters */
.active-filters-display {
    background: #F8F7FA;
    box-shadow: 0px 4px 7px 0px #0000000D;
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    border-left: 4px solid;
    border-radius: 5px;
    margin-bottom: 20px;
    border-color: var(--warning-color);
}

.active-filters-display strong {
    padding-top: 6px;
}

.active-filters-list {
    /* margin-top: 10px; */
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.filter-tag {
    background: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    border: 1px solid #ffc107;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.filter-tag-group {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1565c0;
}

.filter-tag-regular {
    background: white;
    border-color: #ffc107;
}

/* Question Results */
.question-result-block {
    padding: 20px;
    background: linear-gradient(180deg, #FFFFFF 0%, #FCF9FF 100%);
    border: 1px solid #e0dee0;
    box-shadow: 2px 2px 8px 0px #0000000A;
    gap: 20px;
    transition: all 0.2s ease-in-out;
    /* border-radius: 10px; */
    margin-bottom: 20px;
}

.question-title {
    /* font-size: 1.8em; */
    margin: 0 0 15px 0;
    color: var(--body-text);
    /* font-weight: 600; */
}

/* Participation Summary */
.participation-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    /* padding: 20px; */
    background: #f8f9fa;
    border-radius: 8px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    /* font-size: 1.1em; */
}

.summary-item.total {
    flex-basis: 100%;
    /* font-size: 1.3em; */
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.summary-item .emoji {
    font-size: 1.3em;
}

.summary-item .count {
    color: var(--primary-color);
    font-weight: 700;
}

/* Chart with Horizontal Scroll */
.chart-scroll-wrapper {
    position: relative;
    margin: 30px 0;
}

.chart-container-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    padding: 20px 0;
}

/* .chart-container-scroll canvas {
    min-height: 400px;
} */

.scroll-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 50%;
    font-size: 1.5em;
    z-index: 10;
    pointer-events: none;
    animation: pulse 2s infinite;
}

.scroll-indicator.left {
    left: 10px;
}

.scroll-indicator.right {
    right: 10px;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Chart Legend */
.chart-legend {
    display: flex;
    justify-content: center;
    /* gap: 30px; */
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 6px;
    transition: background 0.3s;
}

.legend-item:hover {
    background: white;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #333;
}

.legend-label {
    font-weight: 600;
    font-size: 1em;
}

/* Responsive */
@media (max-width: 768px) {
    .poll-main-title {
        font-size: 1.8em;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    /* .filter-action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    } */

    .participation-summary {
        flex-direction: column;
    }

    .chart-legend {
        flex-direction: column;
        align-items: flex-start;
    }
}

.poll-filter-groups {
    flex-wrap: wrap;
    gap: 30px;
}

/* Each group box */
.poll-filter-group {
    background: linear-gradient(180deg, #FFFFFF 0%, #FCF9FF 100%);
    border: 1px solid #e0dee0;
    box-shadow: 2px 2px 8px 0px #0000000A;

    gap: 20px;
    transition: all 0.2s ease-in-out;
    /* border-radius: 10px; */
    margin-bottom: 20px;
}

/* Section titles */
.filter-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 120%;
    text-transform: capitalize;
    vertical-align: middle;
    /* border-bottom: 1px solid #E0DEE0; */
    padding-bottom: 0px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: var(--body-text);
    padding: 16px;
}

.filter-title::after {
    font-size: 20px;
    color: var(--body-text);
    font-family: ETmodules;
    font-weight: 400;
    content: "\4c";
}

.poll-filter-group.opend .filter-title::after {
    content: "K" !important;
}

.filter-content {
    display: none;
    padding: 16px;
    margin-top: 0px;
    border-top: 1px solid #E0DEE0;
}

/* Layout: horizontal filters within each group */
.poll-filter-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Each field box */
.poll-filter-field {
    flex: 1 1 calc(25% - 10px);
    /* two filters per row */
    min-width: 250px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 10px 12px;
    box-sizing: border-box;
}

/* Label styling */
.poll-filter-field label.poll-field-label {
    display: block;
    color: #333;
    margin-bottom: 5px;
}

/* Inputs and selects */
.poll-filter-field select,
.poll-filter-field input[type="text"],
.poll-filter-field input[type="radio"] {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.poll-filter-field input[type="radio"] {
    min-width: 16px;
}

.poll-filter-field .select2-container .select2-dropdown,
.poll-filter-field .select2-container .select2-selection {
    border: 1px solid #ccc;
}

/* Radio buttons inline */
.poll-radio-option {
    margin-right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Responsive stacking for small screens */
@media (max-width: 768px) {
    .poll-filter-field {
        flex: 1 1 100%;
    }
}


.poll-featured-image {
    display: flex;
    justify-content: center;
    /* centers horizontally */
    align-items: center;
    /* centers vertically (optional) */
}

.poll-header-image {
    max-width: 100%;
    height: auto;
    display: block;
}

.poll-main-title {
    text-align: center;
}

.poll-description {
    text-align: center;

}

/* ============================================
   Questions Count Section - Standalone Styles
   ============================================ */

.questions-count-section {
    margin: 0px 0 20px;
}

.questions-count-section .count-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.questions-count-section .count-icon {
    font-size: 20px;
    /* animation: bounce 2s infinite; */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.questions-count-section .count-text {
    color: #989898;
    font-size: 12px;
    font-weight: 400;
    font-style: italic;
}

.questions-count-section .count-text strong {
    font-weight: 700;
    color: var(--body-text);
}

/* .questions-count-section .count-text strong:hover {
    transform: scale(1.1);
} */


/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Alternative Style Variants */

/* Variant 1: Minimal Style */
.questions-count-section.minimal {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-left: 5px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.questions-count-section.minimal .count-text {
    color: #334155;
}

.questions-count-section.minimal .count-text strong {
    color: #667eea;
    text-shadow: none;
    background: rgba(102, 126, 234, 0.1);
}

.questions-count-section.minimal .filtered-count {
    color: #059669 !important;
    background: rgba(5, 150, 105, 0.1) !important;
}

.questions-count-section.minimal .total-count {
    color: #d97706 !important;
    background: rgba(217, 119, 6, 0.1) !important;
}

/* Variant 2: Dark Style */
.questions-count-section.dark {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.questions-count-section.dark .count-text {
    color: #e2e8f0;
}

.questions-count-section.dark .count-text strong {
    color: #60a5fa;
}

/* Variant 3: Success Style (when all questions shown) */
.questions-count-section.all-shown {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* Variant 4: Warning Style (when filtered) */
.questions-count-section.filtered {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.questions-count-section.filtered .count-icon {
    animation: shake 0.5s ease;
}

@keyframes shake {

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

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Print Styles */
@media print {
    .questions-count-section {
        background: #ffffff !important;
        border: 2px solid #000000;
        box-shadow: none;
        page-break-inside: avoid;
    }

    .questions-count-section .count-text {
        color: #000000 !important;
    }

    .questions-count-section .count-text strong {
        color: #000000 !important;
        text-shadow: none;
        background: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .questions-count-section {
        background: linear-gradient(135deg, #4c51bf 0%, #553c9a 100%);
        box-shadow: 0 4px 15px rgba(76, 81, 191, 0.4);
    }

    .questions-count-section.minimal {
        background: #1e293b;
        border-color: #334155;
        border-left-color: #818cf8;
    }

    .questions-count-section.minimal .count-text {
        color: #e2e8f0;
    }
}

/* Accessibility Enhancements */
.questions-count-section:focus-within {
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .questions-count-section {
        border: 3px solid #000000;
    }

    .questions-count-section .count-text strong {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .questions-count-section,
    .questions-count-section .count-icon,
    .questions-count-section .count-text strong {
        animation: none;
        transition: none;
    }

    .questions-count-section:hover {
        transform: none;
    }
}

/* New View Result Style */

.poll-result-view-row {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.poll-result-view-wrapper .container {
    width: 100%;
}

.poll-result-view-wrapper .poll-header-section,
.poll-result-view-wrapper .poll-filter-panel,
.poll-result-view-wrapper .poll-results-content-right {
    width: 100%;
}

@media (min-width: 980px) {
    .poll-result-view-row {
        flex-wrap: nowrap;
    }
    .poll-result-view-wrapper .poll-filter-panel {
        width: 30%;
    }

    .poll-result-view-wrapper .poll-results-content-right {
        width: 70%;
    }
}

.radios-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}