/* ShionImporter — Feedback survey modal styles (PRD 7.5).
 *
 * The modal is rendered as a self-contained light surface in every theme,
 * so it stays readable when the dashboard is in dark mode (the project's
 * `[data-theme-version="dark"] .modal-content` rule would otherwise paint
 * the body dark while inner controls stay light, killing contrast).
 */

.shion-survey-modal .modal-dialog {
    max-width: 640px;
}

.shion-survey-modal .modal-content,
[data-theme-version="dark"] .shion-survey-modal .modal-content {
    background: #ffffff;
    color: #1f2937;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.45);
    overflow: hidden;
}

.shion-survey-modal .modal-header,
[data-theme-version="dark"] .shion-survey-modal .modal-header {
    background: #ffffff;
    border-bottom: 1px solid #eef0f4;
    padding: 1.1rem 1.5rem;
}

.shion-survey-modal .modal-title,
[data-theme-version="dark"] .shion-survey-modal .modal-title {
    color: #0f172a !important;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.shion-survey-modal .modal-header .close {
    color: #6b7280;
    text-shadow: none;
    opacity: 0.75;
}

.shion-survey-modal .modal-header .close:hover {
    opacity: 1;
    color: #1f2937;
}

.shion-survey-modal .modal-body {
    background: #ffffff;
    color: #1f2937;
    padding: 1.25rem 1.5rem 0.5rem;
}

/* Force light text colors regardless of theme tokens leaking in. */
.shion-survey-modal .modal-body,
.shion-survey-modal .modal-body > p,
.shion-survey-modal .modal-body > form,
.shion-survey-modal .modal-body label,
[data-theme-version="dark"] .shion-survey-modal .modal-body,
[data-theme-version="dark"] .shion-survey-modal .modal-body > p,
[data-theme-version="dark"] .shion-survey-modal .modal-body > form,
[data-theme-version="dark"] .shion-survey-modal .modal-body label {
    color: #1f2937 !important;
}

/* Spans/strong inside the survey body inherit from their parent label/pill,
 * so the selected-state colors on options/NPS still take effect. */
.shion-survey-modal .modal-body .survey-option-radio span,
.shion-survey-modal .modal-body .survey-option-checkbox span,
.shion-survey-modal .modal-body .survey-nps-cell span {
    color: inherit;
}

.shion-survey-modal .modal-body .text-muted,
.shion-survey-modal .modal-body .form-text,
.shion-survey-modal .survey-counter {
    color: #6b7280 !important;
}

.shion-survey-modal .survey-q {
    margin-bottom: 1.5rem;
}

.shion-survey-modal .survey-q > label {
    margin-bottom: 0.6rem;
    display: block;
    color: #1f2937;
    font-size: 0.95rem;
    font-weight: 500;
}

.shion-survey-modal .survey-q > label .text-danger {
    color: #dc3545 !important;
}

/* ---- choice pills (Q1 / Q2) ---- */
.shion-survey-modal .survey-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.shion-survey-modal .survey-options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 0.6rem;
}

.shion-survey-modal .survey-option-radio,
.shion-survey-modal .survey-option-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid #e1e5eb;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #334155;
    margin: 0;
    background: #ffffff;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.shion-survey-modal .survey-option-radio:hover,
.shion-survey-modal .survey-option-checkbox:hover {
    background: #f1f5ff;
    border-color: #b8c8f0;
    color: #1f2937;
}

.shion-survey-modal .survey-option-radio input,
.shion-survey-modal .survey-option-checkbox input {
    accent-color: #2563eb;
    margin: 0;
    width: 14px;
    height: 14px;
}

.shion-survey-modal .survey-option-radio:has(input:checked),
.shion-survey-modal .survey-option-checkbox:has(input:checked) {
    background: #eef4ff;
    border-color: #2563eb;
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px #2563eb;
}

/* ---- NPS scale (Q5) ---- */
.shion-survey-modal .survey-nps {
    display: grid;
    grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: 0.3rem;
}

