/* ==========================================================================
   Survey components shared stylesheet
   Compiled from resources/views/components/survey.blade.php
   and resources/views/components/general-survey.blade.php
   (previously duplicated ~900 lines inline in both components)

   Include this ONCE in the layout <head>, e.g.:
     <link href="{{ asset('css/survey-shared.css') }}" rel="stylesheet">
   and remove the inline <style> blocks from both Blade components.
   ========================================================================== */

:root {
    --orange: #ff4800;
    --navy: #282669;
    --white: #ffffff;
    --light-bg: #f4f4fd;
    --border: #e2e8f0;
    --text-gray: #64748b;
}

/* ---- Floating trigger buttons ---- */
.survey-icon-btn,
.general-survey-icon-btn {
    position: fixed;
    bottom: 1rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    border: none;
    animation: survey-bounce 2.5s infinite;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.survey-icon-btn {
    right: 1rem;
    background: var(--orange);
    box-shadow: 0 4px 12px rgba(255, 72, 0, 0.4);
}

.general-survey-icon-btn {
    right: 4.5rem;
    background: var(--navy);
    box-shadow: 0 4px 12px rgba(40, 38, 105, 0.15);
    animation-duration: 3s;
}

.survey-icon-btn:hover,
.general-survey-icon-btn:hover {
    transform: scale(1.1);
    animation: none;
}

.survey-icon-btn:hover { box-shadow: 0 6px 20px rgba(255, 72, 0, 0.55); }
.general-survey-icon-btn:hover { box-shadow: 0 6px 20px rgba(40, 38, 105, 0.35); }

.survey-icon-btn svg,
.general-survey-icon-btn svg {
    width: 15px;
    height: 20px;
}

@keyframes survey-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

.survey-pulse,
.general-survey-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: survey-pulse 2s infinite;
}

.survey-pulse { background: rgba(255, 72, 0, 0.35); }
.general-survey-pulse { background: rgba(40, 38, 105, 0.35); }

@keyframes survey-pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ---- Modal sizing + backdrop ---- */
#surveyModal .modal-dialog {
    max-width: 80vw;
    width: 80vw;
    margin: 5vh auto;
}

@media (max-width: 991px) {
    #surveyModal .modal-dialog {
        max-width: 95vw;
        width: 95vw;
        margin: 3vh auto;
    }
}

.modal-backdrop.show {
    opacity: 1;
    background-color: rgba(40, 38, 105, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

#surveyModal .modal-content {
    border-radius: 16px;
    border: none;
    max-height: 88vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(40, 38, 105, 0.35);
}

#surveyModal .modal-body {
    display: flex;
    height: 90vh;
    min-height: 70vh;
}

/* ---- Left image / brand panel ---- */
.survey-image-section {
    flex: 0 0 40%;
    background: linear-gradient(135deg, var(--navy) 0%, #3d3a94 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.survey-image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.08);
}

.survey-image-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--white);
    padding: 10px;
}

.survey-image-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 30px;
}

.survey-image-title {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 15px;
}

.survey-image-desc {
    font-size: 14px;
    opacity: 0.9;
    max-width: 95%;
    margin: 0 auto;
}

/* ---- Right content panel ---- */
.survey-content-section {
    flex: 1;
    padding: 50px 50px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
    position: relative;
}

.btn-close-survey {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
    cursor: pointer;
}

.btn-close-survey:hover .close-modal-btn { opacity: 0.8; }

.close-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    border-radius: 50px;
    width: 30px;
    height: 30px;
    color: var(--navy);
    font-size: 20px;
    transition: opacity 0.2s ease;
}

/* ---- Loading / message state ---- */
.survey-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 0;
}

.survey-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: survey-spin 0.8s linear infinite;
}

@keyframes survey-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.survey-loading-text {
    margin-top: 20px;
    color: var(--text-gray);
}

.survey-message-text {
    text-align: center;
    color: var(--text-gray);
}

