/* Balance Page Styles */
.balance-main {
    background-color: #1d1d1b;
    color: #dadada;
    min-height: 100vh;
    font-family: 'Inter', Arial, sans-serif;
    max-width: 990px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 32px;
}

/* Balance Section */
.balance-section {
    margin-bottom: 40px;
}

.balance-page-title {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 24px;
}

/* Tab Buttons */
.balance-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
}

.balance-tab {
    padding: 12px 24px;
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: #dadada;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
}

.balance-tab:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.balance-tab:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.balance-tab-active {
    background: linear-gradient(103.58deg, #6B2AD1 -40.43%, #ACA3E8 52.24%, #37166B 152.63%);
    color: #1D1D1B;
}

.balance-tab:not(.balance-tab-active):hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Balance Display Card */
.balance-card {
    background-color: #3c3545;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.balance-card-icon {
    color: #6B2AD1;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.balance-card-amount {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    flex-grow: 1;
}

.balance-card-arrow {
    color: #6B2AD1;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.balance-card-arrow:hover {
    transform: translateX(4px);
}

/* Amount Input Card */
.balance-input-card {
    background-color: #3c3545;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.balance-input {
    width: 100%;
    padding: 12px 16px;
    background-color: transparent;
    border: none;
    border-radius: 8px;
    color: #dadada;
    font-size: 16px;
    outline: none;
}

.balance-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.balance-input:focus {
    outline: none;
}

/* Submit Button */
.balance-submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(103.58deg, #6B2AD1 -40.43%, #ACA3E8 52.24%, #37166B 152.63%);
    color: #1D1D1B;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.balance-submit-btn:hover {
    background: linear-gradient(103.58deg, #5a1fb8 -40.43%, #9b8dd4 52.24%, #2d1254 152.63%);
    transform: translateY(-2px);
}

/* History Section */
.history-section {
    margin-top: 40px;
}

.history-title {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 24px;
}

/* Filter Panel */
.filter-panel {
    margin-bottom: 24px;
}

.filter-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-icon-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px;
    color: #dadada;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.filter-icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.filter-button {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 21px 42ааpx;
    color: rgba(218, 218, 218, 1);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
    font-weight: 700;
}

.filter-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.filter-button.active {
    background-color: #6B2AD1;
    color: #ffffff;
    border-color: #6B2AD1;
}

/* Date Filters */
.date-filters {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-input-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 220px;
    min-height: 44px;
    background: #1D1D1B;
    border: 1px solid rgba(172, 163, 232, 0.5);
    border-radius: 12px;
    padding: 0 6px 0 14px;
    gap: 0;
}

.date-input-wrapper:focus-within {
    border-color: #ACA3E8;
    box-shadow: 0 0 0 1px rgba(172, 163, 232, 0.3);
}

.date-input-field {
    flex: 1;
    min-width: 0;
    height: 36px;
    background: transparent;
    border: none;
    padding: 0 8px 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    outline: none;
}

.date-input-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.date-input-field::-webkit-calendar-picker-indicator {
    display: none;
    appearance: none;
}

.date-calendar-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin: 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(103.58deg, #6B2AD1 -40.43%, #ACA3E8 52.24%, #37166B 152.63%);
    border: none;
    border-radius: 10px;
    color: #1D1D1B;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.date-calendar-btn:hover {
    opacity: 0.9;
}

.clear-date-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(103.58deg, #6B2AD1 -40.43%, #ACA3E8 52.24%, #37166B 152.63%);
    border: none;
    border-radius: 50%;
    color: #1D1D1B;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.clear-date-btn:hover {
    opacity: 0.9;
}

.clear-date-btn:disabled {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.35);
    cursor: not-allowed;
    opacity: 1;
}

.clear-date-btn:disabled:hover {
    opacity: 1;
}

.date-separator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Transaction List */
.history-list {
    background-color: transparent;
    border-radius: 12px;
    overflow: hidden;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: #3c3545;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: background-color 0.2s ease;
}

.transaction-item:last-child {
    margin-bottom: 0;
}

.transaction-item:hover {
    background-color: rgba(60, 53, 69, 0.8);
}

.transaction-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.transaction-type {
    font-weight: 600;
    color: #ffffff;
    font-size: 16px;
}

