/* ===========================================
   MY WINES - BASE STYLES
   =========================================== */

.wine-filter-system, .stats-bar, #searchDiv, .card-container, #tableDiv  {
    margin-bottom: 10px !important;
}

/* DataTables Overrides */
div.dt-container.dt-empty-footer tbody > tr:last-child > * {
    border-bottom: none !important;
}

.bid-column, .offer-column {
    text-align: center !important;
}

table.dataTable > thead > tr > th, 
table.dataTable > thead > tr > td {
    border-bottom: none !important;
    font-weight: 500;
    text-align: right !important;
    color: #666 !important;
    font-family: var(--bs-body-font-family) !important;
}

table.dataTable > tbody > tr > td {
    text-align: center !important;
    font-family: sans-serif;
    font-weight: 600;
    text-align: right !important;
}

/* Wine Images */
.wine-img {
    width: 40px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Wine Name Column */
.wine-name {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding:4px 0px
}

.wine-name {
    color: black;
}

.wine-name:hover {
    color: blue;
    text-decoration: none !important;
}

/* Bid/Offer Styling */
.bid-price, .bid-qty, .offer-price, .offer-qty {
    font-size: 14px;
    text-align: center !important;
    cursor: pointer;
}

.bid-price {
    padding: 10px;
    background: #ae4747;
    border-radius: 10px 0px 0px 10px;
    color: white;
    width: 80%;
    font-weight: 600;
}

.bid-qty {
    border-left: 1px solid #ae4747;
    padding: 10px 0px;
    background: #ae474742;
    border-radius: 0px 10px 10px 0px;
    color: #ae4747;
    width: 20%;
    font-weight: 600;
}

.offer-price {
    padding: 10px;
    background: #4da03e;
    border-radius: 10px 0px 0px 10px;
    color: white;
    width: 80%;
    font-weight: 600;
}

.offer-qty {
    border-left: 1px solid #4da03e;
    padding: 10px 0px;
    background: #4da03e3b;
    border-radius: 0px 10px 10px 0px;
    color: #4da03e;
    width: 20%;
    font-weight: 600;
}

.ec-side-mkt {
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-top: 5px;
}

.ec-side-mkt.profit { color: #4da03e; }
.ec-side-mkt.loss   { color: #ae4747; }

/* Dropdown Styles */
.dropdown-menu {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.dropdown-toggle, 
#toggleFilterContainer, 
#toggleView, 
#columnVisibilityDropdown {
    background-color: #eee;
    border: 2px solid;
    border-radius: 4px;
    color: black;
    border-color: #eee;
}

.dropdown-toggle:hover, 
.dropdown-toggle:active, 
.dropdown-toggle[aria-expanded="true"], 
#toggleFilterContainer:hover, 
#toggleView:hover, 
#columnVisibilityDropdown:hover {
    border-color: #4472c4;
}

.dropdown-toggle::after {
    transition: transform 0.3s ease;
}

.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* DataTables Layout */
.dt-layout-row {
    margin: 0 !important;
    display: flex !important;
}

.dt-layout-cell {
    padding: 0;
}

.dt-scroll-body {
    height: auto !important;
}

div.dt-container.dt-empty-footer .dt-scroll-body {
    border-bottom: 0px !important;
}

/* DataTables Buttons */
div.dt-button-collection, .dt-button {
    font-size: 14px !important;
    padding: 5px !important;
}

/* Filter Container */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.selected-filters-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    justify-content: center;
}

.selected-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.selected-filter {
    padding: 5px 10px;
    background-color: #fff;
    border: 2px solid;
    border-color: #fff;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 0 14px #0000001c;
}

.selected-filter:hover {
    border-color: #4472C4;
}

/* Card View Styles */
.card-container {
    display: grid;
    flex-wrap: wrap;
    gap: 20px;
    grid-template-columns: repeat(3, minmax(360px, 1fr));
}

.card {
    width: -webkit-fill-available;
    border: none !important;
    border-radius: 10px !important;
    padding: 15px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    gap: 10px;
}

.card:hover {
    text-decoration: none !important;
}

.card-head {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    justify-content: space-between;
}

.card-img {
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 50px !important;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: black;
}

.card-title:hover {
    color: blue;
}

.card-body {
    padding: 0px !important;
    color: black;
}

.card-text {
    font-weight: 500;
    color: #666 !important;
    font-size: 14px;
}

.card-text span {
    color: black;
    font-weight: 600;
}

/* Typography */
h1, h2, p {
    margin-bottom: 0 !important;
    line-height: normal;
}

h2 {
    font-size: 26px !important;
    font-weight: 600 !important;
}

/* Form Elements */
select, input, label {
    font-size: 16px !important;
}

label {
    font-weight: 600;
}

/* Trading Desk Container */
#tradingDeskContainer {
    display: flex;
    gap: 10px;
}

