/* Custom styles for opportunities dashboard */

/* Max width constraint for opportunity show page on large screens */
@media (min-width: 1200px) {
    .opportunity-show-container {
        max-width: 1400px;
        margin: 0 auto;
    }
}

/* Max width constraint for opportunity show page on large screens */
@media (max-width: 1815px) {
    .opportunity-show-container {
        padding-left: 50px;
    }
}

@media (min-width: 992px) {
    .opportunities-sidebar {
        background: #fff;
        border-right: 1px solid #e7eaf3;
        min-height: calc(100vh - 80px);
        overflow-y: auto;
        min-width: 290px;
        max-width: 290px;
        width: 290px;
        transition: all 0.3s ease-in-out;
        position: relative;
    }

    .opportunities-sidebar.collapsed {
        width: 0;
        min-width: 0;
        max-width: 0;
        overflow: hidden;
        border-right: none;
    }

    .sidebar-toggle-btn {
        position: fixed;
        top: 50%;
        left: 290px;
        transform: translateY(-50%);
        width: 30px;
        height: 60px;
        background: #fff;
        border: 1px solid #e7eaf3;
        border-left: none;
        border-radius: 0 8px 8px 0;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1000;
        transition: all 0.3s ease-in-out;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .opportunities-sidebar.collapsed + .sidebar-toggle-btn {
        left: 0px;
    }

    .sidebar-toggle-btn:hover {
        background: #f8f9fa;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    }

    .sidebar-toggle-btn i {
        font-size: 14px;
        color: #6c757d;
        transition: transform 0.3s ease-in-out;
    }

    .sidebar-toggle-btn.collapsed i {
        transform: rotate(180deg);
    }

    .main-content-wrapper {
        transition: all 0.3s ease-in-out;
    }

    .opportunities-sidebar.collapsed ~ .flex-grow-1 {
        padding-left: 50px;
    }
}

/* Mobile styles for sidebar */
@media (max-width: 991px) {
    .opportunities-sidebar {
        position: fixed;
        top: 80px;
        left: -290px;
        width: 290px;
        height: calc(100vh - 80px);
        background: #fff;
        border-right: 1px solid #e7eaf3;
        z-index: 1000;
        transition: left 0.3s ease-in-out;
        overflow-y: auto;
    }

    .opportunities-sidebar.show {
        left: 0;
    }

    .sidebar-toggle-btn {
        position: fixed;
        top: 50%;
        left: 20px;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        background: #fff;
        border: 1px solid #e7eaf3;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1001;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        transition: all 0.3s ease-in-out;
    }

    .sidebar-toggle-btn:hover {
        background: #f8f9fa;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .sidebar-toggle-btn i {
        font-size: 16px;
        color: #6c757d;
    }

    .sidebar-toggle-btn.collapsed i {
        transform: rotate(180deg);
    }

    /* Overlay for mobile */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease-in-out;
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

.opportunity-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.opportunity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.opportunity-type-badge {
    font-size: 0.75rem;
    font-weight: 600;
}

.deadline-warning {
    color: #e74c3c;
    font-weight: 600;
}

.deadline-soon {
    color: #f39c12;
    font-weight: 600;
}

.deadline-normal {
    color: #27ae60;
}

.search-form {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-section {
    border-bottom: 1px solid #e7eaf3;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.main-content-wrapper {
    padding-top: 1rem;
}

.content{
    color: #333!important;
}

.opportunities-header {
    background: #fff;
    border-bottom: 1px solid #e7eaf3;
}

/* Global blur styles for subscription-locked content */
.blur-content {
    filter: blur(5px);
    user-select: none;
    position: relative;
    pointer-events: none; /* Disable all clicks */
}

.subscription-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
}

.subscription-overlay button {
    white-space: nowrap;
}

.blur-wrapper {
    position: relative;
    display: inline-block;
}

.partial-blur {
    position: relative;
    display: inline-block;
}

.partial-blur .visible-part {
    display: inline;
}

.partial-blur .blur-part {
    filter: blur(5px);
    user-select: none;
    display: inline;
}

.subscription-banner {
    background: white;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e3e6f0;
}

.subscription-banner button,
.subscription-banner a {
    white-space: nowrap;
}

.clickable {
    cursor: pointer!important;
}

.dropdown-button {
    background-color: #fff !important;
    border: .0625rem solid rgba(33, 50, 91, .1);
    color: #333;
}

.btn-outline-secondary.dropdown-toggle.dropdown-toggle::after {
    background-image: url("data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='%23333' xmlns='http://www.w3.org/2000/svg' %3e%3cpath  d='M12.72,15.78a.75.75,0,0,1-.53.22h-.38a.77.77,0,0,1-.53-.22L6.15,10.64a.5.5,0,0,1,0-.71l.71-.71a.49.49,0,0,1,.7,0L12,13.67l4.44-4.45a.5.5,0,0,1,.71,0l.7.71a.5.5,0,0,1,0,.71Z' /%3e%3c/svg%3e")
}

.btn-outline-secondary.dropdown-toggle.show.dropdown-toggle::after {
    background-image: url("data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='%23333' xmlns='http://www.w3.org/2000/svg' %3e%3cpath d='M12.72,15.78a.75.75,0,0,1-.53.22h-.38a.77.77,0,0,1-.53-.22L6.15,10.64a.5.5,0,0,1,0-.71l.71-.71a.49.49,0,0,1,.7,0L12,13.67l4.44-4.45a.5.5,0,0,1,.71,0l.7.71a.5.5,0,0,1,0,.71Z' /%3e%3c/svg%3e")
}

/* Hover state (whether open or closed) */
.dropdown-toggle:hover::after {
    background-image: url("data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='%23333' xmlns='http://www.w3.org/2000/svg' %3e%3cpath d='M12.72,15.78a.75.75,0,0,1-.53.22h-.38a.77.77,0,0,1-.53-.22L6.15,10.64a.5.5,0,0,1,0-.71l.71-.71a.49.49,0,0,1,.7,0L12,13.67l4.44-4.45a.5.5,0,0,1,.71,0l.7.71a.5.5,0,0,1,0,.71Z' /%3e%3c/svg%3e");
}

.dropdown-button:focus {
    background-color: #fff !important;
    box-shadow: 0 0 1rem 0 rgba(140, 152, 164, 0.25) !important;
    border: .0625rem solid rgba(33, 50, 91, .1) !important;
    color: #333 !important;
}

.dropdown-button:hover {
    background-color: #fff !important;
    border: .0625rem solid rgba(33, 50, 91, .1) !important;
    color: #333 !important;
}

.font-weight-light {
    font-weight: 200;
}

.table-text-center {
    text-align: center;
    vertical-align: middle;
}

.table-vertical-border-striped td {
    border-left: 1px solid #dee2e6;
}

.table-vertical-border-striped td:first-child {
    border-left: none;
}

.btn-transition {
    transition: all 0.2s ease-in-out;
}

.btn-transition:hover {
    transform: translateY(-2px);
}

.opportunityTitle {
    font-size: 32px;
}

/* --- Select2 Customizations --- */
.select2-container--default .select2-results__option {
    padding: 8px 12px;
}

.select2-result-naics__title {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.select2-result-naics__description {
    font-size: 0.85em;
    color: #666;
    line-height: 1.3;
}

.select2-container .select2-selection--multiple {
    min-height: 38px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.select2-result-message {
    background-color: #f8f9fa;
    font-weight: 500;
}

.select2-container--default .select2-results__option[aria-disabled=true] {
    background-color: #f8f9fa !important;
    color: #666 !important;
    cursor: default !important;
}

/* Ensure Select2 respects Bootstrap width classes */
.select2-container {
    width: 100% !important;
}

/* --- Compact List View Styles --- */
#listView .border-bottom:nth-child(even) {
    background-color: #f8f9fa;
}

#listView .border-bottom:hover {
    background-color: #e9ecef !important;
}

#listView .border-bottom:last-child {
    border-bottom: none !important;
}

/* Ensure consistent alignment */
#listView .text-truncate {
    max-width: 50%;
}

/* Add card-like container for list view */
#listView {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

/* Clickable card effect */
.clickable-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.clickable-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

/* Ensure Save button is clickable without triggering card */
.save-btn {
    z-index: 2;
}

.saved-search-filters {
    max-height: 100px;
    overflow-y: auto;
}

.btn-ghost-secondary {
    color: #6c757d;
    background-color: transparent;
    border-color: transparent;
}

.btn-ghost-secondary:hover {
    color: #5a6268;
    background-color: #e2e6ea;
    border-color: #dae0e5;
}

/* Ensure card has minimum height for absolute positioning */
.saved-search-card {
    min-height: 120px;
}

/* --- Bookmark Icon Styles --- */
/* Default size for all bookmark icons */
.bookmark-icon {
    font-size: 1.2rem; /* Adjust this value to change the size of all bookmark icons */
    transition: all 0.2s ease-in-out;
}

/* Hover effect for bookmark icons */
.bookmark-icon:hover {
    transform: scale(1.1);
}

/* Specific sizes for different contexts (optional) */
.form-check-bookmark .bookmark-icon {
    font-size: 1.1rem; /* Slightly smaller for form check bookmarks */
}

/* Remove button bookmark icons */
.btn .bookmark-icon {
    font-size: 1rem; /* Smaller for button contexts */
}

/* --- Select2 Filter Field Styling --- */
/* Simple approach - just override the essential styling */
.select2-container--default .select2-selection--multiple {
    border: 1px solid #e3e6f0 !important;
    border-radius: 0.375rem !important;
    min-height: 38px !important;
    font-size: 0.875rem !important;
    background-color: #fff !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #e3e6f0 !important;
    border: 1px solid #d1d5db !important;
    color: #495057 !important;
    font-size: 0.875rem !important;
    margin: 2px 4px 2px 0 !important;
    padding: 2px 8px !important;
    border-radius: 0.25rem !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #6c757d !important;
    font-size: 0.875rem !important;
    margin-right: 4px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #495057 !important;
}

/* Simple placeholder positioning adjustment */
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    transform: translate(10px, 2px) !important;
    position: relative !important;
}

/* Focus state to match other fields */
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #80bdff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}