/* =============================================
   Feedback Widget - Floating Button & Modal
   ============================================= */

/* Base font — match site's global font */
.feedback-floating-btn,
.feedback-modal-panel,
.feedback-admin-grid,
.feedback-admin-filters {
    font-family: "Open Sans", sans-serif;
}

/* Floating Button — pill shape with glow */
.feedback-floating-btn {
    position: fixed;
    bottom: 40px;
    right: 30px;
    height: 48px;
    padding: 0 24px 0 18px;
    border-radius: 24px;
    background: linear-gradient(135deg, #4a8ac4 0%, #3a72a8 50%, #427FB7 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 9999999;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, background 0.3s ease;
    animation: feedback-glow-pulse 2.5s ease-in-out infinite;
    will-change: transform, box-shadow;
    -webkit-font-smoothing: antialiased;
    backface-visibility: hidden;
}

.feedback-floating-btn:hover {
    background: linear-gradient(135deg, #5594ce 0%, #427FB7 50%, #3a72a8 100%);
    box-shadow:
        0 4px 14px rgba(66, 127, 183, 0.45),
        0 0 28px rgba(66, 127, 183, 0.35),
        0 0 50px rgba(66, 127, 183, 0.15);
    transform: translateY(-2px);
}

.feedback-floating-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow:
        0 2px 6px rgba(66, 127, 183, 0.30),
        0 0 16px rgba(66, 127, 183, 0.20);
}

.feedback-floating-btn svg {
    width: 20px;
    height: 20px;
    fill: #fff;
    flex-shrink: 0;
}

.feedback-floating-btn span {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1;
}

/* Dashboard: move button + modal to bottom-left to avoid profile avatar overlap */
.feedback-floating-btn.feedback-btn-left {
    right: auto;
    left: 30px;
}

.feedback-modal-panel.feedback-modal-left {
    right: auto;
    left: 30px;
}

@keyframes feedback-glow-pulse {
    0%, 100% {
        transform: scale3d(1, 1, 1);
        box-shadow:
            0 2px 6px rgba(66, 127, 183, 0.20),
            0 0 8px rgba(66, 127, 183, 0.05);
    }
    50% {
        transform: scale3d(1.03, 1.03, 1);
        box-shadow:
            0 4px 24px rgba(66, 127, 183, 0.70),
            0 0 50px rgba(66, 127, 183, 0.40),
            0 0 80px rgba(66, 127, 183, 0.20);
    }
}

/* Modal Overlay */
.feedback-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 99999999;
}

/* Modal Panel */
.feedback-modal-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    max-height: 620px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 999999999;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

/* Modal Header */
.feedback-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background-color: #427FB7;
    color: #fff;
}

.feedback-modal-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.feedback-modal-subtitle {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 400;
}

.feedback-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.feedback-close-btn:hover {
    opacity: 1;
}

/* Modal Body */
.feedback-modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.feedback-modal-body label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.feedback-modal-body select,
.feedback-modal-body textarea,
.feedback-modal-body input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.feedback-modal-body select:focus,
.feedback-modal-body textarea:focus,
.feedback-modal-body input[type="email"]:focus {
    outline: none;
    border-color: #427FB7;
}

.feedback-modal-body select {
    margin-bottom: 16px;
    appearance: auto;
}

.feedback-modal-body textarea {
    min-height: 100px;
    resize: vertical;
    margin-bottom: 4px;
}

/* Category Toggle Pills */
.feedback-category-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-radius: 6px;
    padding: 2px;
    transition: outline-color 0.2s;
}

.feedback-category-pills.feedback-field-error {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
    border-radius: 8px;
}

.feedback-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-pill:hover {
    border-color: #427FB7;
    color: #427FB7;
    background: #f0f6fc;
}

.feedback-pill.active {
    border-color: #427FB7;
    background: #427FB7;
    color: #fff;
}

.feedback-pill svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Contact Section */
.feedback-contact-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}

