/* General Reset & Font */
.waf-popup, .waf-modal-content {
    font-family: -apple-system, BlinkMwafystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* Feedback Launcher (FAB) */
#waf-feedback-launcher.waf-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, #6B47DC, #5A4FCF);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999999;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    font-size: 28px;
}
#waf-feedback-launcher.waf-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(90, 79, 207, 0.2);
}

.waf-fab--disabled {
    background: #9ca3af !important; /* Gray-400 */
    cursor: not-allowed !important;
}

.waf-fab--disabled:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.waf-fab--disabled {
    background: #9ca3af; /* Gray-400 */
    cursor: not-allowed !important;
}

.waf-fab--disabled:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Pin Cursor */
body.waf-feedback-mode {
    cursor: url('https://s.w.org/images/core/emoji/16.0.1/svg/1f4cc.svg') 8 31, auto;
}

/* Revert cursor for feedback UI elements */
body.waf-feedback-mode #waf-feedback-launcher,
body.waf-feedback-mode .waf-modal-content,
body.waf-feedback-mode .waf-pin-popup {
    cursor: default;
}

/* Ensure interactive elements within the UI have the correct pointer */
body.waf-feedback-mode #waf-feedback-launcher,
body.waf-feedback-mode .waf-pin,
body.waf-feedback-mode button,
body.waf-feedback-mode a,
body.waf-feedback-mode input[type="checkbox"] {
    cursor: pointer;
}

body.waf-feedback-mode [contenteditable="true"],
body.waf-feedback-mode input[type="text"],
body.waf-feedback-mode input[type="email"] {
    cursor: text;
}

/* Modal & Popup Base */
.waf-modal {
    position: fixed;
    inset: 0;
    background: rgba(25, 25, 25, 0.6);
    backdrop-filter: blur(5px);
    z-index: 999998;
    display: none;
    align-items: center;
    justify-content: center;
    animation: waf-fade-in 0.3s ease;
}
.waf-modal-content, .waf-pin-popup {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid #e5e7eb;
    animation: waf-scale-up 0.3s ease;
}
.waf-modal-content {
    width: 380px;
    max-width: 92vw;
    padding: 24px;
}
.waf-pin-popup {
    position: fixed;
    width: 360px;
    max-width: 92vw;
    padding: 16px;
    z-index: 2147483647;
}

@keyframes waf-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes waf-scale-up {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Header */
.waf-popup__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}
.waf-popup__title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    cursor: move;
}
.waf-modal-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 16px;
    color: #333;
    cursor: move;
}

/* Pins */
.waf-pin-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999997;
}
.waf-pin {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffc107;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: #333;
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.waf-pin:hover {
    transform: scale(1.1);
}
.waf-pin.completed {
    background: #20c997;
    color: #fff;
}

/* Forms & Inputs */
label {
    font-weight: 500;
    font-size: 13px;
    color: #444;
    display: block;
    margin-bottom: 6px;
}
input[type="text"], input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input[type="text"]:focus, input[type="email"]:focus, .waf-editor:focus {
    border-color: #5A4FCF;
    box-shadow: 0 0 0 3px rgba(90, 79, 207, 0.15);
    outline: none;
}
.waf-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}
.waf-actions .primary {
    background: linear-gradient(45deg, #6B47DC, #5A4FCF);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s ease;
}
.waf-actions .primary:hover {
    opacity: 0.9;
}
.waf-actions .primary:disabled {
    background: #a0a0a0;
    cursor: not-allowed;
    opacity: 0.7;
}
#waf_cancel {
    background: #f1f1f1;
    color: #333;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
#waf_cancel:hover {
    background: #e7e7e7;
}

/* WYSIWYG Editor */
.waf-wysiwyg, .waf-reply-wysiwyg {
    margin-top: 12px;
}
.waf-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: #f8f9fa;
}
.waf-toolbar button {
    border: 1px solid transparent;
    background: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
}
.waf-toolbar button:hover {
    background: #e9ecef;
}
.waf-editor {
    min-height: 120px;
    padding: 12px;
    outline: none;
    border: 1px solid #e5e7eb;
    border-radius: 0 0 8px 8px;
}

/* Replies & Attachments */
.waf-popup__body {
    border: none;
    padding: 0;
    background: none;
    max-height: 160px;
    overflow: auto;
    margin-bottom: 12px;
    font-size: 14px;
}
.waf-assigned-to {
    font-size: 12px;
    color: #555;
    margin-bottom: 10px;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 6px;
}
.waf-replies-list {
    max-height: 180px;
    overflow: auto;
    margin-bottom: 12px;
}
.waf-reply {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.waf-reply:last-child { border-bottom: none; }
.waf-reply .author { font-weight: 600; font-size: 13px; }
.waf-reply .author .date { font-weight: 400; color: #6c757d; margin-left: 8px; }
.waf-reply .content { font-size: 14px; margin-top: 4px; }

.waf-attachment-area { margin-top: 12px; }
.waf-staged-attachments .staged-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    background-color: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    margin-top: 6px;
    font-size: 13px;
}
.remove-staged-file {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.remove-staged-file svg {
    width: 18px;
    height: 18px;
    fill: #888;
    transition: fill 0.2s ease;
}
.remove-staged-file:hover svg {
    fill: #dc3545;
}