/* ============================================================
   FEEDBACK-MODAL.CSS — Premium Healthcare Patient Feedback Modal
   Dr. Sk. Sarfaraz Ahmed — Family Physician, Naturopath & Nutrition Specialist
   ============================================================ */

/* ── Floating "Give Feedback" Trigger Button ────────────── */

.floating-feedback-btn {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 998;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #2F3A2F 0%, #3C4D38 60%, #2A3828 100%);
    color: #FFFFFF;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 13px 22px;
    border-radius: 50px;
    border: 1.5px solid rgba(124, 154, 114, 0.45);
    box-shadow: 0 10px 30px rgba(26, 36, 26, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.floating-feedback-btn:hover {
    background: linear-gradient(135deg, #384936 0%, #4D6845 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 16px 36px rgba(109, 138, 99, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    border-color: #7C9A72;
    color: #FFFFFF;
}

.floating-feedback-btn:active {
    transform: translateY(0) scale(0.98);
}

.floating-feedback-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(124, 154, 114, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.floating-feedback-icon svg {
    width: 15px;
    height: 15px;
    stroke: #7C9A72;
    fill: none;
    transition: stroke 0.3s ease;
}

.floating-feedback-btn:hover .floating-feedback-icon svg {
    stroke: #FFFFFF;
}

.floating-feedback-pulse {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 8px;
    height: 8px;
    background-color: #7C9A72;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #2F3A2F;
    animation: feedback-pulse-anim 2s infinite;
}

@keyframes feedback-pulse-anim {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(124, 154, 114, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(124, 154, 114, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(124, 154, 114, 0); }
}

/* ── Modal Backdrop ──────────────────────────────────────── */

.feedback-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(18, 25, 18, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.feedback-modal-backdrop.active {
    display: flex;
    opacity: 1;
}

/* ── Modal Window Container ──────────────────────────────── */

.feedback-modal-card {
    background: #FFFFFF;
    border-radius: 28px;
    width: 100%;
    max-width: 780px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(109, 138, 99, 0.12);
    position: relative;
    overflow: hidden;
    transform: translateY(28px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.feedback-modal-backdrop.active .feedback-modal-card {
    transform: translateY(0) scale(1);
}

/* ── Modal Header ────────────────────────────────────────── */

.feedback-modal-header {
    background: linear-gradient(135deg, #2F3A2F 0%, #3B4B38 60%, #263324 100%);
    padding: 28px 36px 26px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.feedback-modal-header::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -40px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(124, 154, 114, 0.22) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.feedback-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7C9A72;
    background: rgba(124, 154, 114, 0.16);
    padding: 5px 14px;
    border-radius: 30px;
    border: 1px solid rgba(124, 154, 114, 0.3);
    margin-bottom: 10px;
}

.feedback-header-badge-dot {
    width: 6px;
    height: 6px;
    background-color: #7C9A72;
    border-radius: 50%;
}

.feedback-modal-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.8rem, 2.6vw, 2.3rem);
    font-weight: 600;
    color: #FFFFFF;
    line-height: 1.2;
    margin-bottom: 6px;
}

.feedback-modal-title em {
    color: #7C9A72;
    font-style: italic;
}

.feedback-modal-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    color: rgba(221, 230, 213, 0.85);
    line-height: 1.5;
    max-width: 620px;
    margin: 0;
}

.feedback-modal-close-btn {
    position: absolute;
    top: 22px;
    right: 24px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 1.1rem;
    line-height: 1;
    z-index: 5;
}

.feedback-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08) rotate(90deg);
}

/* ── Modal Scrollable Body ───────────────────────────────── */

.feedback-modal-body {
    padding: 32px 36px 36px;
    overflow-y: auto;
    flex-grow: 1;
    background-color: #FAF9F6;
}

/* Custom Scrollbar */
.feedback-modal-body::-webkit-scrollbar {
    width: 6px;
}
.feedback-modal-body::-webkit-scrollbar-track {
    background: #F1EFEA;
}
.feedback-modal-body::-webkit-scrollbar-thumb {
    background: #C6D4C2;
    border-radius: 10px;
}
.feedback-modal-body::-webkit-scrollbar-thumb:hover {
    background: #6D8A63;
}

/* ── Form Section Grouping ───────────────────────────────── */

.feedback-section-block {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 24px 26px;
    border: 1px solid rgba(109, 138, 99, 0.14);
    box-shadow: 0 4px 18px rgba(47, 58, 47, 0.04);
    margin-bottom: 24px;
    transition: border-color 0.25s ease;
}

.feedback-section-block:focus-within {
    border-color: rgba(109, 138, 99, 0.35);
}

.feedback-block-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(109, 138, 99, 0.1);
}

.feedback-block-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #EFF5ED;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6D8A63;
    flex-shrink: 0;
}

.feedback-block-icon svg {
    width: 17px;
    height: 17px;
    stroke: #6D8A63;
    fill: none;
}

.feedback-block-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: #2F3A2F;
    margin: 0;
}

/* Form Fields Grid */
.feedback-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 14px;
}