.feedback-contact-identity {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.feedback-contact-identity svg {
    fill: #888;
    flex-shrink: 0;
}

.feedback-contact-identity strong {
    color: #333;
}

.feedback-followup-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #444 !important;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.feedback-followup-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #427FB7;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.feedback-followup-label span {
    line-height: 1.3;
}

.feedback-contact-fields {
    margin-top: 10px;
}

.feedback-contact-fields label {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #555 !important;
}

.feedback-char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.feedback-char-count.near-limit {
    color: #dc3545;
}

/* Modal Footer */
.feedback-modal-footer {
    padding: 12px 20px 16px;
    display: flex;
    justify-content: flex-end;
}

.feedback-submit-btn {
    background-color: #427FB7;
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.feedback-submit-btn:hover {
    background-color: #36699a;
}

.feedback-submit-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Success/Error Message */
.feedback-message {
    text-align: center;
    padding: 30px 20px;
}

.feedback-message.success {
    color: #198754;
}

.feedback-message.error {
    color: #dc3545;
}

.feedback-message svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
}

.feedback-message p {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
}

/* Validation Error */
.feedback-field-error {
    border-color: #dc3545 !important;
}

/* =============================================
   Feedback Admin Panel (Site Settings)
   ============================================= */

.feedback-admin-grid {
    width: 100%;
    overflow-x: auto;
}

.feedback-admin-grid table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.feedback-admin-grid table th {
    background-color: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.feedback-admin-grid table td {
    padding: 10px 12px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

.feedback-admin-grid table tr:hover {
    background-color: #f8f9fa;
}

.feedback-admin-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.feedback-admin-filters select,
.feedback-admin-filters input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.feedback-category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.feedback-category-badge.suggestion {
    background-color: #d1ecf1;
    color: #0c5460;
}

.feedback-category-badge.bug-report {
    background-color: #f8d7da;
    color: #721c24;
}

.feedback-category-badge.general-comment {
    background-color: #d4edda;
    color: #155724;
}

.feedback-admin-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 14px;
}

/* =============================================
   Feedback Detail Modal (Admin Grid Row Click)
   ============================================= */

.feedback-detail-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 99999999;
}

.feedback-detail-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 560px;
    max-width: 90%;
    max-height: 80vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 999999999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: "Open Sans", sans-serif;
}

.feedback-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background-color: #427FB7;
    color: #fff;
}

.feedback-detail-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.feedback-detail-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.feedback-detail-close:hover {
    opacity: 1;
}

.feedback-detail-body {
    padding: 20px;
    overflow-y: auto;
}

.feedback-detail-row {
    display: flex;
    margin-bottom: 12px;
}

.feedback-detail-row.feedback-detail-fullwidth {
    flex-direction: column;
}

.feedback-detail-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    min-width: 80px;
    flex-shrink: 0;
}

.feedback-detail-value {
    font-size: 13px;
    color: #333;
    word-break: break-word;
}

.feedback-detail-text {
    font-size: 13px;
    color: #333;
    margin-top: 6px;
    padding: 12px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
}


/* Delete confirmation popup improvements */
.popupwraper.minipopup .popupcontent p {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 20px;
}

.popupwraper.minipopup .popupcontent .text-center {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding-bottom: 10px;
}

.popupwraper.minipopup .popupcontent .dashboardbtn {
    min-width: 80px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    border: none;
}

.popupwraper.minipopup .popupcontent .dashboardbtn.close {
    background-color: #6c757d;
    color: #fff;
    box-shadow: 0px 4px 4px 0px #00000040;
}

.popupwraper.minipopup .popupcontent .dashboardbtn.close:hover {
    background-color: #5a6268;
}

/* Preview icon size */
.feedback-mgmt-wrap .preview-row {
    width: 14px !important;
    height: 14px !important;
    mask-image: url(img/preview.svg);
    -webkit-mask-image: url(img/preview.svg);
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
    mask-size: contain;
    -webkit-mask-size: contain;
    background-color: #000;
    display: block;
    cursor: pointer;
}

/* Constrain active filters dropdown to button width, not full grid */
.feedback-submissions-grid .active-filters-wrap {
    position: relative;
    display: inline-block;
}