/* Shown while stats are being recomputed after an add/edit/delete — a large
   portfolio can take a few seconds, so this closes the gap between the row
   flash (near-instant) and the numbers actually changing (later). */
#tradingDeskContainer.stats-updating {
    animation: statsPulse 1.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes statsPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

#toggleTradingPrices:hover {
    color: blue;
}

/* Modal Styles */
.modal {
    padding: 0px !important;
}
.modal-content {
    max-width: 500px;
    padding: 0px !important;
    background: aliceblue;
}

.modal-header {
    background: #fff;
}

.modal-body {
    display: grid;
    gap: 20px;
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

#addWineForm {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

.collapsible:hover {
    color:#4472C4
}

/* Remove Spinners from Number Inputs */
#orderPrice::-webkit-outer-spin-button, 
#orderQuantity::-webkit-outer-spin-button,
#orderPrice::-webkit-inner-spin-button, 
#orderQuantity::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#orderPrice, #orderQuantity {
    -moz-appearance: textfield;
}

/* Button Styles */
.btn-steps {
    min-width: 50px;
}

.btn-steps:hover {
    background-color: #d5e8f7 !important;
}

.btn-primary:focus {
    box-shadow: none !important;
}

.price-option {
    font-size: 14px !important;
    background-color: #eee !important;
    border-radius: 4px !important;
    border: 1px solid transparent !important;
}

.price-option:hover {
    background-color: #ccc !important;
}

.price-option:active, 
.price-option:focus {
    font-weight: 600 !important;
}

/* Text Styles */
.primary-text {
    font-size: 18px;
    color: black;
    font-weight: 600;
    font-family: sans-serif;
}

.secondary-text {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    font-family: sans-serif;
}

/* Info Trigger Styles */
.info-trigger {
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 4px;
    cursor: pointer;
    width: fit-content;
}

.info-box {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 250px;
    z-index: 10000;
}

.info-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.info-box-body {
    padding: 10px;
}

.close-btn {
    font-size: 18px;
    color: black;
    font-weight: 600;
    font-family: sans-serif;
    cursor: pointer;
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */

@media screen and (max-width: 480px) {
    .wine-name {
        max-width: 130px;
    }
    
    .offer-price, .bid-price {
        padding: 10px 5px !important;
    }
    
    .price-option {
        font-size: 12px !important;
    }
    
    .primary-text {
        font-size: 16px;
    }
    
    h2 {
        font-size: 18px !important;
    }
}

@media (max-width: 768px) {
    #tradingDeskContainer {
        display: grid;
        grid-template-columns: auto auto auto;
    }
    
    .card-container {
        grid-template-columns: auto;
    }
}

/* ===========================================
   WINE FILTER SYSTEM STYLES
   =========================================== */