.transaction-description {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.transaction-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.transaction-amount {
    font-weight: 700;
    font-size: 16px;
}

.amount-positive {
    color: #4caf50;
}

.amount-negative {
    color: #f44336;
}

.transaction-status {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background-color: #3c3545;
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1001;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #dadada;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-current-filter {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.current-filter-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.current-filter-value {
    font-size: 14px;
    color: #ffffff;
    font-weight: 500;
}

.modal-body {
    margin-bottom: 20px;
}

.modal.amount-modal .modal-header,
.modal.amount-modal .modal-footer,
.modal.amount-modal .modal-current-filter {
    display: none;
}

.modal.amount-modal .modal-content {
    padding: 24px;
    background: #453F4D;
    max-width: 640px;
    border-radius: 24px;
}

.modal.amount-modal .modal-body {
    margin-bottom: 0;
}

.amount-filter {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.amount-filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.amount-reset-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(103.58deg, #6B2AD1 -40.43%, #ACA3E8 52.24%, #37166B 152.63%);
    color: #1D1D1B;
    font-weight: 600;
    cursor: pointer;
}

.amount-close-btn {
    background: none;
    border: none;
    color: #dadada;
    font-size: 22px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.amount-filter-title {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

.amount-filter-inputs {
    display: flex;
    align-items: center;
    gap: 16px;
}

.amount-filter-input {
    flex: 1;
    padding: 16px 18px;
    border-radius: 18px;
    border: none;
    background: #1D1D1B;
    color: #dadada;
    font-size: 16px;
}

.amount-filter-input::placeholder {
    color: rgba(218, 218, 218, 0.7);
}

.amount-filter-separator {
    color: rgba(218, 218, 218, 0.6);
    font-size: 24px;
    font-weight: 600;
}

.amount-filter-empty {
    background: #E5E5E5;
    color: #2B2B2B;
    border-radius: 18px;
    padding: 16px 18px;
    text-align: center;
    font-weight: 700;
    font-size: 18px;
}

.amount-apply-btn {
    width: 100%;
    border: none;
    border-radius: 18px;
    padding: 16px 18px;
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    background: linear-gradient(103.58deg, #6B2AD1 -40.43%, #ACA3E8 52.24%, #37166B 152.63%);
    color: #1D1D1B;
    transition: opacity 0.2s ease;
}

.amount-apply-btn:disabled {
    background: #E5E5E5;
    color: #2B2B2B;
    cursor: default;
    opacity: 1;
}

.filter-option {
    margin-bottom: 12px;
}

.filter-option-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.filter-option-label:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.filter-option-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.filter-option-label span {
    color: #dadada;
    font-size: 14px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn-primary {
    background: linear-gradient(103.58deg, #6B2AD1 -40.43%, #ACA3E8 52.24%, #37166B 152.63%);
    color: #1D1D1B;
}

.modal-btn-primary:hover {
    background: linear-gradient(103.58deg, #5a1fb8 -40.43%, #9b8dd4 52.24%, #2d1254 152.63%);
}

.modal-btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: #dadada;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .balance-main {
        max-width: 100%;
        padding: 24px 20px !important;
    }
}

@media (max-width: 768px) {
    .balance-main {
        padding: 16px !important;
    }
    
    .balance-page-title,
    .history-title {
        font-size: 24px;
    }
    
    .balance-tabs {
        flex-direction: column;
    }
    
    .balance-tab {
        border-radius: 8px;
        margin-bottom: 8px;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-button {
        width: 100%;
    }
    
    .date-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-input-wrapper {
        max-width: 100%;
    }
    
    .date-separator {
        display: none;
    }
    
    .transaction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .transaction-details {
        align-items: flex-start;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .balance-main {
        padding: 12px !important;
    }
    
    .balance-page-title,
    .history-title {
        font-size: 20px;
        margin-bottom: 16px;
    }
    
    .balance-card,
    .balance-input-card {
        padding: 16px;
    }
    
    .balance-submit-btn {
        padding: 14px;
        font-size: 16px;
    }
    
    .filter-controls {
        gap: 8px;
    }
    
    .filter-button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .transaction-item {
        padding: 12px 16px;
    }
    
    .transaction-type {
        font-size: 14px;
    }
    
    .transaction-description {
        font-size: 12px;
    }
    
    .transaction-amount {
        font-size: 14px;
    }
    
    .transaction-status {
        font-size: 12px;
    }
}
