/* RFP Manager Frontend Styles */

/* Notification styles (matching mailbox style) */
.brixzly-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 350px;
}

.brixzly-notification.show {
    transform: translateX(0);
}

.brixzly-notification.success {
    background: linear-gradient(135deg, #00a32a, #007e23);
}

.brixzly-notification.error {
    background: linear-gradient(135deg, #d63638, #b32d2e);
}

/* Confirmation modal styles (matching mailbox style) */
.brixzly-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brixzly-confirm-dialog {
    background: white;
    padding: 25px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.brixzly-confirm-dialog p {
    margin: 0 0 20px 0;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
}

.brixzly-confirm-dialog > div {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.brixzly-rfp-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    z-index: 0;
    overflow-x: visible; /* Allow horizontal overflow for tables */
    overflow-y: visible;
    width: 100%;
    box-sizing: border-box;
}

/* Layout with Sidebar */
.brixzly-rfp-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    overflow-x: visible;
    overflow-y: visible;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Left Sidebar Column (contains sidebar and user limits) */
.brixzly-rfp-sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 250px;
    flex-shrink: 0;
}

/* Left Sidebar */
.brixzly-rfp-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.brixzly-rfp-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.brixzly-rfp-sidebar-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
}

.brixzly-rfp-sidebar-nav {
    padding: 10px 0;
}

.brixzly-rfp-sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.brixzly-rfp-sidebar-nav li {
    margin: 0;
}

.brixzly-rfp-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #50575e;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.brixzly-rfp-nav-item:hover {
    background: #f6f7f7;
    color: #2271b1;
}

.brixzly-rfp-nav-item.active {
    background: #f0f6fc;
    color: #2271b1;
    border-left-color: #2271b1;
    font-weight: 600;
}

.brixzly-rfp-nav-item .nav-icon {
    font-size: 18px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.brixzly-rfp-nav-item .nav-label {
    flex: 1;
    font-size: 18px;
}

/* Submenu styling */
.brixzly-rfp-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f9f9f9;
    border-top: 1px solid #e5e5e5;
}

.brixzly-rfp-submenu-item {
    padding-left: 50px !important;
    font-size: 16px !important;
    border-left: 3px solid transparent;
}

.brixzly-rfp-submenu-item .nav-label {
    font-size: 16px !important;
    /* Don't override padding-left - let the parent item handle indentation */
}

.brixzly-rfp-submenu-item:hover {
    background: #f0f0f0;
    color: #2271b1;
}

.brixzly-rfp-submenu-item.active {
    background: #e8f4f8;
    color: #2271b1;
    font-weight: 600;
    border-left-color: #2271b1;
}

/* User Limits Container */
.brixzly-rfp-user-limits-container {
    width: 100%;
    border: 0;
    padding: 0;
}

.brixzly-rfp-user-limits-container .brixzly-upload-limits {
    margin: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 15px;
}

/* Override limits grid to fit in narrow container */
.brixzly-rfp-user-limits-container .brixzly-limits-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

/* Ensure limit items fit within container */
.brixzly-rfp-user-limits-container .brixzly-limit-item {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure limit header text doesn't overflow */
.brixzly-rfp-user-limits-container .brixzly-limit-header {
    flex-wrap: wrap;
    gap: 5px;
}

.brixzly-rfp-user-limits-container .brixzly-limit-label,
.brixzly-rfp-user-limits-container .brixzly-limit-value {
    font-size: 14px;
    white-space: normal;
    word-break: break-word;
}

/* Ensure token details fit */
.brixzly-rfp-user-limits-container .brixzly-token-details {
    width: 100%;
    box-sizing: border-box;
}

.brixzly-rfp-user-limits-container .brixzly-token-costs {
    font-size: 12px;
    margin-bottom: 10px;
}

.brixzly-rfp-user-limits-container .brixzly-purchase-tokens-btn {
    width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
    padding: 8px 12px;
    font-size: 12px;
}

/* Hide Manage Files button - already available in sidebar menu */
.brixzly-rfp-user-limits-container .brixzly-manage-files-btn {
    display: none;
}

/* Main Content Area */
.brixzly-rfp-main-content {
    flex: 1;
    min-width: 0; /* Allows flex item to shrink below content size */
    overflow-x: visible; /* Allow horizontal overflow for tables */
    overflow-y: visible;
    max-width: 100%;
    box-sizing: border-box;
}

.brixzly-rfp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ddd;
    position: relative;
    z-index: 1;
}

#rfp-create-new {
    position: relative;
    z-index: 2;
    pointer-events: auto !important;
    cursor: pointer !important;
    opacity: 1 !important;
}

.brixzly-rfp-views {
    position: relative;
    z-index: 1;
}

