/* ==========================================================================
   1. Base & Global Styles
   ========================================================================== */

body {
    padding-top: 70px; /* Adjusted for fixed navbar height */
    transition: background-color 0.3s, color 0.3s;
}

/* Custom scrollbar for a better look */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}


/* ==========================================================================
   2. Layout & Containers
   ========================================================================== */

.chart-container {
    position: relative;
    height: 40vh;
    width: 100%;
    max-width: 800px;
    margin: auto;
}


/* ==========================================================================
   3. Components
   ========================================================================== */

/* Cards */
.card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

/* Modals */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Forms & Inputs */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    margin-top: 8px;
}

.progress-bar {
    transition: width 0.6s ease;
}


/* ==========================================================================
   4. App-Specific Elements
   ========================================================================== */

/* Month Navigation */
.month-nav-header {
    font-weight: 500;
    font-size: 1.25rem;
}

/* Transaction List Items */
.list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-left: none;
    border-right: none;
    border-radius: 0 !important;
    transition: background-color 0.2s;
}

.list-group-item:hover {
    background-color: #f8f9fa;
}

.list-group-item:first-child {
    border-top: none;
}

.list-group-item:last-child {
    border-bottom: none;
}

.transaction-details {
    flex-grow: 1;
    margin-right: 10px;
}

.transaction-amount-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.transaction-amount {
    margin-bottom: 2px;
}

/* Floating Action Button (FAB) */
.quick-add-fab {
    z-index: 1030;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.quick-add-fab:hover {
    transform: scale(1.1);
}


/* ==========================================================================
   5. Utilities & Animations
   ========================================================================== */

.loading {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ==========================================================================
   6. Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .quick-add-fab {
        bottom: 1rem;
        right: 1rem;
    }
}
