/* Budget Tracker Styles */

/* Budget Tracker Container */
.budget-tracker-container {
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    float: unset;
    width: 350px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

/* Checkout Modal Budget Section */
#checkout-budget-section {
    margin-bottom: 15px;
}

#checkout-budget-section .budget-tracker-container {
    width: 100%;
    min-width: 350px;
    box-shadow: none;
}

#checkout-budget-section .budget-selector-selected {
    cursor: default;
}

#checkout-budget-section .budget-selector-selected:hover {
    border-color: #ddd;
}

/* Main Budget Tracker Widget */
.budget-tracker {
    min-width: 350px;
    background: #fff;
    border-radius: 4px;
    padding: 8px 12px;
    color: #333;
    font-size: 13px;
    border: 1px solid #ddd;
}

.budget-tracker.disabled {
    opacity: 0.5;
}

.budget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}

.budget-label {
    font-weight: 500;
}

#budget-amount {
    font-weight: 700;
    color: #4CAF50;
}

.budget-days {
    font-size: 11px;
    opacity: 0.9;
}

.budget-progress-container {
    margin-bottom: 6px;
}

.budget-progress-bar {
    height: 20px;
    background: #4CAF50;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    display: flex;
}

.budget-progress-spent {
    background: linear-gradient(90deg, #d46a6a 0%, #c85a5a 100%);
    height: 100%;
    transition: width 0.3s ease;
}

.budget-progress-cart {
    background: linear-gradient(90deg, #f7a623 0%, #e89613 100%);
    height: 100%;
    transition: width 0.3s ease;
}

.budget-details {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}

.budget-detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.budget-detail-item span {
    font-weight: 600;
    margin-top: 2px;
}

#budget-spent {
    color: #d46a6a;
}

#budget-in-cart {
    color: #f7a623;
}

#budget-available {
    color: #4CAF50;
}

#budget-remaining-text {
    color: #e89613;
    font-weight: bold;
}

/* Budget Selector Dropdown */
.budget-selector-wrapper {
    width: 100%;
    margin-bottom: 10px;
}

.budget-selector {
    position: relative;
    width: 100%;
    font-family: inherit;
    -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
}

.budget-selector-selected {
    background: #fff;
    border-radius: 4px;
    padding: 8px 12px;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #ddd;
    transition: border-color 0.2s ease;
}

.budget-selector-selected:hover {
    border-color: #aaa;
}

.budget-selector.open .budget-selector-selected {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: #aaa;
}

.budget-selector-arrow {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    order: -1;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.budget-selector-arrow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 16px solid #333;
}

.budget-selector.open .budget-selector-arrow {
    transform: rotate(180deg);
}

.budget-selector-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #aaa;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    padding: 2px 0;
}

.budget-selector.open .budget-selector-options {
    display: block;
}

.budget-selector-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: all 0.15s ease-in-out;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #333;
    margin: 1px 2px;
    border-radius: 2px;
    position: relative;
}

/* Radio button styling */
.budget-selector-radio {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    max-width: 16px;
    max-height: 16px;
    flex-shrink: 0;
    border: 2px solid #333;
    border-radius: 50%;
    margin-top: 2px;
    position: relative;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.budget-selector-radio.checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
}

.budget-selector-option:last-child {
    border-bottom: none;
}

.budget-selector-option:hover {
    background: #f8f9fa;
    border-color: #f5f5f5;
    color: #555;
    text-decoration: none;
    z-index: 1002;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-radius: 4px;
}

.budget-selector-option.selected {
    background: #e9ecef;
    border-color: #dee2e6;
    z-index: 1;
}

/* Budget selector item (used in both selected and options) */
.budget-selector-item {
    flex: 1;
    min-width: 0;
}

.budget-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 13px;
}

.budget-selector-label {
    font-weight: 500;
}

.budget-selector-amount {
    font-weight: 600;
}

.budget-selector-days {
    font-size: 11px;
}

.budget-selector-option .budget-selector-header,
.budget-selector-option .budget-selector-days {
    opacity: 1;
    color: #333;
}

.budget-selector-details {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-size: 11px;
}

.budget-selector-option .budget-selector-details {
    color: #333;
}

.budget-selector-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.budget-selector-detail span {
    font-weight: 600;
    margin-top: 1px;
}

.budget-selector-spent {
    color: #d46a6a;
}

.budget-selector-cart {
    color: #f7a623;
}

.budget-selector-available {
    color: #4CAF50;
}

/* Budget name display for dropdown items */
.budget-selector-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.budget-selector-amount {
    color: #4CAF50;
}

/* Budget Switch Modal */
#budgetSwitchModal .modal-dialog {
    min-width: 300px;
    max-width: 600px;
    width: auto;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    /*.budget-tracker {*/
    /*    min-width: 350px;*/
    /*    font-size: 12px;*/
    /*}*/
    /*.budget-selector-header {*/
    /*    font-size: 12px;*/
    /*}*/
    /*.budget-selector-details {*/
    /*    font-size: 10px;*/
    /*}*/
}

@media (max-width: 992px) {
    /*.budget-tracker {*/
    /*    min-width: 300px;*/
    /*}*/
    /*.budget-selector-selected {*/
    /*    padding: 6px 10px;*/
    /*}*/
    /*.budget-selector-option {*/
    /*    padding: 6px 10px;*/
    /*}*/
}