.feedback-form-grid-3 {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 1.2fr;
    gap: 16px;
    margin-bottom: 14px;
}

.feedback-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.feedback-form-group:last-child {
    margin-bottom: 0;
}

.feedback-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    color: #2F3A2F;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.feedback-label-req {
    color: #C25454;
    font-size: 0.85rem;
}

.feedback-label-opt {
    font-size: 0.74rem;
    font-weight: 400;
    color: #8A9A8A;
    margin-left: 4px;
}

/* Inputs & Selects */
.feedback-input,
.feedback-select,
.feedback-textarea {
    width: 100%;
    background-color: #F8F7F2;
    border: 1.5px solid #E1DCD3;
    border-radius: 12px;
    padding: 11px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    color: #2F3A2F;
    outline: none;
    box-sizing: border-box;
    transition: all 0.25s ease;
}

.feedback-input::placeholder,
.feedback-textarea::placeholder {
    color: #9BAA97;
}

.feedback-input:focus,
.feedback-select:focus,
.feedback-textarea:focus {
    background-color: #FFFFFF;
    border-color: #6D8A63;
    box-shadow: 0 0 0 3.5px rgba(109, 138, 99, 0.14);
}

.feedback-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236D8A63' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.feedback-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.55;
}

/* ── Interactive Star Rating ─────────────────────────────── */

.feedback-rating-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #F8F7F2;
    padding: 14px 20px;
    border-radius: 14px;
    border: 1.5px solid #E1DCD3;
}

.feedback-stars-container {
    display: flex;
    gap: 6px;
    direction: ltr;
}

.feedback-star-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: #D3DCD0;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.feedback-star-btn:hover,
.feedback-star-btn.hovered,
.feedback-star-btn.selected {
    color: #E8B84B;
    transform: scale(1.15);
}

.feedback-rating-caption {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.86rem;
    font-weight: 600;
    color: #6D8A63;
}

/* ── Treatment Outcome Radio Cards ───────────────────────── */

.feedback-outcome-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.feedback-outcome-label {
    position: relative;
    cursor: pointer;
    margin: 0;
}

.feedback-outcome-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.feedback-outcome-card {
    background: #F8F7F2;
    border: 1.5px solid #E1DCD3;
    border-radius: 14px;
    padding: 12px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    min-height: 78px;
    box-sizing: border-box;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.feedback-outcome-emoji {
    font-size: 1.25rem;
    line-height: 1;
}

.feedback-outcome-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #4A584A;
    line-height: 1.3;
}

.feedback-outcome-label input[type="radio"]:checked + .feedback-outcome-card {
    background: #F0F6EE;
    border-color: #6D8A63;
    box-shadow: 0 6px 16px rgba(109, 138, 99, 0.2);
    transform: translateY(-2px);
}

.feedback-outcome-label input[type="radio"]:checked + .feedback-outcome-card .feedback-outcome-text {
    color: #2F3A2F;
    font-weight: 700;
}