.shion-survey-modal .survey-nps-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.5rem 0;
    border: 1px solid #e1e5eb;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #475569;
    margin: 0;
    background: #ffffff;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.shion-survey-modal .survey-nps-cell:hover {
    background: #f1f5ff;
    border-color: #b8c8f0;
    color: #1d4ed8;
}

.shion-survey-modal .survey-nps-cell input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}

.shion-survey-modal .survey-nps-cell:has(input:checked) {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 10px -4px rgba(37, 99, 235, 0.6);
}

/* ---- text inputs ---- */
.shion-survey-modal textarea.form-control,
.shion-survey-modal input.form-control {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #dfe3eb;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.shion-survey-modal textarea.form-control::placeholder,
.shion-survey-modal input.form-control::placeholder {
    color: #9ca3af;
}

.shion-survey-modal textarea.form-control:focus,
.shion-survey-modal input.form-control:focus {
    background: #ffffff;
    color: #1f2937;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.shion-survey-modal .survey-counter {
    text-align: right;
    margin-top: 0.25rem;
}

.shion-survey-modal .survey-q.is-invalid > label {
    color: #dc3545;
}

.shion-survey-modal .survey-q2-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.4rem;
}

/* ---- footer + buttons ---- */
.shion-survey-modal .survey-footer,
[data-theme-version="dark"] .shion-survey-modal .survey-footer {
    background: #fafbfd;
    border-top: 1px solid #eef0f4;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.shion-survey-modal .survey-btn {
    border-radius: 8px;
    padding: 0.55rem 1.3rem;
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
    border: 1px solid transparent;
    line-height: 1.3;
}

.shion-survey-modal .survey-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.shion-survey-modal .survey-btn:active {
    transform: translateY(1px);
}

.shion-survey-modal .survey-btn-ghost {
    background: transparent;
    color: #475569;
    border-color: #d8dde6;
}

.shion-survey-modal .survey-btn-ghost:hover {
    background: #eef1f6;
    color: #1f2937;
    border-color: #c7cdd9;
}

.shion-survey-modal .survey-btn-primary {
    background: linear-gradient(180deg, #2f6bff 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 6px 16px -8px rgba(29, 78, 216, 0.7);
}

.shion-survey-modal .survey-btn-primary:hover {
    background: linear-gradient(180deg, #3a76ff 0%, #1e57e8 100%);
    color: #ffffff;
    box-shadow: 0 8px 20px -8px rgba(29, 78, 216, 0.85);
}

.shion-survey-modal .survey-btn-primary[disabled],
.shion-survey-modal .survey-btn-primary:disabled {
    background: #93b1f0;
    box-shadow: none;
    cursor: not-allowed;
}

/* ---- positive-review reward screen ---- */
.shion-survey-modal .survey-review-title,
[data-theme-version="dark"] .shion-survey-modal .survey-review-title {
    color: #0f172a !important;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.shion-survey-modal .survey-review-icon {
    min-width: 120px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    margin-bottom: 1rem;
    border-radius: 999px;
    background: #fff7ed;
    color: #f59e0b;
    font-size: 1.35rem;
    box-shadow: inset 0 0 0 1px #fed7aa;
}

.shion-survey-modal .survey-review-credit {
    max-width: 480px;
    margin: 1rem auto 0;
    padding: 0.9rem 1rem;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e3a8a;
    text-align: left;
}

.shion-survey-modal .survey-review-credit strong,
[data-theme-version="dark"] .shion-survey-modal .survey-review-credit strong {
    display: block;
    color: #1d4ed8 !important;
    margin-bottom: 0.25rem;
}

.shion-survey-modal .survey-review-credit span,
[data-theme-version="dark"] .shion-survey-modal .survey-review-credit span {
    display: block;
    color: #1e40af !important;
    line-height: 1.45;
}

@media (max-width: 576px) {
    .shion-survey-modal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .shion-survey-modal .modal-header,
    .shion-survey-modal .modal-body,
    .shion-survey-modal .survey-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .shion-survey-modal .survey-options-grid {
        grid-template-columns: 1fr;
    }

    .shion-survey-modal .survey-nps {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .shion-survey-modal .survey-footer {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    .shion-survey-modal .survey-btn {
        width: 100%;
    }
}