/* Quick Filter Bar */
.filter-quick-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-quick-btn, .filter-quick-toggle, #viewToggleBtn, .card-manage-btn, #toggleFilters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-quick-btn:hover, .filter-quick-toggle:hover, #viewToggleBtn:hover, .card-manage-btn:hover, #toggleFilters:hover {
    background: #f8f9fa;
    border-color: #4472C4;
}

.filter-quick-btn.active, .filter-advanced-toggle.active, .filter-quick-toggle.active, #toggleFilters.active, #toggleBulkSelect.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.filter-quick-btn.active:hover, .filter-advanced-toggle.active:hover, .filter-dropdown-btn.has-filters:hover, .filter-quick-toggle.active:hover, #toggleFilters.active:hover, #toggleBulkSelect.active:hover {
    background: #0b5ed7;
    border-color: #0b5ed7;
}

.filter-advanced-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Advanced Filter Panel */
.filter-advanced-panel {
    margin-top: 12px;
    padding: 20px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filter-builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
}

.filter-builder-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

/* Filter Groups */
.filter-group {
    margin-bottom: 16px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    animation: slideDown 0.2s ease;
}

.filter-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.group-operator {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    cursor: pointer;
}

.group-operator:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.btn-remove-group {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.btn-remove-group:hover {
    background: #c82333;
}

/* Filter Conditions */
.filter-conditions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.filter-condition {
    display: flex;
    gap: 8px;
    align-items: center;
    background: white;
    border-radius: 4px;
    animation: slideDown 0.2s ease;
}

.condition-field,
.condition-operator {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.condition-field {
    flex: 2;
    min-width: 150px;
}

.condition-operator {
    flex: 1;
    min-width: 100px;
}

.condition-field:focus,
.condition-operator:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.condition-value {
    flex: 2;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.condition-value:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.btn-remove-condition {
    padding: 6px 10px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s ease;
}

.btn-remove-condition:hover {
    background: #5a6268;
}

.btn-add-condition {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px dashed #6c757d;
    border-radius: 4px;
    color: #6c757d;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-condition:hover {
    background: #f8f9fa;
    border-style: solid;
}

/* Filter Builder Actions */
.btn-add-filter-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 12px;
    transition: background 0.2s ease;
}

.btn-add-filter-group:hover {
    background: #0b5ed7;
}

.filter-builder-actions {
    display: flex;
    justify-content: flex-end;
}

/* Active Filters Bar */
.filter-active-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #DEE2E9;
    border-radius: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.active-filters-label {
    font-size: 14px;
    font-weight: 600;
    color: #084298;
}

.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #0d6efd;
    border-radius: 20px;
    font-size: 13px;
    color: #0d6efd;
    font-weight: 500;
}

.filter-chip.quick-filter {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(0,0,0,0.1);
    border: none;
    border-radius: 50%;
    color: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chip-remove:hover {
    background: rgba(0,0,0,0.2);
}

.btn-clear-all-filters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-left: auto;
    transition: background 0.2s ease;
}

.btn-clear-all-filters:hover {
    background: #c82333;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Filter System Responsive */
@media (max-width: 768px) {

    .filter-condition {
        flex-wrap: wrap;
    }

    .condition-field,
    .condition-operator,
    .condition-value {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .filter-active-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-clear-all-filters {
        margin-left: 0;
        justify-content: center;
    }
}

/* ===========================================
   CUSTOM TABLE STYLES
   Add these to the END of your my-wines.css
   =========================================== */

/* Table Toolbar */
.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: #f8f9fa;
    border-color: #4472C4;
}

.toolbar-btn i {
    font-size: 16px;
}

.table-search {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    width: 250px;
    transition: all 0.2s ease;
}

.table-search:hover {
   border-color: #0d6efd; 
}

.table-search:focus {
    outline: none;
    border-color: #0d6efd;
    width: 300px;
}

/* Sort Indicators */
.sort-indicator {
    margin-left: 5px;
    opacity: 0.3;
    font-size: 12px;
    transition: opacity 0.2s ease;
}

th:hover .sort-indicator {
    opacity: 0.6;
}

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

.column-modal-content {
    background: white;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.column-modal-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.column-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.column-modal-close:hover {
    background: #f8f9fa;
}

.column-modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.column-checkbox {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.column-checkbox:hover {
    background: #f8f9fa;
}

.column-checkbox input[type="checkbox"],
input.column-checkbox[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    accent-color: #0d6efd;
    border-width: 1px;
    border-radius: 3px;
}

.column-checkbox span {
    font-size: 14px;
    color: #333;
}

.column-checkbox input[type="checkbox"]:after,
input.column-checkbox[type="checkbox"]:after {
    left:4px !important;
    border-width: 2px !important;
}

.column-checkbox label {
    font-weight: normal;
}

/* Result Count */
#resultCount {
    padding: 10px 0px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Table Wrapper */
#tableDiv {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 10px;
    background: #fff;
}

/* Table Base Styles */
.wines-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.wines-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.wines-table thead th {
    font-weight: 500;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    user-select: none;
}

.wines-table tbody td {
    font-size: 14px;
    font-weight: 600;
}

.wines-table tbody tr {
    transition: background 0.2s ease;
    cursor: pointer;
}

.wines-table tbody tr:hover {
    background: #f8f9fa;
}

/* Hidden rows (filtered out) */
.wines-table tbody tr[style*="display: none"] {
    display: none !important;
}

.selling {
    background-color: #5d00b42e;
    padding: 3px;
    border-radius: 5px;
    color: #6b008c;
    margin: 0px 3px;
}

.recent-trade {
    background-color: #108ee91c;
    padding: 3px;
    border-radius: 5px;
    color: #2d58a5 !important;
    margin: 0px 3px;
}

/* Responsive Table */
@media (max-width: 768px) {
    .table-search {
        width: 100%;
    }

    .table-search:focus {
        width: 100%;
    }

    .column-modal-content {
        max-width: 95%;
    }
}

/* Smooth transitions */
.wines-table {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===========================================
   ENHANCED FILTER DROPDOWN STYLES
   =========================================== */

.filter-dropdown {
    position: relative;
    display: inline-block;
}

.filter-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    width:100%;
    justify-content: space-between;
}

.filter-dropdown-btn:hover, .filter-advanced-toggle:hover  {
    background: #f8f9fa;
    border-color: #4472C4;
}

.filter-dropdown-btn.active {
    border-color: #0d6efd;
    color: #0d6efd;
}

.filter-dropdown-btn.has-filters {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.filter-dropdown-btn .fa-chevron-down {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.filter-dropdown-btn.active .fa-chevron-down {
    transform: rotate(180deg);
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: white;
    color: #0d6efd;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 4px;
}

.filter-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    padding: 8px 0;
    justify-content: space-between;
}

.filter-dropdown-content.show {
    display: block;
    animation: dropdownSlide 0.2s ease;
}

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

.filter-checkbox-label {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.filter-checkbox-label:hover {
    background: #f8f9fa;
}

.filter-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #0d6efd;
    border-width: 1px;
    border-radius: 3px;
}

.filter-checkbox-label span {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.filter-checkbox-label input[type="checkbox"]:checked + span {
    color: #0d6efd;
}

.filter-checkbox-label input[type="checkbox"]:after {
    left:4px;
    border-width: 2px
}

/* Scrollbar for dropdown */
.filter-dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.filter-dropdown-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.filter-dropdown-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.filter-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Responsive */
@media (max-width: 768px) {

    h2 {
        font-size:18px !important;
    }

    .stats-bar {
    display: grid;
    justify-content: normal;
    gap: 10px
}

    .search-bar {
     width: 100%;   
}
}

.portfolio-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
  align-items: center;
}

.portfolio-tab {
  padding: 10px;
  color: #666;
  font-weight: 600;
  white-space: nowrap;
}

.portfolio-tab.active {
  background: #fff;
  border-radius: 10px;
  color: #4472C4;
}

/* Dropdown (hidden on desktop by default) */
.portfolio-dropdown {
  display: none;
  gap: 10px;
  align-items: center;
}

.portfolio-dropdown select {
  width: 100%;
  padding: 10px;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  font-weight: 600;
  color: #333;
  background: #fff;
}

.portfolio-new-btn {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  color: #4472C4;
  font-weight: 600;
  white-space: nowrap;
}

/* items inside the dropdown */
.portfolio-dd-item{
  display:block;
  width:100%;
  padding:10px 12px;
  text-align:left;
  color: black;
  text-decoration:none;
  background:transparent;
  border:0;
}

.portfolio-dd-item:hover{
  background:#f5f6f8;
  color: black;
}

.portfolio-dd-item.active{
  color:#4472C4;
  background:#fff;
}

/* open/close + chevron flip */
.filter-dropdown-btn i{
  transition: transform .2s ease;
}

.filter-dropdown.open .filter-dropdown-btn i{
  transform: rotate(180deg);
}

/* Portfolio dropdown button styling */
.portfolio-dropdown-btn {
    background: none;
    font-weight: 600;
    color: black;
    font-size: 22px;
    padding: 0;
    border: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.portfolio-dropdown-btn:hover {
    background: none
}

/* Optional: keep menu width tidy */
.portfolio-dropdown-content{
  min-width: 220px;
}

.portfolio-tabs-wrap {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  .portfolio-tabs { display: none; }
  .portfolio-dropdown { display: flex; }
}

#cardSearch {
    border-left:0px !important;
    padding: 6px 0px;
}

/* Default look (optional, just to be explicit) */
.input-group.input-group-sm .input-group-text,
.input-group.input-group-sm .form-control {
    border-color: #dee2e6;
    background: #fff;
    transition: all 0.2s ease;
    border-radius: 6px;
}

/* Remove double border between icon + input */
.input-group .input-group-text {
    border-right: 0 !important;
}
.input-group .form-control {
    border-left: 0;
}

/* Hover state for the whole group */
.input-group:hover .input-group-text,
.input-group:hover .form-control {
    border-color: #4472c4;
}

/* Focus state – when either the input OR the icon is focused */
.input-group:focus-within .input-group-text,
.input-group:focus-within .form-control {
    border-color: #4472c4;
}

/* table is invisible while JS is setting it up */
.table-init-hidden {
    visibility: hidden;      /* keeps layout height but hides content */
    /* or use opacity: 0; if you prefer */
}


@media (max-width: 768px) {

  .filter-dropdown-content {
    border-radius: 10px;
    max-height: 260px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Keep show/hide behaviour */
  .filter-dropdown-content.show {
    display: block;
    animation: none; /* optional: feels snappier in sheet */
  }

}

/* Save Filter Button */
                .btn-save-filter {
                    background: #4CAF50;
                    color: white;
                    border: none;
                    padding: 6px 12px;
                    border-radius: 4px;
                    font-size: 13px;
                    cursor: pointer;
                    display: inline-flex;
                    align-items: center;
                    gap: 5px;
                    transition: background 0.2s;
                }
                
                .btn-save-filter:hover {
                    background: #45a049;
                }
                
                /* Saved Filter Buttons */
                .saved-filter-btn {
                    display: inline-flex;
                    align-items: center;
                    gap: 6px;
                    padding: 8px 16px;
                    background: white;
                    border: 1px solid #dee2e6;
                    border-radius: 6px;
                    font-size: 14px;
                    font-weight: 500;
                    color: #666;
                    cursor: pointer;
                    transition: all 0.2s ease;
                }

                .saved-filter-btn:hover{
                    background: #f8f9fa;
                    border-color: #4472C4;
                }

                .saved-filter-btn.active:hover {
                    background: #45a049;
                    border-color: #45a049;
                    color: white;
                }
                
                .saved-filter-btn.active {
                    background: #4CAF50;
                    color: white;
                    border-color: #4CAF50;
                }
                
                .saved-filter-btn .filter-name {
                    max-width: 150px;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                }
                
                .saved-filter-btn .filter-delete {
                    display: inline-flex;
                    align-items: center;
                    justify-content: center;
                    width: 16px;
                    height: 16px;
                    color: #f44336;
                    font-size: 14px;
                    transition: background 0.2s;
                }
                
                .saved-filter-btn .filter-delete:hover {
                    background: #f44336;
                    color: white;
                }
                
                /* Save Filter Dialog */
                .save-filter-dialog {
                    position: fixed;
                    top: 50%;
                    left: 50%;
                    transform: translate(-50%, -50%);
                    background: white;
                    border-radius: 8px;
                    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
                    padding: 20px;
                    z-index: 10000;
                    min-width: 350px;
                }
                
                .save-filter-dialog-overlay {
                    position: fixed;
                    top: 0;
                    left: 0;
                    right: 0;
                    bottom: 0;
                    background: rgba(0,0,0,0.5);
                    z-index: 9999;
                }
                
                .save-filter-dialog h3 {
                    margin: 0 0 15px 0;
                    font-size: 18px;
                    color: #333;
                }
                
                .save-filter-dialog input {
                    width: 100%;
                    padding: 8px 12px;
                    border: 1px solid #ddd;
                    border-radius: 4px;
                    font-size: 14px;
                    margin-bottom: 15px;
                }
                
                .save-filter-dialog-buttons {
                    display: flex;
                    justify-content: flex-end;
                    gap: 10px;
                }
                
                .save-filter-dialog-buttons button {
                    padding: 8px 16px;
                    border: none;
                    border-radius: 4px;
                    font-size: 14px;
                    cursor: pointer;
                    transition: background 0.2s;
                }
                
                .save-filter-dialog-buttons .btn-cancel {
                    background: #f0f0f0;
                    color: #333;
                }
                
                .save-filter-dialog-buttons .btn-cancel:hover {
                    background: #e0e0e0;
                }
                
                .save-filter-dialog-buttons .btn-save {
                    background: #4CAF50;
                    color: white;
                }
                
                .save-filter-dialog-buttons .btn-save:hover {
                    background: #45a049;
                }

                .price-comparison-builder {
                    background: white;
                    border-radius: 4px;
                    padding: 15px;
                    display:grid;
                    gap:10px;
                }
                
                .comparison-price-row {
                    display: flex;
                    align-items: center;
                    gap: 10px;
                }
                
                .price-select {
                    flex: 1;
                    padding: 8px;
                    border: 1px solid #ddd;
                    border-radius: 4px;
                    font-size: 14px !important;
                    background: white;
                }
                
                .comparison-to {
                    font-size: 14px !important;
                    color: #666;
                    padding: 0 5px;
                }
                
                .range-labels {
                    display: flex;
                    justify-content: space-between;
                    font-size: 11px;
                    color: #666;
                }
                
                .range-slider-container {
                    position: relative;
                    height: 40px;
                }
                
                .range-slider-track {
                    position: absolute;
                    top: 50%;
                    left: 0;
                    right: 0;
                    height: 6px;
                    background: #ddd;
                    border-radius: 3px;
                    transform: translateY(-50%);
                }
                
                .range-slider-fill {
                    position: absolute;
                    top: 50%;
                    height: 6px;
                    background: #4CAF50;
                    border-radius: 3px;
                    transform: translateY(-50%);
                }
                
                .range-slider {
                    position: absolute;
                    width: 100%;
                    top: 50%;
                    transform: translateY(-50%);
                    background: none;
                    pointer-events: none;
                    -webkit-appearance: none;
                    -moz-appearance: none;
                }
                
                .range-slider::-webkit-slider-thumb {
                    height: 15px !important;
                    width: 15px !important;
                    border-radius: 50%;
                    background: #4CAF50 !important;
                    border: 2px solid #4CAF50 !important;
                    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
                    cursor: pointer;
                    pointer-events: all;
                    -webkit-appearance: none;
                    position: relative;
                    z-index: 1;
                }
                
                .range-slider::-moz-range-thumb {
                    height: 15px !important;
                    width: 15px !important;
                    border-radius: 50%;
                    background: #4CAF50 !important;
                    border: 2px solid #4CAF50 !important;
                    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
                    cursor: pointer;
                    pointer-events: all;
                    border: none;
                    position: relative;
                    z-index: 1;
                }
                
                .range-slider.range-min {
                    z-index: 2;
                }
                
                .comparison-display {
                    display: flex;
                    align-items: center;
                    gap: 5px;
                    font-size: 14px !important;
                    flex-wrap: wrap;
                }
                
                .range-input {
                    width: 60px;
                    padding: 4px 6px;
                    border: 1px solid #ddd;
                    border-radius: 3px;
                    font-size: 14px !important;
                    text-align: center;
                }
                
                .price1-label,
                .price2-label {
                    font-weight: 500;
                    color: #333;
                }
                
                .comparison-actions {
                    display: flex;
                    gap: 10px;
                }
                
                .btn-apply-comparison,
                .btn-remove-comparison {
                    flex: 1;
                    padding: 8px 16px;
                    border: none;
                    border-radius: 4px;
                    font-size: 14px;
                    cursor: pointer;
                    transition: all 0.2s;
                }
                
                .btn-apply-comparison {
                    background: #4CAF50;
                    color: white;
                }
                
                .btn-apply-comparison:hover {
                    background: #45a049;
                }
                
                .btn-apply-comparison:disabled {
                    background: #ccc;
                    cursor: not-allowed;
                }
                
                .btn-remove-comparison {
                    background: #f44336;
                    color: white;
                }
                
                .btn-remove-comparison:hover {
                    background: #da190b;
                }

    #searchDiv {
        justify-content: flex-end;
    }

    /* Brief highlight after a row's bid/offer/last-trade data is refreshed via AJAX */
    @keyframes rowFlash {
        0%   { background-color: #fff6d6; }
        100% { background-color: transparent; }
    }
    tr.row-flash,
    .card.row-flash {
        animation: rowFlash 1s ease-out;
    }

    /* Bulk-select checkboxes are off by default — "Bulk actions" toggles
       #tableDiv.bulk-select-active to reveal them, rather than showing them
       at all times. */
    #tableDiv:not(.bulk-select-active) .select-column {
        display: none !important;
    }

    /* Bulk actions bar — same white-card treatment as #tableDiv, so it reads
       as part of this page rather than a generic Bootstrap alert. */
    #bulkActionsBar {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        padding: 10px 15px;
        margin-bottom: 10px;
    }

    #bulkSelectedCount {
        font-size: 14px;
        font-weight: 600;
        color: #333;
    }

    .toolbar-btn-danger {
        border-color: #dc3545;
        color: #dc3545;
    }

    .toolbar-btn-danger:hover {
        background: #dc3545;
        border-color: #dc3545;
        color: #fff;
    }

/* ===========================================
   PORTFOLIO VALUE CHART
   Same chart as the Dashboard page — see dashboard/dashboard.css for the
   original of this block.
   =========================================== */

#chartContainertest-wrapper {
    position: relative;
    width: 100%;
}

#chartContainertest {
    width: 100%;
    height: 350px;
}

#portfolio-chart-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: none;
}

.range-buttons {
    text-align: center;
}

.range-btn {
    color: #666;
    padding: 3px 10px;
    margin: 0 5px;
    background-color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s;
}

.range-btn:hover {
    background-color: #e9e9e9;
}

.range-btn.active {
    background-color: #4472C4;
    color: white;
    border-color: #4472C4;
}

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