/* assets/posting.css */

/* Main Container Styles */
.b2b-posting-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.b2b-posting-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.b2b-posting-header h2 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.b2b-posting-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin: 0;
}

/* Form Sections */
.b2b-form-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.b2b-form-section h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Form Groups */
.b2b-form-group {
    margin-bottom: 1.5rem;
}

.b2b-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.b2b-form-group input[type="text"],
.b2b-form-group input[type="email"],
.b2b-form-group input[type="url"],
.b2b-form-group input[type="number"],
.b2b-form-group input[type="date"],
.b2b-form-group select,
.b2b-form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
}

.b2b-form-group input:focus,
.b2b-form-group select:focus,
.b2b-form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.b2b-form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.b2b-form-group small {
    display: block;
    margin-top: 0.5rem;
    color: #7f8c8d;
    font-size: 0.85rem;
}

/* Form Rows */
.b2b-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

/* Checkbox Styles */
.b2b-form-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.b2b-form-group label input[type="checkbox"] {
    display: inline-block;
    width: auto;
}

/* Form Actions */
.b2b-form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
}

.b2b-primary-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.b2b-primary-btn:hover {
    background: linear-gradient(135deg, #2980b9, #2573a7);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.b2b-secondary-btn {
    background: #95a5a6;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.b2b-secondary-btn:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

/* Messages */
.b2b-post-success {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #28a745;
    margin-bottom: 1.5rem;
}

.b2b-post-error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #dc3545;
    margin-bottom: 1.5rem;
}

/* Notices */
.b2b-form-notice {
    margin: 1.5rem 0;
}

.b2b-notice-warning {
    background: #fff3cd;
    color: #856404;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
}

/* My Listings Dashboard */
.b2b-my-listings {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    background: #f8fafc;
    min-height: 100vh;
}

.b2b-listings-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #50d4c4 0%, #3fb8a8 100%);
    border-radius: 16px;
    color: white;
    box-shadow: 0 4px 20px rgba(80, 212, 196, 0.3);
}

.b2b-listings-header h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.b2b-listings-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    margin: 0;
}

/* Tabs */
.b2b-listings-tabs {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.b2b-tabs-nav {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
    background: #f8fafc;
    padding: 1rem 1rem 0;
}

.b2b-tab-btn {
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.b2b-tab-btn:hover {
    color: #50d4c4;
    background: white;
}

.b2b-tab-btn.active {
    color: #50d4c4;
    background: white;
    border-bottom-color: #50d4c4;
}

.b2b-tab-pane {
    display: none;
}

.b2b-tab-pane.active {
    display: block;
}

/* Listings Grid */
.b2b-tabs-content {
    padding: 2rem;
}

.b2b-listings-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

.b2b-listing-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.b2b-listing-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #50d4c4;
}

.b2b-listing-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.b2b-listing-header h4 {
    margin: 0;
    flex: 1;
}

.b2b-listing-header h4 a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
}

.b2b-listing-header h4 a:hover {
    color: #3498db;
}

.b2b-listing-status {
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-publish {
    background: #d1fae5;
    color: #065f46;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-draft {
    background: #f1f5f9;
    color: #475569;
}

/* Listing Meta */
.b2b-listing-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #7f8c8d;
    flex-wrap: wrap;
}

.b2b-listing-type,
.b2b-listing-budget,
.b2b-listing-price,
.b2b-listing-location,
.b2b-listing-agents,
.b2b-listing-entity,
.b2b-listing-entity-type,
.b2b-listing-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Listing Excerpt */
.b2b-listing-excerpt {
    color: #5a6c7d;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* Listing Actions */
.b2b-listing-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.b2b-edit-btn,
.b2b-view-btn,
.b2b-pause-btn,
.b2b-delete-btn {
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.b2b-edit-btn {
    background: #50d4c4;
    color: white;
}

.b2b-edit-btn:hover {
    background: #3fb8a8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(80, 212, 196, 0.3);
}

.b2b-view-btn {
    background: #3b82f6;
    color: white;
}

.b2b-view-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.b2b-delete-btn {
    background: #ef4444;
    color: white;
}

.b2b-delete-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Empty States */
.b2b-empty-listings {
    text-align: center;
    padding: 4rem 2rem;
}

.b2b-empty-state h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.b2b-empty-state p {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

/* Login Required & Permission Denied */
.b2b-login-required,
.b2b-permission-denied {
    max-width: 500px;
    margin: 2rem auto;
    text-align: center;
    padding: 3rem 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.b2b-login-message h3,
.b2b-permission-message h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.b2b-login-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .b2b-posting-form-container,
    .b2b-my-listings {
        padding: 1rem;
        margin: 1rem;
    }
    
    .b2b-posting-header h2 {
        font-size: 1.5rem;
    }
    
    .b2b-listings-grid {
        grid-template-columns: 1fr;
    }
    
    .b2b-listing-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .b2b-form-actions {
        flex-direction: column;
    }
    
    .b2b-tabs-nav {
        flex-direction: column;
    }
    
    .b2b-tab-btn {
        text-align: left;
        border-bottom: 1px solid #f0f0f0;
        border-left: 3px solid transparent;
    }
    
    .b2b-tab-btn.active {
        border-left-color: #3498db;
        border-bottom-color: #f0f0f0;
    }
}

/* Loading States */
.b2b-loading {
    opacity: 0.7;
    pointer-events: none;
}

.b2b-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* WYSIWYG Editor Styling */
#b2b-wysiwyg-container {
    margin-bottom: 1rem;
}

#b2b-wysiwyg-container .wp-editor-container {
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    overflow: hidden;
}

#b2b-wysiwyg-container .wp-editor-tabs {
    border-bottom: 1px solid #e1e8ed;
}

#b2b-wysiwyg-container .wp-switch-editor {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-bottom: none;
    padding: 5px 10px;
    cursor: pointer;
}

#b2b-wysiwyg-container .wp-switch-editor:hover {
    background: #e9ecef;
}

#b2b-wysiwyg-container .wp-editor-tools {
    background: #f8f9fa;
    padding: 5px;
}

/* File Upload Styling */
.b2b-file-upload-area {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 25px;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.b2b-file-upload-area:hover {
    border-color: #3498db;
    background: #f0f8ff;
}


.b2b-upload-instructions {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
}

.b2b-upload-instructions p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #5a6c7d;
}

.b2b-upload-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
}

.b2b-file-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}
.b2b-file-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}
.b2b-remove-file {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.3s ease;
}

.b2b-remove-file:hover {
    background: #c0392b;
}

.b2b-add-file-btn {
    background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3);
    margin-top: 10px;
}

.b2b-add-file-btn:hover {
    background: linear-gradient(135deg, #219a52 0%, #1e8449 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.4);
}

.b2b-add-file-btn:active {
    transform: translateY(0);
}

/* File preview styling */
.b2b-file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #e8f5e8;
    border-radius: 4px;
    margin-top: 5px;
    font-size: 0.85rem;
}

.b2b-file-preview::before {
    content: "📎";
}

/* Responsive design for file upload */
@media (max-width: 768px) {
    .b2b-upload-field {
        flex-direction: column;
        align-items: stretch;
    }
    
    .b2b-remove-file {
        align-self: flex-end;
    }
}