.survey-message-text.is-error { color: #dc3545; }

/* ---- Question content ---- */
.survey-question-item { display: none; }
.survey-question-item.active { display: block; }

.survey-question-eyebrow {
    color: var(--text-gray);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.survey-question-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 30px;
    line-height: 1.4;
}

.survey-question-title .required-mark {
    color: var(--orange);
    margin-left: 5px;
}

/* ---- Textarea ---- */
.survey-textarea {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    font-size: 14px;
    line-height: 1.7;
    min-height: 180px;
    resize: vertical;
    width: 100%;
    margin-top: 6px;
}

.survey-textarea:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(40, 38, 105, 0.15);
}

/* ---- Radio / checkbox options ---- */
.survey-option-hint {
    color: var(--text-gray);
    font-size: 14px;
    font-style: italic;
    margin-bottom: 14px;
}

.survey-option {
    cursor: pointer;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.survey-option input { display: none; }

.survey-radio-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.survey-radio-dot-inner {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--white);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.survey-checkbox-box {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.survey-checkbox-box svg {
    width: 13px;
    height: 13px;
    stroke: var(--white);
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.survey-option:hover .survey-radio-dot,
.survey-option:hover .survey-checkbox-box {
    border-color: var(--navy);
}

.survey-option input:checked ~ .survey-radio-dot {
    border-color: var(--navy);
    background: var(--navy);
}

.survey-option input:checked ~ .survey-radio-dot .survey-radio-dot-inner {
    opacity: 1;
}

.survey-option input:checked ~ .survey-checkbox-box {
    border-color: var(--navy);
    background: var(--navy);
}

.survey-option input:checked ~ .survey-checkbox-box svg {
    opacity: 1;
}

.survey-option-btn {
    flex: 1;
    background: var(--white);
    color: var(--navy);
    border: 1px solid var(--border);
    padding: 12px 24px;
    font-size: 14px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.survey-option input:checked ~ .survey-option-btn {
    background: var(--navy) !important;
    color: var(--white) !important;
    border-color: var(--navy) !important;
}

.survey-option:hover .survey-option-btn {
    background: var(--light-bg);
    border-color: var(--navy);
}

/* ---- Star rating (backed by the "bar" question type) ---- */
.survey-star-wrap { padding: 20px 0; }

.survey-star-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.survey-star-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.survey-star-btn:hover { transform: scale(1.12); }
.survey-star-btn:active { transform: scale(0.95); }

.survey-star-icon {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: var(--border);
    stroke-width: 1.5;
    transition: fill 0.15s ease, stroke 0.15s ease;
}

.survey-star-btn:hover .survey-star-icon:not(.is-filled) {
    stroke: var(--navy);
}

.survey-star-icon.is-filled {
    fill: var(--orange);
    stroke: var(--orange);
}

.survey-star-count-wrap { margin-top: 14px; }

.survey-star-count {
    display: inline-block;
    background: var(--light-bg);
    color: var(--navy);
    font-weight: 600;
    font-size: 16px;
    padding: 6px 18px;
    border-radius: 8px;
}

/* ---- Footer ---- */
.survey-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
}

.survey-btn {
    padding: 10px 28px;
    font-size: 14px;
    border-radius: 8px;
    font-weight: 500;
    border: none;
}

.survey-btn-outline {
    background: var(--white);
    color: var(--navy);
    border: 1px solid var(--border);
}

.survey-btn-outline:hover { background: var(--light-bg); }

.survey-btn-primary {
    background: var(--navy);
    color: var(--white);
}

.survey-btn-primary:hover { background: #201f56; color: var(--white); }

.survey-btn-submit {
    background: var(--orange);
    color: var(--white);
}

.survey-btn-submit:hover { background: #e04100; color: var(--white); }

.survey-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---- Toast ---- */
.survey-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    color: var(--white);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    max-width: 350px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    #surveyModal .modal-body {
        flex-direction: column !important;
        height: auto !important;
    }

    .survey-image-section {
        min-height: 200px;
        display: none !important;
    }

    .survey-content-section {
        padding: 40px 30px !important;
    }
}
