/* Bob-A-Job Main Stylesheet */

:root {
    --baj-color-primary: #3AA6A1;
    --baj-color-secondary: #A3BFA8;
    --baj-color-background: #F7F6F3;
    --baj-color-accent: #E07A5F;
    --baj-color-text: #2E2E2E;
    --baj-color-surface: #FFFFFF;
    --baj-color-border: #D8D5CE;
    --baj-color-muted: #6F6A63;
    --baj-color-primary-soft: #D8EFED;
    --baj-color-secondary-soft: #E3EBE1;
    --baj-color-accent-soft: #F7E1DA;
    --baj-font-family: 'Poppins', Arial, Helvetica, sans-serif;
    --baj-theme-accent: var(--baj-color-primary);
}

body,
button,
input,
select,
textarea,
.button,
.wp-element-button,
.baj-dashboard-wrapper,
.baj-profile-container,
.baj-messaging-wrapper,
.baj-single-task-wrapper {
    font-family: var(--baj-font-family);
}

/* 1. Layout & Grid */
.baj-task-grid, .baj-task-columns {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.baj-card {
    border: 1px solid var(--baj-theme-accent, #C58EE1);
    padding: 15px;
    border-radius: 8px;
    background: #fff;
    transition: transform 0.2s;
}

.baj-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* 2. Status Tags */
.baj-status-tag {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
}

.status-open { background-color: #e8f5e9; color: #2e7d32; }      /* Green */
.status-pending { background-color: #fff3e0; color: #ef6c00; }   /* Orange */
.status-closed { background-color: #eceff1; color: #455a64; }    /* Grey */

/* 3. Bidding Module */
.baj-bidding-module {
    background: #fdfdfd;
    padding: 15px;
    border: 1px dashed #ccc;
    border-radius: 5px;
    margin-bottom: 20px;
}

#baj-bid-input {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    font-size: 1.1em;
}

/* 5. Tables & Buttons */
.baj-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.baj-table th, .baj-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.button-small {
    padding: 10px 14px !important;
    font-size: 12px !important;
    text-decoration: none;
    min-height: 44px;
}

.button-danger {
    background: #d32f2f !important;
    color: white !important;
    border-color: #b71c1c !important;
}

/* 6. Alerts */
.baj-alert {
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}
.success { background: #dff0d8; border: 1px solid #d6e9c6; color: #3c763d; }
.error { background: #f2dede; border: 1px solid #ebccd1; color: #a94442; }

/* Ensure the marketplace UI stays within the theme's bounds */
.baj-single-task-wrapper {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    align-items: flex-start;
}

.baj-main-content { flex: 2; }
.baj-sidebar { 
    flex: 1; 
    /*background: #f9f9f9; */
    padding: 20px; 
    border-radius: 8px; 
    border: 1px solid #eee;
}

/* Parent Category Styling */
.baj-parent-group {
    margin-bottom: 40px;
    padding: 20px;
    background: #fdfdfd;
    border-radius: 12px;
}

.baj-parent-title {
    font-size: 1.8em;
    border-bottom: 3px solid currentColor;
    display: inline-block;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Subcategory Row */
.baj-subcategory-row {
    margin-bottom: 30px;
}

.baj-subcategory-row h4 {
    font-size: 1.2em;
    margin-bottom: 10px;
    padding-left: 5px;
}

/* --- CAROUSEL CONTAINER --- */
.baj-task-carousel {
    display: flex;
    flex-wrap: nowrap !important; 
    overflow-x: auto;
    gap: 15px;
    padding: 20px; /* Adjusted padding */
    
    -webkit-overflow-scrolling: touch; 
    scroll-behavior: smooth; 
    scrollbar-width: none; 
    cursor: grab;
    touch-action: pan-y;
    
    /* NEW: Magnetically snap items as you scroll */
    scroll-snap-type: x mandatory; 
}

.baj-task-carousel::-webkit-scrollbar { display: none; }
.baj-task-carousel:active { cursor: grabbing; }

/* --- CAROUSEL ITEMS --- */
.baj-carousel-item {
    flex: 0 0 auto !important; 
    
    /* NEW: Responsive sizing and magnetic center alignment */
    width: 85vw; 
    max-width: 280px; 
    scroll-snap-align: center; 
}


/* Prevent accidental image/link dragging while swiping */
.baj-task-carousel img, 
.baj-task-carousel a {
    user-select: none;
    -webkit-user-drag: none;
}

/* --- NAVIGATION BUTTONS --- */
.baj-carousel-btn {
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50% !important;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- MAKE ALL RENDERED CARDS UNSELECTABLE & CLICKABLE --- */
.baj-card[data-url] {
    user-select: none;         /* Standard */
    -webkit-user-select: none; /* Safari/Chrome */
    -moz-user-select: none;    /* Firefox */
    cursor: pointer;           /* Changes mouse to a pointing hand */
}

/* Container for the chat */
#baj-chat-history {
    display: flex;
    flex-direction: column;
    padding: 15px;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f9f9f9;
}

#baj-chat-history::-webkit-scrollbar {
    width: 6px;
}

/* My Messages (Right side) */
.msg-me {
    align-self: flex-end;
    align-items: flex-end;
    max-width: 80%; /* Limit bubble width */
    width: 100%;    /* Help flexbox context */
    display: flex;
    flex-direction: column;
}

.msg-me .bubble-content {
    background-color: #E7D4F2;
    color: #333;
    padding: 10px 15px;
    border-radius: 12px;
    border-bottom-right-radius: 2px;
    
    /* THE FIX FOR THE WRAPPING */
    width: fit-content; 
    text-align: right; 
    word-wrap: break-word;
}

/* Their Messages (Left side) */
.msg-them {
    align-self: flex-start;
    align-items: flex-start;
    max-width: 80%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.msg-them .bubble-content {
    background-color: #F2D8D4;
    border: 1px solid #eee;
    padding: 10px 15px;
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    
    width: fit-content;
    text-align: left;
    word-wrap: break-word;
}

.msg-meta {
    padding: 0 5px;
}

/* --- RESPONSIVE TABLES (My Tasks / My Bids) --- */
.baj-my-bids-wrapper,
.baj-my-tasks-wrapper,
.baj-my-saved-wrapper,
.baj-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 20px;
    border: none;
}

.baj-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
}

@media (max-width: 768px) {
    .baj-table {
        min-width: 550px;
    }
}

/* Optional: Removes the duplicate border since the wrapper now has one */
.baj-table { border: none !important; }

/* --- 7. NOTIFICATION DROPDOWN --- */
.baj-notify-wrapper {
    position: relative;
    display: inline-block;
}

.baj-notify-dropdown-menu {
    display: none !important; /* Force hide by default */
    position: absolute; 
    right: 0; 
    top: 40px; 
    width: 300px; 
    max-width: 90vw; /* Prevent viewport overflow on small screens */
    background: #fff; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); 
    border-radius: 8px; 
    border: 1px solid #eee; 
    z-index: 10000;
}

.baj-notify-dropdown-menu.baj-show {
    display: block !important; /* Override the hide when active */
    animation: bajFadeIn 0.2s ease-in-out;
}

@keyframes bajFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Adjustment to center the dropdown in the viewport */
@media (max-width: 600px) {
    .baj-notify-dropdown-menu {
        position: fixed !important; /* Break free of wrapper so it aligns relative to the viewport/screen */
        top: 75px !important; /* Safe distance from top of the screen */
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important; /* True horizontal centering */
        width: 92vw !important;
        max-width: 400px !important;
        z-index: 100000 !important;
    }

    .baj-notify-dropdown-menu.baj-show {
        /* Need to update animation so it doesn't break the translation centering */
        animation: bajFadeInMobile 0.2s ease-in-out;
    }
}

@keyframes bajFadeInMobile {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* --- Force remove all theme bullet points from the notification list --- */
.baj-notify-dropdown-menu ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.baj-notify-dropdown-menu ul li {
    list-style-type: none !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background-image: none !important; /* Overrides image-based bullets */
}

/* Kills custom theme bullets generated via CSS */
.baj-notify-dropdown-menu ul li::before,
.baj-notify-dropdown-menu ul li::after,
.baj-notify-dropdown-menu ul li::marker {
    content: none !important;
    display: none !important;
}

/* --- Notification Link Formatting Fix --- */
.baj-notify-dropdown-menu .baj-note-link {
    display: block !important;
    padding: 16px 20px !important; /* Adds the extra breathing room */
    text-decoration: none !important;
    color: #333 !important;
    font-size: 0.95em !important;
    line-height: 1.6 !important; /* Fixes the cramped wrapped text */
    text-align: left !important;
    text-indent: 0 !important; /* Fixes the weird first-line offset */
    word-wrap: break-word !important;
    box-sizing: border-box !important;
}

.baj-notify-dropdown-menu .baj-note-link:hover {
    background-color: #f9f9f9 !important; /* Adds a nice hover effect */
}

.baj-notify-dropdown-menu .baj-note-link small {
    display: block !important; /* Pushes the date to its own neat line */
    margin-top: 6px !important;
    color: #999 !important;
    font-size: 0.85em !important;
}

/* --- 8. RATING UI --- */
.baj-rating-module {
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: left;
}

.baj-star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
    font-size: 2em;
}

.baj-star-rating input {
    display: none;
}

.baj-star-rating label {
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s;
}

.baj-star-rating input:checked ~ label,
.baj-star-rating label:hover,
.baj-star-rating label:hover ~ label {
    color: #f1c40f;
}

.baj-review-text {
    width: 100%;
    margin-top: 15px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    font-family: inherit;
    resize: vertical;
}

.baj-profile-rating-card {
    background: #fdfdfd;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 20px;
}

.baj-avg-stars {
    color: #f1c40f;
    font-size: 1.2em;
    letter-spacing: 2px;
}

.baj-random-review {
    background: #f9f9f9;
    border-left: 3px solid #C58EE1;
    padding: 15px;
    font-style: italic;
    color: #555;
    border-radius: 0 4px 4px 0;
    margin-top: 15px;
    font-size: 0.9em;
}

/* --- 9. PROFILE UI (Migrated from templates/profile-ui.php) --- */
.baj-profile-container { margin-bottom: 50px; }
.baj-profile-header { display: flex; gap: 50px; align-items: flex-start; margin-bottom: 40px; }
.baj-main-info { flex: 2; }
.baj-trust-sidebar { flex: 1; min-width: 300px; }
.baj-elaborate-table { width: 100%; border-collapse: collapse; margin-top: 25px; background: #fff; }
.baj-elaborate-table tr td { padding: 12px 15px; border-bottom: 1px solid #eee; }
.baj-attr-label { font-weight: bold; color: #888; width: 35%; font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.5px; }
.baj-attr-value { color: #333; font-weight: 500; font-size: 0.95em; }
.baj-trust-card { background: #fdfdfd; border: 1px solid #e0e0e0; border-radius: 15px; padding: 30px; text-align: center; position: sticky; top: 20px; }
.baj-avatar-circle img { border-radius: 50%; border: 4px solid #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.baj-stat-pill { display: inline-block; background: #333; color: #fff; padding: 5px 15px; border-radius: 20px; font-size: 0.85em; margin-top: 10px; }
.baj-section-title { font-size: 1.3em; margin-bottom: 20px; padding-bottom: 8px; border-bottom: 2px solid #333; display: inline-block; }
.baj-verified-badge { display: inline-block; padding: 4px 12px; border-radius: 4px; color: #fff; font-size: 0.7em; font-weight: bold; text-transform: uppercase; margin-bottom: 15px; letter-spacing: 0.5px; }

@media (max-width: 900px) { .baj-profile-header { flex-direction: column; } .baj-trust-sidebar { width: 100%; } }

/* --- 10. TASK DETAILS UI (Migrated from templates/task-details-ui.php) --- */
.single-baj_task .entry-content,
.single-baj_task .wp-block-group.is-layout-constrained {
    max-width: 1200px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
}

.baj-top-specs-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 60px !important;
    align-items: flex-start !important;
    margin-bottom: 50px !important;
    width: 100% !important;
}

.baj-specs-table-container { 
    flex: 2 !important; 
    min-width: 2; 
}

.baj-sidebar { 
    flex: 1 !important; 
    min-width: 320px !important;
    max-width: 400px;
    padding: 25px; 
    background: #f9f9f9; 
    border: 1px solid #eee; 
    border-radius: 8px; 
}

.baj-full-width-section {
    width: 100%;
    clear: both;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

@media (max-width: 900px) {
    .baj-top-specs-row { flex-direction: column !important; }
    .baj-sidebar { width: 100% !important; max-width: none !important; }
}

/* --- 11. REGISTRATION FORM UI (Migrated from class-baj-registration.php) --- */
.baj-reg-section { margin-top: 20px; padding: 15px; border: 1px solid #ddd; background: #f9f9f9; }
.baj-form-row { display: flex; gap: 20px; margin-bottom: 10px; }
.baj-form-row p { flex: 1; margin: 0; }
.baj-form label { font-weight: bold; font-size: 0.9em; }
.baj-form input, .baj-form select { width: 100%; padding: 8px; box-sizing: border-box; }
.hidden-section { display: none; }
.baj-hp-wrap { display: none !important; visibility: hidden !important; }
.baj-consent-row { margin-top: 20px; display: flex; align-items: flex-start; gap: 10px; }
.baj-consent-row input { width: auto !important; margin-top: 4px; }
.baj-consent-row label { font-weight: normal; font-size: 0.9em; line-height: 1.4; }

/* --- 12. MY SETTINGS UI (Migrated from templates/my-settings.php) --- */
.baj-profile-edit-section { margin-bottom: 40px; padding-bottom: 30px; border-bottom: 2px solid #eee; }
.baj-settings-wrapper label { font-weight: 600; margin-bottom: 5px; display: inline-block; }
.baj-visibility-toggle { font-size: 0.8em; color: #666; font-weight: normal !important; margin-top: 4px; display: block; }
.baj-checkbox-label { display: block !important; margin-bottom: 5px; padding: 4px 8px; border-radius: 4px; transition: background 0.2s; cursor: pointer; }
.baj-checkbox-label:hover { background-color: #f0f0f0; }
.baj-parent-cat { margin-top: 15px !important; font-size: 1.1em; }
.baj-sub-cat { margin-left: 30px !important; padding-left: 5px; border-left: 2px solid #eee; color: #666; }
input.baj-readonly { background-color: #f5f5f5 !important; color: #777 !important; cursor: not-allowed !important; border: 1px solid #ddd !important; }

/* --- 13. SHARE BUTTONS UI --- */
.baj-task-share-module {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.baj-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.baj-share-btn {
    display: inline-block;
    padding: 8px 15px;
    font-size: 0.85em;
    font-weight: bold;
    text-decoration: none;
    color: #fff !important;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.baj-share-btn:hover { opacity: 0.8; }

.baj-share-fb { background-color: #1877F2; }
.baj-share-x { background-color: #000000; }
.baj-share-wa { background-color: #25D366; }
.baj-share-msg { background-color: #0084FF; }
.baj-share-copy { background-color: #7f8c8d; }

/* --- 14. RICH TEXT ENFORCEMENT --- */
/* Forces Theme to render user-generated HTML properly */
.baj-rich-text {
    word-wrap: break-word;
}

.baj-rich-text ul {
    list-style-type: disc !important;
    margin-left: 25px !important;
    padding-left: 0 !important;
}

.baj-rich-text ol {
    list-style-type: decimal !important;
    margin-left: 25px !important;
    padding-left: 0 !important;
}

.baj-rich-text li {
    display: list-item !important;
    margin-bottom: 5px !important;
}

.baj-rich-text u, 
.baj-rich-text span[style*="underline"] {
    text-decoration: underline !important;
}

.baj-rich-text b,
.baj-rich-text strong {
    font-weight: bold !important;
}

.baj-rich-text i,
.baj-rich-text em {
    font-style: italic !important;
}

/* --- 15. USER DASHBOARD UI --- */
.baj-dashboard-wrapper { 
    display: flex; 
    gap: 30px; 
    align-items: flex-start; 
    margin-bottom: 50px; 
}
.baj-dash-sidebar { 
    width: 250px; 
    flex-shrink: 0; 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}
.baj-dash-tab { 
    padding: 15px 20px; 
    background: #fdfdfd; 
    border: 1px solid #eee; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: all 0.2s; 
    text-align: left; 
}
.baj-dash-tab:hover { 
    background: #f5f5f5; 
}
.baj-dash-tab.active { 
    background: var(--baj-theme-accent, #C58EE1); 
    color: #fff; 
    border-color: var(--baj-theme-accent, #C58EE1); 
}
.baj-dash-content { 
    flex: 1; 
    background: #fff; 
    border: 1px solid #eee; 
    border-radius: 8px; 
    padding: 30px; 
    min-height: 500px; 
    overflow-x: hidden;
}
.baj-dash-pane { 
    display: none; 
}
.baj-dash-pane.active { 
    display: block; 
    animation: bajFadeIn 0.3s ease; 
}

.baj-flag-review-btn {
    background: transparent;
    border: 1px solid #d32f2f;
    color: #d32f2f;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9em;
    line-height: 1.2;
    padding: 8px 12px;
    min-height: 44px;
    border-radius: 6px;
}

.baj-post-task-form .baj-post-row {
    display: flex;
    gap: 20px;
    width: 100%;
}

.baj-post-task-form .baj-post-col {
    flex: 1;
}

@media (max-width: 768px) {
    .baj-dashboard-wrapper { flex-direction: column; }
    .baj-dash-sidebar { width: 100%; flex-direction: column; flex-shrink: 1; gap: 8px; }
    .baj-dash-tab { width: 100%; text-align: left; padding: 12px 15px; font-size: 0.95em; }
    .baj-top-specs-row { gap: 20px !important; }
    
    .baj-my-tasks-wrapper,
    .baj-my-bids-wrapper,
    .baj-table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .baj-table {
        min-width: 550px;
        font-size: 0.9em;
    }
    
    .baj-table th,
    .baj-table td {
        padding: 10px 8px;
        word-break: normal;
    }
}

body.baj-modal-open {
    overflow: hidden !important;
}

.baj-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(3px);
}

.baj-modal-panel {
    width: min(92vw, 460px);
    max-height: 90vh;
    overflow-y: auto;
    margin: 5vh auto;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

#baj-flag-modal > div,
#baj-pm-flag-modal > div,
#baj-review-flag-modal > div,
#baj-user-flag-modal > div,
#baj-rating-modal > div,
#baj-end-chat-modal > div {
    width: min(92vw, 460px) !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    margin: 5vh auto !important;
}

.baj-modal-overlay > .baj-modal-panel {
    width: min(92vw, 460px) !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    margin: 5vh auto !important;
}

.baj-entry-modal-panel {
    position: relative;
    padding: 22px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.25);
}

.baj-entry-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
}

.baj-entry-copy {
    margin: 8px 0 16px;
    color: #555;
}

.baj-entry-login-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.baj-entry-login-form input {
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    padding: 9px 10px;
}

.baj-entry-login-form button {
    margin-top: 8px;
}

.baj-entry-feedback {
    min-height: 22px;
    margin-top: 10px;
    font-size: 0.92rem;
}

.baj-entry-feedback.is-error {
    color: #b71c1c;
}

.baj-entry-feedback.is-success {
    color: #1b5e20;
}

.baj-entry-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}

.baj-entry-look-around {
    border: 0;
    background: transparent;
    color: #1f5a96;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.baj-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #888;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.baj-modal-title {
    margin: 0 0 8px;
}

.baj-modal-copy {
    margin: 0 0 16px;
    color: #666;
    font-size: 0.9em;
}

.baj-modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.baj-modal-choice-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.baj-modal-field {
    margin: 0;
}

.baj-modal-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
}

.baj-modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.baj-modal-submit {
    width: 100%;
    background: #d32f2f;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
}

.baj-modal-helper {
    margin: 0;
    font-size: 0.8em;
    color: #888;
}

.baj-flag-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
    color: #d32f2f;
    font-size: 0.8em;
    line-height: 1.4;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-shadow: none;
}

.baj-flag-action-btn:hover,
.baj-flag-action-btn:focus {
    color: #b71c1c;
    background: none;
    border: none;
    box-shadow: none;
}

.baj-flag-action-btn.is-block {
    display: block;
    width: 100%;
    margin-top: 25px;
}

.baj-flag-action-btn .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

#close-flag-modal,
#close-pm-modal,
#close-review-flag-modal,
#close-rating-modal,
#close-end-chat-modal,
.close-modal {
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 600px) {
    .baj-my-tasks-wrapper,
    .baj-my-bids-wrapper,
    .baj-table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .baj-table {
        min-width: 550px;
    }

    .baj-table th,
    .baj-table td {
        padding: 10px 8px;
    }

    .baj-top-specs-row {
        gap: 20px !important;
        margin-bottom: 25px !important;
    }

    .baj-sidebar {
        min-width: 0 !important;
        padding: 16px !important;
    }

    .baj-form-row {
        flex-direction: column;
        gap: 10px;
    }

    .baj-post-task-form .baj-post-row {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .baj-post-task-form .baj-post-col {
        min-width: 0;
    }

    .baj-dashboard-wrapper {
        gap: 15px;
    }

    .baj-dash-sidebar {
        width: 100% !important;
        flex-shrink: 1 !important;
        gap: 6px !important;
        flex-direction: column !important;
    }

    .baj-dash-tab {
        min-width: 0;
        padding: 12px 10px;
        font-size: 0.9em;
        width: 100%;
        text-align: left;
    }

    .baj-dash-content {
        padding: 18px;
        min-height: 0;
        overflow-x: hidden;
    }

    .baj-messaging-wrapper {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .baj-messaging-wrapper .baj-conversations-list {
        min-width: 0 !important;
        max-width: none !important;
        border-right: 0 !important;
        border-bottom: 1px solid #ddd;
        padding-right: 0 !important;
        padding-bottom: 12px;
    }

    .baj-messaging-wrapper .baj-chat-window {
        min-width: 0 !important;
        min-height: 360px !important;
        padding: 15px !important;
    }

    #baj-chat-container #baj-chat-history {
        max-height: min(calc(100dvh - 300px), calc(100vh - 280px)) !important;
    }

    #baj-chat-input-area > div {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    #baj-msg-input {
        height: 64px !important;
    }

    .baj-flag-review-btn {
        width: 100%;
        text-align: center;
    }

    .baj-entry-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .baj-entry-actions .button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .baj-task-grid,
    .baj-task-columns {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .baj-carousel-item {
        width: 88vw;
        max-width: none;
    }

    .baj-share-btn {
        flex: 1 1 calc(50% - 10px);
        text-align: center;
    }
}

/* --- Brand Sweep --- */
body {
    background: var(--baj-color-background);
    color: var(--baj-color-text);
}

.baj-card,
.baj-parent-group,
.baj-sidebar,
.baj-dash-content,
.baj-chat-window,
.baj-trust-card,
.baj-profile-rating-card,
.baj-rating-module,
.baj-modal-panel,
.baj-notify-dropdown-menu {
    background: var(--baj-color-surface) !important;
    border-color: var(--baj-color-border) !important;
    color: var(--baj-color-text);
}

.baj-card,
.baj-table th,
.baj-table td,
.baj-elaborate-table tr td,
.baj-full-width-section,
.baj-profile-edit-section,
.baj-task-share-module,
.baj-notify-dropdown-menu,
.baj-messaging-wrapper .baj-conversations-list,
.baj-chat-window {
    border-color: var(--baj-color-border) !important;
}

.baj-card {
    border-color: var(--baj-color-primary) !important;
}

.baj-card:hover,
.baj-dash-tab:hover,
.baj-load-chat-btn:hover,
.baj-notify-dropdown-menu .baj-note-link:hover {
    background: var(--baj-color-primary-soft) !important;
}

.baj-dash-tab.active,
.button.button-primary,
.wp-block-button__link.wp-element-button,
#baj-send-msg-btn,
#baj-entry-login-btn,
.baj-save-template-btn,
.baj-modal-actions .button-primary,
.baj-confirm-end-chat-btn[data-completed='1'] {
    background: var(--baj-color-primary) !important;
    border-color: var(--baj-color-primary) !important;
    color: #fff !important;
}

.button-danger,
.baj-modal-submit,
.baj-flag-review-btn,
.baj-flag-action-btn,
#baj-end-chat-btn,
.baj-confirm-end-chat-btn[data-completed='0'] {
    color: var(--baj-color-accent) !important;
    border-color: var(--baj-color-accent) !important;
}

.button-danger,
.baj-modal-submit {
    background: var(--baj-color-accent) !important;
    color: #fff !important;
}

.baj-flag-review-btn,
#baj-end-chat-btn,
.baj-confirm-end-chat-btn[data-completed='0'] {
    background: transparent !important;
}

.baj-stat-pill,
.baj-carousel-btn,
.baj-share-copy,
.baj-unread-badge {
    background: var(--baj-color-primary) !important;
    color: #fff !important;
    border-color: var(--baj-color-primary) !important;
}

.baj-share-btn {
    background: var(--baj-color-secondary) !important;
    color: var(--baj-color-text) !important;
}

.baj-share-btn:hover {
    background: var(--baj-color-primary) !important;
    color: #fff !important;
}

.status-open {
    background: var(--baj-color-secondary-soft) !important;
    color: var(--baj-color-text) !important;
}

.status-pending {
    background: var(--baj-color-accent-soft) !important;
    color: var(--baj-color-accent) !important;
}

.status-closed {
    background: var(--baj-color-primary-soft) !important;
    color: var(--baj-color-primary) !important;
}

.success,
.baj-alert.success {
    background: var(--baj-color-secondary-soft) !important;
    border: 1px solid var(--baj-color-secondary) !important;
    color: var(--baj-color-text) !important;
}

.error,
.baj-alert.error {
    background: var(--baj-color-accent-soft) !important;
    border: 1px solid var(--baj-color-accent) !important;
    color: var(--baj-color-accent) !important;
}

.baj-bidding-module,
.baj-reg-section,
.baj-random-review,
#baj-chat-history,
.baj-messaging-wrapper .baj-chat-window,
.baj-messaging-wrapper .baj-load-chat-btn,
.baj-current-avatar,
.baj-modal-textarea,
.baj-review-text,
input.baj-readonly {
    background: var(--baj-color-background) !important;
    border-color: var(--baj-color-border) !important;
}

.baj-random-review {
    border-left-color: var(--baj-color-primary) !important;
    color: var(--baj-color-muted) !important;
}

.baj-avg-stars,
.baj-star-rating input:checked ~ label,
.baj-star-rating label:hover,
.baj-star-rating label:hover ~ label,
.baj-star-rating label,
.baj-rating-stars,
.baj-review-card .baj-avg-stars {
    color: var(--baj-color-accent) !important;
}

.baj-star-rating label {
    opacity: 0.45;
}

.baj-star-rating input:checked ~ label,
.baj-star-rating label:hover,
.baj-star-rating label:hover ~ label {
    opacity: 1;
}

.baj-attr-label,
.baj-visibility-toggle,
.msg-meta,
.baj-modal-copy,
.baj-modal-helper,
.baj-entry-copy,
.baj-entry-feedback,
.baj-notify-dropdown-menu .baj-note-link small {
    color: var(--baj-color-muted) !important;
}

.baj-attr-value,
.baj-section-title,
.baj-notify-dropdown-menu .baj-note-link,
.baj-load-chat-btn,
.baj-current-avatar,
.baj-rich-text,
.baj-modal-title {
    color: var(--baj-color-text) !important;
}

.baj-section-title,
.baj-parent-title,
.baj-dashboard-wrapper h3,
.baj-dashboard-wrapper h4,
.baj-profile-container h1,
.baj-profile-container h3,
.baj-profile-container h4 {
    border-color: var(--baj-color-primary) !important;
}

.msg-me .bubble-content {
    background: var(--baj-color-primary-soft) !important;
    color: var(--baj-color-text) !important;
}

.msg-them .bubble-content {
    background: var(--baj-color-secondary-soft) !important;
    color: var(--baj-color-text) !important;
}

.baj-modal-close,
.baj-entry-modal-close {
    color: var(--baj-color-muted) !important;
}

.baj-entry-look-around,
.baj-rich-text a,
.baj-profile-container a,
.baj-messaging-wrapper a,
.baj-dashboard-wrapper a,
.single-baj_task a {
    color: var(--baj-color-primary);
}

.baj-entry-look-around:hover,
.baj-rich-text a:hover,
.baj-profile-container a:hover,
.baj-messaging-wrapper a:hover,
.baj-dashboard-wrapper a:hover,
.single-baj_task a:hover {
    color: var(--baj-color-accent);
}