.brixzly-rfp-create-view,
.brixzly-rfp-list-view,
.brixzly-rfp-details-view {
    position: relative;
    z-index: 1;
    overflow-x: visible;
    overflow-y: visible;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Back Button Styling */
.brixzly-rfp-back-btn {
    padding: 10px 20px;
    border: 2px solid #646970;
    background: #fff;
    color: #646970;
    cursor: pointer;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    text-decoration: none;
}

.brixzly-rfp-back-btn:hover {
    background: #f6f7f7;
    border-color: #2271b1;
    color: #2271b1;
    box-shadow: 0 2px 4px rgba(34, 113, 177, 0.2);
    transform: translateY(-1px);
}

.brixzly-rfp-back-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(34, 113, 177, 0.1);
}

.brixzly-rfp-back-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.3);
}

/* Ensure header button is always clickable */
.brixzly-rfp-container {
    position: relative;
}

.brixzly-rfp-header button {
    position: relative;
    z-index: 2;
}

.brixzly-rfp-header h2 {
    margin: 0;
}

.brixzly-rfp-btn {
    padding: 12px 24px;
    border: 0px solid #3498db;
    background: #3498db;
    color: #fff;
    cursor: pointer;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.brixzly-rfp-btn:hover {
    background: #2980b9;
    border-color: #2980b9;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
    transform: translateY(-1px);
}

.brixzly-rfp-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.brixzly-rfp-btn:disabled {
    background: #95a5a6;
    border-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.brixzly-rfp-btn-primary {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
}

.brixzly-rfp-btn-primary:hover {
    background: #005a87;
    border-color: #005a87;
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

/* Generate RFP button specific styling */
#rfp-generate-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 14px 28px;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

#rfp-generate-content:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

#rfp-generate-content:disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    box-shadow: none;
    transform: none;
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.brixzly-rfp-btn.loading {
    position: relative;
    padding-right: 40px;
}

.brixzly-rfp-btn.loading::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Ensure spinner is hidden when loading class is removed */
.brixzly-rfp-btn:not(.loading)::after {
    display: none !important;
    content: none !important;
}

.brixzly-rfp-btn.loading-dots::after {
    content: '';
    animation: none;
    border: none;
    width: auto;
    height: auto;
    position: static;
    transform: none;
}

/* Generating text with animated dots */
.generating-text {
    display: inline-block;
}

.generating-text::after {
    content: '...';
    animation: pulse 1.5s ease-in-out infinite;
}

/* Progress indicator */
.brixzly-rfp-generating-status {
    margin-top: 12px;
    padding: 12px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    display: none;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #1976d2;
}

.brixzly-rfp-generating-status.active {
    display: flex;
}

.brixzly-rfp-generating-status .spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(33, 150, 243, 0.2);
    border-top-color: #2196f3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.brixzly-rfp-generating-status .status-text {
    flex: 1;
}

.brixzly-rfp-generating-status .progress-dots {
    display: inline-block;
    width: 40px;
    text-align: left;
}

.brixzly-rfp-generating-status .progress-dots::after {
    content: '...';
    animation: pulse 1.5s ease-in-out infinite;
}

/* RFP List View */
.brixzly-rfp-list {
    display: grid;
    gap: 20px;
}

.brixzly-rfp-list-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    transition: box-shadow 0.3s;
}

.brixzly-rfp-list-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.brixzly-rfp-list-item h3 {
    margin: 0 0 10px 0;
    color: #0073aa;
}

.brixzly-rfp-list-item-meta {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.rfp-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.rfp-status-draft {
    background: #f0f0f0;
    color: #666;
}

.rfp-status-sent {
    background: #e3f2fd;
    color: #1976d2;
}

.rfp-status-opened {
    background: #e8f5e9;
    color: #388e3c;
}

.rfp-status-replied {
    background: #fff3e0;
    color: #f57c00;
}

/* RFP Form */
.brixzly-rfp-form {
    background: #fff;
    border-radius: 4px;
}

.brixzly-rfp-form-section {
    margin-bottom: 30px;
}

/* Individual section styling with borders and padding */
#rfp-section-project-info,
#rfp-section-submission-methods,
#rfp-section-owner-info,
#rfp-section-generate,
#rfp-section-attachments,
#rfp-section-recipients,
#rfp-primary-contact-section {
    border: solid 1px #e0e0e0;
    padding: 30px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Remove bottom margin from last section */
.brixzly-rfp-form-section:last-child {
    margin-bottom: 0;
}

.brixzly-rfp-form-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3em;
    font-weight: 600;
    border-bottom: 1px solid #3498db;
}

#rfp-section-project-info > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#rfp-section-project-info > div:first-child h3 {
    margin: 0;
    border-bottom: none;
}

