/**
 * Bulk Message Styles
 */

/* Bulk Selection Checkbox - Original position (top-left) */
.bulk-select-wrapper {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 3px;
    padding: 2px;
}

/* Bulk Selection Checkbox - Footer actions position */
.bulk-select-wrapper-actions {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bulk-select-checkbox {
    display: none;
}

.bulk-select-label {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.bulk-select-label:hover {
    border-color: #007cba;
    background: #f7f7f7;
}

.bulk-select-checkbox:checked + .bulk-select-label {
    background: #007cba;
    border-color: #007cba;
}

.bulk-select-checkbox:checked + .bulk-select-label:after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Footer Checkbox - Before Actions Section */
.bulk-select-wrapper-footer {
    position: absolute;
    /* bottom: 10px; */
    right: 10px;
    z-index: 9999 !important;
    /* background: rgba(255, 255, 255, 0.95); */
    /* border-radius: 50%; */
    padding: 8px;
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); */
    /* border: 1px solid #ddd; */
    transition: all 0.3s ease;
}

/* Remove hover effects since we commented out the background styles */
/* .bulk-select-wrapper-footer:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
} */

.bulk-select-label-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: 12px;
    font-weight: normal;
    transition: all 0.3s ease;
    padding: 4px 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    white-space: nowrap;
}

.bulk-select-label-footer:hover {
    color: #007cba;
}

.bulk-select-checkbox:checked + .bulk-select-label-footer {
    color: #007cba;
    font-weight: bold;
}

/* Remove all pseudo-elements completely */
.bulk-select-wrapper-footer *:before,
.bulk-select-wrapper-footer *:after {
    display: none !important;
    content: none !important;
}

/* Ensure parent containers have relative positioning */
.lf-item-container.listing-preview {
    position: relative;
}

.footer-sections-wrap-listing {
    position: relative;
}

/* Bulk Actions Button */
.bulk-actions-wrapper {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.bulk-message-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.bulk-message-btn:hover {
    background: #005a87;
}

.bulk-message-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Bulk Message Modal */
#bulk-message-modal .modal-dialog {
    max-width: 800px;
}

#bulk-message-modal .modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

#bulk-message-modal .modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.selected-listings-info {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #b3d9ff;
}

.selected-listings-info strong {
    color: #0066cc;
}

.selected-listings-list {
    max-height: 120px;
    overflow-y: auto;
    margin-top: 10px;
}

.selected-listing-item {
    padding: 5px 0;
    border-bottom: 1px solid #d0e7ff;
}

.selected-listing-item:last-child {
    border-bottom: none;
}

.listing-name {
    font-weight: 500;
    color: #333;
}

.listing-email {
    color: #666;
}

.form-divider {
    height: 1px;
    background: #dee2e6;
    margin: 20px 0;
}

#bulk-message-form .form-group {
    margin-bottom: 15px;
}

#bulk-message-form label {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
    display: block;
}

#bulk-message-form .form-control {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#bulk-message-form .form-control:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

#bulk-message-form textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Modal Footer */
#bulk-message-modal .modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

#send-bulk-message {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

#send-bulk-message:hover {
    background: #218838;
}

#send-bulk-message:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .bulk-select-wrapper {
        top: 5px;
        left: 5px;
    }
    
    .bulk-select-label {
        width: 18px;
        height: 18px;
    }
    
    #bulk-message-modal .modal-dialog {
        margin: 10px;
        max-width: none;
    }
    
    .bulk-actions-wrapper {
        text-align: center;
    }
    
    .bulk-message-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
}

/* Position adjustments for different listing card templates */
.lf-item-alternate .bulk-select-wrapper {
    top: 15px;
    left: 15px;
}

.lf-item-list-view .bulk-select-wrapper {
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
}

.lf-item-quick-view .bulk-select-wrapper {
    top: 10px;
    left: 10px;
}