/* Sub-optimal border tone */
.feedback-outcome-label.suboptimal input[type="radio"]:checked + .feedback-outcome-card {
    background: #FCF4F2;
    border-color: #C26F54;
    box-shadow: 0 6px 16px rgba(194, 111, 84, 0.18);
}
.feedback-outcome-label.suboptimal input[type="radio"]:checked + .feedback-outcome-card .feedback-outcome-text {
    color: #7A3520;
}

/* ── Dynamic Conditional Containers ──────────────────────── */

.feedback-conditional-box {
    display: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed rgba(109, 138, 99, 0.2);
}

.feedback-conditional-box.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.feedback-conditional-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6D8A63;
    background: #EFF5ED;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.feedback-conditional-tag.alert {
    color: #B54D31;
    background: #FDF1ED;
}

/* ── Confirmation Checkbox ───────────────────────────────── */

.feedback-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    margin: 8px 0 20px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.86rem;
    color: #4A584A;
    line-height: 1.5;
    user-select: none;
}

.feedback-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    accent-color: #6D8A63;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Submit Action Row ───────────────────────────────────── */

.feedback-submit-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #6D8A63;
    color: #FFFFFF;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 15px 32px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 10px 25px rgba(109, 138, 99, 0.3);
}

.feedback-submit-btn:hover {
    background: #4D6845;
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(109, 138, 99, 0.4);
}

.feedback-submit-btn:active {
    transform: translateY(0);
}

.feedback-submit-btn svg {
    transition: transform 0.25s ease;
}

.feedback-submit-btn:hover svg {
    transform: translateX(4px);
}

.feedback-privacy-note {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.74rem;
    color: #8A9A8A;
    text-align: center;
    margin-top: 12px;
    margin-bottom: 0;
}

/* ── Success State Screen Inside Modal ───────────────────── */

.feedback-success-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 30px;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.feedback-success-screen.active {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

.feedback-success-icon-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #DDE6D5 0%, #C4D6B9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    box-shadow: 0 12px 30px rgba(109, 138, 99, 0.25);
    animation: feedback-success-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes feedback-success-pop {
    0% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.feedback-success-icon-wrap svg {
    width: 42px;
    height: 42px;
    stroke: #4D6845;
    stroke-width: 2.5;
}

.feedback-success-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.2rem;
    font-weight: 600;
    color: #2F3A2F;
    line-height: 1.2;
    margin-bottom: 10px;
}

.feedback-success-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.02rem;
    color: #5A6B5A;
    max-width: 480px;
    line-height: 1.6;
    margin-bottom: 28px;
}

.feedback-success-summary-box {
    background: #F1F6EE;
    border: 1px solid rgba(109, 138, 99, 0.2);
    border-radius: 16px;
    padding: 16px 24px;
    margin-bottom: 28px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: #2F3A2F;
    display: flex;
    align-items: center;
    gap: 12px;
}

.feedback-success-close-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2F3A2F;
    color: #FFFFFF;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.feedback-success-close-btn:hover {
    background: #4D6845;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(47, 58, 47, 0.25);
}

/* ── Responsive Media Queries ────────────────────────────── */

@media (max-width: 767px) {
    .floating-feedback-btn {
        bottom: 20px;
        left: 16px;
        padding: 10px 16px;
        font-size: 0.82rem;
        gap: 8px;
    }

    .floating-feedback-icon {
        width: 24px;
        height: 24px;
    }

    .floating-feedback-icon svg {
        width: 13px;
        height: 13px;
    }

    .feedback-modal-header {
        padding: 22px 20px 18px;
    }

    .feedback-modal-title {
        font-size: 1.65rem;
    }

    .feedback-modal-body {
        padding: 20px 16px 24px;
    }

    .feedback-section-block {
        padding: 18px 16px;
        border-radius: 16px;
    }

    .feedback-form-grid-2,
    .feedback-form-grid-3 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .feedback-outcome-options {
        grid-template-columns: 1fr 1fr;
    }

    .feedback-rating-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
    }
}
