/* Theme: primary #C80000, hover #9E0303, text/icons on accent #FFFFFF */
.surveyr-form,
.surveyr-save-modal {
    --wp-components-color-accent: #C80000;
    --wp-admin-theme-color: #C80000;
    --wp-components-color-accent-darker-10: #9E0303;
    --wp-components-color-accent-darker-20: #9E0303;
    --wp-admin-theme-color-darker-10: #9E0303;
    --wp-admin-theme-color-darker-20: #9E0303;
    --wp-components-color-accent-inverted: #FFFFFF;
}

.surveyr-survey-container,
.surveyr-form {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.surveyr-form {
    margin: 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.surveyr-question-block {
    margin-bottom: 25px;
    animation: fadeIn 0.3s ease-in-out;
}

.surveyr-question-label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    font-size: 1.1em;
}

.surveyr-required {
    color: #d32f2f;
    margin-left: 4px;
}

.surveyr-instruction {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
    margin-top: -5px;
}

.surveyr-thank-you {
    text-align: center;
    padding: 50px;
    background: #ffffff;
    border-radius: 8px;
    color: #000000;
    border: 1px solid #000000;
}

.surveyr-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.surveyr-already-submitted {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
    padding: 24px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.surveyr-already-submitted-message {
    margin: 0 0 16px;
    font-size: 1.05em;
    line-height: 1.5;
}

.surveyr-already-submitted .components-button {
    --wp-components-color-accent: #C80000;
    --wp-admin-theme-color: #C80000;
    --wp-components-color-accent-darker-10: #9E0303;
    --wp-components-color-accent-darker-20: #9E0303;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

/* Checkbox group spacing */
.surveyr-checkbox-group .components-checkbox-control {
    margin-bottom: 8px;
}

/* WP component radios/checkboxes default to 13px; match priority ranking labels. */
.surveyr-form .components-base-control,
.surveyr-form .components-radio-control__label,
.surveyr-form .components-checkbox-control__label {
    font-size: inherit;
    line-height: inherit;
}

.surveyr-form .surveyr-select-control .components-select-control__input,
.surveyr-form .components-select-control__input {
    width: 100%;
    max-width: 100%;
    font-size: inherit;
    line-height: inherit;
}

.surveyr-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

/* Multi-screen progress indicator */
.surveyr-progress {
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.surveyr-progress-label {
    font-size: 0.9em;
    color: #555;
    font-weight: 600;
    margin-bottom: 8px;
}

.surveyr-progress-bar {
    width: 100%;
    height: 6px;
    background: #f1f1f1;
    border-radius: 3px;
    overflow: hidden;
}

.surveyr-progress-bar-fill {
    height: 100%;
    background: #C80000;
    transition: width 0.25s ease-in-out;
    border-radius: 3px;
}

.surveyr-form .components-button.is-primary,
.surveyr-form .components-button.is-secondary,
.surveyr-save-modal .components-button.is-primary,
.surveyr-save-modal .components-button.is-secondary {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.surveyr-form .components-button.is-primary:hover:not(:disabled):not([aria-disabled="true"]),
.surveyr-save-modal .components-button.is-primary:hover:not(:disabled):not([aria-disabled="true"]) {
    background: #9E0303;
    border-color: #9E0303;
    color: #FFFFFF;
}

.surveyr-form .components-button.is-secondary:hover:not(:disabled):not([aria-disabled="true"]),
.surveyr-save-modal .components-button.is-secondary:hover:not(:disabled):not([aria-disabled="true"]) {
    background: #9E0303;
    border-color: #9E0303;
    color: #FFFFFF;
    box-shadow: inset 0 0 0 1px #9E0303;
}

.surveyr-save-modal-intro {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
}

.surveyr-save-modal-url-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.surveyr-save-modal-url {
    flex: 1 1 200px;
    display: block;
    padding: 10px 12px;
    background: #f6f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    word-break: break-all;
    margin: 0;
}

.surveyr-rating-scale {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.surveyr-rating-btn {
    min-width: 42px;
    height: 38px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.surveyr-rating-btn.is-selected {
    background: #C80000;
    border-color: #C80000;
    color: #fff;
}

.surveyr-ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.surveyr-ranking-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.surveyr-ranking-col--slots {
    position: sticky;
    /* Clear site sticky/fixed headers; themes can override --surveyr-sticky-offset */
    top: var(--surveyr-sticky-offset, 72px);
    align-self: start;
    z-index: 2;
    background: #fff;
    padding-bottom: 4px;
}

.surveyr-ranking-col-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #667085;
    margin-bottom: 8px;
}

.surveyr-ranking-pool,
.surveyr-ranking-slots {
    min-height: 3rem;
    padding: 8px;
    border-radius: 8px;
    border: 1px dashed #dcdcde;
    background: #fafafa;
}

.surveyr-ranking-pool.is-drop-target,
.surveyr-ranking-slot.is-drop-target {
    border-color: #C80000;
    background: rgba(200, 0, 0, 0.06);
}

.surveyr-ranking-pool-empty {
    list-style: none;
    padding: 12px;
    color: #667085;
    font-size: 13px;
    text-align: center;
}

.surveyr-ranking-slot {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #fff;
    padding: 10px 12px;
    min-height: 3rem;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.12s ease, opacity 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.surveyr-ranking-slot.is-empty {
    border-style: dashed;
    background: #fff;
    color: #98a2b3;
    cursor: default;
    box-shadow: none;
}

.surveyr-ranking-slot-placeholder {
    flex: 1;
    font-size: 13px;
}

.surveyr-ranking-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #fff;
    padding: 10px 12px;
    cursor: grab;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.12s ease, opacity 0.12s ease, border-color 0.12s ease;
}

.surveyr-ranking-item:active {
    cursor: grabbing;
}

/* Keep drag source visible (opacity only). Collapsing to height:0 mid-drag
   cancels HTML5 cross-column drops in several browsers. */
.surveyr-ranking-item.is-dragging-source,
.surveyr-ranking-slot.is-dragging-source {
    opacity: 0.35;
}

/* Legacy single-list collapse class (kept for safety) */
.surveyr-ranking-item.is-dragging,
.surveyr-ranking-slot.is-dragging {
    opacity: 0.35;
}

/* Chimpr-style drop gap (dashed primary + soft fill) */
.surveyr-ranking-placeholder {
    list-style: none;
    border: 2px dashed #C80000;
    background: rgba(200, 0, 0, 0.08);
    border-radius: 8px;
    min-height: 3rem;
    box-sizing: border-box;
}

/* Lifted helper look while the browser drag ghost is active */
.surveyr-ranking-item.is-drag-helper {
    opacity: 0.9;
    box-shadow: 0 4px 14px rgba(16, 24, 40, 0.12);
    border-color: #c3c4c7;
}

.surveyr-ranking-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fff;
    color: #667085;
    font-size: 16px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -1px;
    cursor: grab;
    user-select: none;
}

.surveyr-ranking-item:hover .surveyr-ranking-handle {
    color: #101828;
    border-color: #c3c4c7;
    background: #f6f7f7;
}

.surveyr-ranking-item:active .surveyr-ranking-handle {
    cursor: grabbing;
}

.surveyr-ranking-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 4px;
    border-radius: 4px;
    background: #f0f0f1;
    color: #1d2327;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
    flex-shrink: 0;
}

.surveyr-ranking-label {
    flex: 1;
    min-width: 0;
    font-size: inherit;
    line-height: inherit;
}

@media (max-width: 640px) {
    .surveyr-ranking-columns {
        grid-template-columns: 1fr;
    }

    .surveyr-ranking-col--slots {
        top: calc(var(--surveyr-sticky-offset, 72px) + 20px);
        padding-top: 8px;
    }
}

/* Login gate */
.surveyr-login-required {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
    padding: 28px 24px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.surveyr-login-required-message {
    margin: 0 0 16px;
    font-size: 1.05em;
    line-height: 1.5;
}

.surveyr-login-button {
    display: inline-block;
    padding: 10px 18px;
    background: #C80000;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 600;
    border: none;
}

.surveyr-login-button:hover,
.surveyr-login-button:focus {
    background: #9E0303;
    color: #fff !important;
}

/* Public results shortcode */
.surveyr-results-container,
.surveyr-results {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.surveyr-results {
    margin: 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.surveyr-results-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.surveyr-results-title {
    margin: 0 0 6px;
    font-size: 1.35em;
}

.surveyr-results-total,
.surveyr-results-question-total,
.surveyr-results-average,
.surveyr-results-empty {
    margin: 0;
    color: #50575e;
    font-size: 0.95em;
}

.surveyr-results-question {
    margin-bottom: 28px;
}

.surveyr-results-question-label {
    margin: 0 0 12px;
    font-size: 1.1em;
}

.surveyr-results-bars {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.surveyr-results-bar-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 0.95em;
}

.surveyr-results-bar-label {
    font-weight: 600;
    color: #1d2327;
}

.surveyr-results-bar-count {
    color: #50575e;
    white-space: nowrap;
}

.surveyr-results-bar-track {
    height: 12px;
    background: #f0f0f1;
    border-radius: 999px;
    overflow: hidden;
}

.surveyr-results-bar-fill {
    height: 100%;
    background: #C80000;
    border-radius: 999px;
    min-width: 0;
    transition: width 0.3s ease;
}

.surveyr-results-error {
    color: #b32d2e;
}