#rfp-cancel-top {
    padding: 8px 16px;
    font-size: 18px;
    line-height: 1;
    min-width: 40px;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 10px;
}

.brixzly-rfp-form-group {
    margin-bottom: 24px;
}

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

.brixzly-rfp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.brixzly-rfp-form-group input[type="text"],
.brixzly-rfp-form-group input[type="email"],
.brixzly-rfp-form-group input[type="date"],
.brixzly-rfp-form-group input[type="tel"],
.brixzly-rfp-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.brixzly-rfp-form-group input[type="text"]:focus,
.brixzly-rfp-form-group input[type="email"]:focus,
.brixzly-rfp-form-group input[type="date"]:focus,
.brixzly-rfp-form-group input[type="tel"]:focus,
.brixzly-rfp-form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.brixzly-rfp-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.brixzly-rfp-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .brixzly-rfp-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.brixzly-rfp-form-group .description {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    font-style: italic;
    line-height: 1.5;
}

/* Checkbox styling */
.brixzly-rfp-form-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #3498db;
}

.brixzly-rfp-form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.5;
}

.brixzly-rfp-form-group label:has(input[type="checkbox"]):hover {
    color: #3498db;
}

/* Submission methods checkboxes */
.brixzly-rfp-form-group label[style*="display: block"] {
    display: flex !important;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    font-weight: 500;
    cursor: pointer;
}

.brixzly-rfp-form-group label[style*="display: block"] input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    margin-top: 0;
    flex-shrink: 0;
}

/* Owner is primary checkbox */
.brixzly-rfp-form-group label[for="rfp-owner-is-primary"],
.brixzly-rfp-form-group label:has(#rfp-owner-is-primary) {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 500;
    cursor: pointer;
}

.brixzly-rfp-form-group label[for="rfp-owner-is-primary"] input,
.brixzly-rfp-form-group label:has(#rfp-owner-is-primary) input {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    margin-top: 0;
    flex-shrink: 0;
}

/* Recipients */
.brixzly-rfp-recipient-sources {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.brixzly-rfp-recipient-source {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.brixzly-rfp-recipient-source h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.brixzly-rfp-add-recipient-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.brixzly-rfp-add-recipient-form input {
    flex: 1;
    min-width: 150px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.brixzly-rfp-recipients-list {
    margin-top: 20px;
}

.brixzly-rfp-recipient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 10px;
}

.brixzly-rfp-recipient-item-info {
    flex: 1;
}

.brixzly-rfp-recipient-item-name {
    font-weight: 600;
    color: #333;
}

.brixzly-rfp-recipient-item-email {
    font-size: 13px;
    color: #666;
}

.brixzly-rfp-recipient-item-remove {
    padding: 5px 10px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.brixzly-rfp-recipient-item-remove:hover {
    background: #c82333;
}

.brixzly-rfp-btn[style*="background: #dc3545"]:hover {
    background: #c82333 !important;
    border-color: #c82333 !important;
}

/* Content Actions (buttons above RFP content) */
.brixzly-rfp-content-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* RFP WYSIWYG Editor */
.rfp-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px;
    background: #f6f7f7;
    border: 1px solid #8c8f94;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.rfp-editor-btn {
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    color: #2c3338;
    transition: all 0.2s;
    min-width: 32px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rfp-editor-btn:hover {
    background: #f0f0f1;
    border-color: #2271b1;
}

.rfp-editor-btn:active {
    background: #e0e0e0;
}

.rfp-toolbar-separator {
    width: 1px;
    height: 20px;
    background: #8c8f94;
    margin: 0 5px;
}

.rfp-message-editor {
    min-height: 300px;
    max-height: 600px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid #8c8f94;
    border-radius: 0 0 4px 4px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    background: #fff;
    color: #1d2327;
    outline: none;
}

.rfp-message-editor:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.rfp-message-editor:empty:before {
    content: attr(placeholder);
    color: #8c8f94;
    pointer-events: none;
}

.rfp-message-editor p {
    margin: 0 0 1em 0;
}

.rfp-message-editor p:last-child {
    margin-bottom: 0;
}

/* Match preview heading styles inside Edit Content WYSIWYG editor */
.rfp-message-editor h1,
.rfp-message-editor h2,
.rfp-message-editor h3,
.rfp-message-editor h4,
.rfp-message-editor h5,
.rfp-message-editor h6 {
    color: #2c3e50;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.rfp-message-editor h1 {
    font-size: 1.7em;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.3em;
}

.rfp-message-editor h2 {
    font-size: 1.1em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.2em;
}

.rfp-message-editor h3 {
    font-size: 0.9em;
    color: #34495e;
}

.brixzly-rfp-content-actions .brixzly-rfp-btn {
    margin: 0;
}

/* Form Actions */
.brixzly-rfp-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Messages */
.brixzly-rfp-message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.brixzly-rfp-message.brixzly-rfp-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.brixzly-rfp-message.brixzly-rfp-success {
    background: #efe;
    border: 1px solid #cfc;
    color: #3c3;
}

/* Loading State */
.brixzly-rfp-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Modal Styles */
.brixzly-rfp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brixzly-rfp-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.brixzly-rfp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.brixzly-rfp-modal-header h3 {
    margin: 0;
}

.brixzly-rfp-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brixzly-rfp-modal-close:hover {
    color: #000;
}

.brixzly-rfp-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.brixzly-rfp-modal-footer {
    padding: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.brixzly-rfp-contact-item {
    transition: background 0.2s;
}

.brixzly-rfp-contact-item:hover {
    background: #f5f5f5;
}

.brixzly-rfp-contact-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.brixzly-rfp-contact-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #3498db;
}

/* RFP Content Preview */
#rfp-content-preview {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    /* Isolate preview content - prevent styles from leaking */
    position: relative;
    isolation: isolate;
    /* Ensure it stays within its container */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* Reset any positioning that might cause overflow */
    min-width: 0;
}

/* Ensure any container styles in preview don't affect the page */
#rfp-content-preview .container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box;
}

/* Ensure all elements within preview respect container bounds */
#rfp-content-preview * {
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Allow images and tables to scale but stay within bounds */
#rfp-content-preview img,
#rfp-content-preview table {
    max-width: 100% !important;
    height: auto !important;
}

