/* Overlay container */
#feedback-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: visible; /* Allow comments to be positioned anywhere on the page */
}

/* Fixed instructions banner */
#feedback-instructions {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #0073aa;
    color: white;
    padding: 12px 20px;
    text-align: center;
    z-index: 99990;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Push body content down - only when feedback mode is active */
body.feedback-mode {
    padding-top: 48px !important;
    overflow-x: hidden; /* Prevent horizontal scroll */
    max-width: 100vw; /* Ensure body doesn't exceed viewport width */
}
/* Place banner below the WordPress admin bar if present */
body.admin-bar #feedback-instructions {
    top: 32px;
}
@media (max-width: 782px) {
    body.admin-bar #feedback-instructions {
        top: 46px;
    }
}
/* Increase body offset when admin bar is present so content is not overlapped */
body.feedback-mode.admin-bar {
    padding-top: 80px !important; /* 48 banner + 32 admin bar */
}
@media (max-width: 782px) {
    body.feedback-mode.admin-bar {
        padding-top: 94px !important; /* 48 banner + 46 admin bar */
    }
}

/* Selection box while dragging */
.feedback-selection-box {
    position: absolute;
    pointer-events: none;
    z-index: 9999;
    /* Border, background, and shadow set dynamically via JS */
}

/* Permanent feedback comment boxes */
.feedback-comment {
    position: absolute;
    pointer-events: auto;
    z-index: 9999;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    max-width: 100vw; /* Ensure comments don't exceed viewport width */
    max-height: 100vh; /* Ensure comments don't exceed viewport height */
    /* Border and background set dynamically via JS */
}

.feedback-comment:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Active state when clicked */
.feedback-comment.active {
    filter: brightness(1.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Comment content inside the box - hidden by default */
.feedback-comment-content {
    background: white;
    border-radius: 4px;
    padding: 8px 10px;
    max-width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Show content on hover or when active */
.feedback-comment:hover .feedback-comment-content,
.feedback-comment.active .feedback-comment-content {
    opacity: 1;
    pointer-events: auto;
}

.feedback-comment-content p {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    word-wrap: break-word;
}

.feedback-comment-actions {
    display: flex;
    gap: 2px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.feedback-comment-content .feedback-delete,
.feedback-comment-content .feedback-resolve {
    padding: 2px 6px !important;
    border: none !important;
    border-radius: 2px !important;
    font-size: 9px !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    font-family: inherit !important;
}

.feedback-comment-content .feedback-delete {
    background: #E74C3C !important;
    color: white !important;
}

.feedback-comment-content .feedback-delete:hover {
    background: #C0392B !important;
}

.feedback-comment-content .feedback-resolve {
    background: #27AE60 !important;
    color: white !important;
}

.feedback-comment-content .feedback-resolve:hover {
    background: #229954 !important;
}

/* Individual classes for annotation buttons to avoid theme conflicts */
.mmm-annotation-delete,
.mmm-annotation-resolve {
    padding: 2px 6px !important;
    border: none !important;
    border-radius: 2px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    font-family: inherit !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    line-height: 1 !important;
    background: transparent !important;
    color: inherit !important;
}

.mmm-annotation-delete {
    background: #E74C3C !important;
    color: white !important;
}

.mmm-annotation-delete:hover {
    background: #C0392B !important;
    color: white !important;
}

.mmm-annotation-resolve {
    background: #27AE60 !important;
    color: white !important;
}

.mmm-annotation-resolve:hover {
    background: #229954 !important;
    color: white !important;
}

.mmm-annotation-reopen {
    background: #f39c12 !important;
    color: white !important;
}

.mmm-annotation-reopen:hover {
    background: #e67e22 !important;
    color: white !important;
}

/* Remove old bubble styles - not needed anymore */
.feedback-bubble {
    display: none;
}

/* Simple popup modal for entering feedback - positioned next to selection */
.feedback-modal {
    position: absolute;
    background: white;
    border: 2px solid #4A90E2;
    border-radius: 12px;
    padding: 0;
    min-width: 320px;
    max-width: 350px;
    width: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    pointer-events: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.feedback-modal-content {
    padding: 16px 12px;
}

.feedback-modal-content h3 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.feedback-modal-content textarea {
    width: 100%;
    padding: 12px 8px;
    margin-bottom: 16px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    min-height: 100px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.feedback-modal-content textarea:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.feedback-modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.feedback-modal-buttons button {
    padding: 12px 8px !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-family: inherit !important;
    flex: 0 0 auto !important;
    min-width: 80px !important;
    white-space: nowrap !important;
    height: auto !important;
}

.feedback-submit {
    background: #4A90E2 !important;
    color: white !important;
}

.feedback-submit:hover {
    background: #357ABD !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3) !important;
}

.feedback-cancel {
    background: #F5F5F5 !important;
    color: #666 !important;
    border: 1px solid #E0E0E0 !important;
}

.feedback-cancel:hover {
    background: #E8E8E8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Prevent text selection and image dragging while selecting */
body.feedback-selecting {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

body.feedback-selecting * {
    pointer-events: none !important;
}

body.feedback-selecting #feedback-overlay {
    pointer-events: auto !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .feedback-bubble {
        width: 250px;
    }
    
    .feedback-modal {
        min-width: 300px;
        max-width: 90vw;
    }
    
    .feedback-modal-content {
        padding: 16px 12px;
    }
    
    .feedback-modal-buttons {
        gap: 4px;
        justify-content: center;
    }
    
    .feedback-modal-buttons button {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 55px;
    }
}

/* Ensure Settings button text stays red in all states */
#feedback-settings-btn {
	color: #e60023 !important;
}

#feedback-settings-btn:hover,
#feedback-settings-btn:focus,
#feedback-settings-btn:active {
	color: #e60023 !important;
}

/* Prevent document from having excessive height */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Ensure feedback mode doesn't cause layout issues */
body.feedback-mode {
    position: relative;
    min-height: 100vh;
}

/* After Release button styling */
.mmm-ds-pa-btn-warning {
    background-color: #f39c12 !important;
    border-color: #e67e22 !important;
    color: white !important;
}

.mmm-ds-pa-btn-warning:hover {
    background-color: #e67e22 !important;
    border-color: #d35400 !important;
    color: white !important;
}

/* After Release button styling for feedback.js modal */
.feedback-after-release {
    background-color: #f39c12 !important;
    border: 1px solid #e67e22 !important;
    color: white !important;
    padding: 12px 8px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    margin-right: 0 !important;
}

.feedback-after-release:hover {
    background-color: #e67e22 !important;
    border-color: #d35400 !important;
    color: white !important;
}