/* Ensure the preview container itself respects parent width */
.brixzly-rfp-form-group #rfp-content-preview {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Prevent any nested containers from breaking out */
#rfp-content-preview > * {
    max-width: 100% !important;
    overflow-x: auto;
}

/* Prevent body/html styles from the preview from affecting the page */
body:not(#rfp-content-preview) {
    max-width: none !important;
}

/* Override any body styles that might have been added by preview content */
body.brixzly-rfp-page {
    max-width: none !important;
}

#rfp-content-preview h1,
#rfp-content-preview h2,
#rfp-content-preview h3,
#rfp-content-preview h4,
#rfp-content-preview h5,
#rfp-content-preview h6 {
    color: #2c3e50 !important;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

#rfp-content-preview h1 {
    font-size: 1.7em;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.3em;
    color: #2c3e50 !important;
}

#rfp-content-preview h2 {
    font-size: 1.1em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.2em;
    color: #2c3e50 !important;
}

#rfp-content-preview h3 {
    font-size: 0.9em;
    color: #34495e !important;
}

/* Override any light colors in the HTML content */
#rfp-content-preview * {
    color: inherit;
}

#rfp-content-preview p {
    font-size: 0.9em;
    color: #333 !important;
}

#rfp-content-preview li,
#rfp-content-preview td,
#rfp-content-preview th {
    color: #333 !important;
}

#rfp-content-preview p {
    margin: 1em 0;
}

#rfp-content-preview ul,
#rfp-content-preview ol {
    margin: 1em 0;
    padding-left: 2em;
}

#rfp-content-preview li {
    margin: 0.5em 0;
}

#rfp-content-preview strong {
    color: #2c3e50;
    font-weight: 600;
}

#rfp-content-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

#rfp-content-preview table th,
#rfp-content-preview table td {
    padding: 0.75em;
    border: 1px solid #ddd;
    text-align: left;
}

#rfp-content-preview table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

#rfp-content-preview blockquote {
    border-left: 4px solid #3498db;
    padding-left: 1em;
    margin: 1em 0;
    color: #666;
    font-style: italic;
}

/* Address Book View - Uses shortcode, so minimal styling needed */
#address-book-view {
    padding: 0;
}

/* File Manager View - Uses shortcode, so minimal styling needed */
#file-manager-view {
    padding: 0;
    overflow-x: visible !important;
    overflow-y: visible !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0; /* Allow flex item to shrink */
}

#file-manager-view * {
    max-width: none; /* Remove max-width constraints on children */
}

#file-manager-view .pmpro-file-manager-frontend {
    overflow-x: visible !important;
    overflow-y: visible !important;
    width: 100%;
    max-width: 100%;
}

#file-manager-view .file-list-section {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* Responsive */
@media (max-width: 768px) {
    .brixzly-rfp-form-row {
        grid-template-columns: 1fr;
    }
    
    .brixzly-rfp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .brixzly-rfp-add-recipient-form {
        flex-direction: column;
    }
    
    .brixzly-rfp-add-recipient-form input {
        width: 100%;
    }
    
    .brixzly-rfp-modal-content {
        width: 95%;
        max-height: 90vh;
    }
}
