/* Custom Styles for Expense Management System */

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --info-color: #7209b7;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Sidebar */
#sidebar {
    min-height: calc(100vh - 56px);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

#sidebar .nav-link {
    color: #495057;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

#sidebar .nav-link:hover {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

#sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

#sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
}

/* Main Content */
main {
    padding-top: 20px;
    padding-bottom: 20px;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* Stats Cards */
.stat-card {
    border-radius: var(--border-radius);
    color: white;
    padding: 20px;
    text-align: center;
}

.stat-card.income {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.stat-card.expense {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
}

.stat-card.balance {
    background: linear-gradient(135deg, #007bff, #6610f2);
}

.stat-card .card-title {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stat-card .card-text {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

/* Forms */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Tables */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    font-weight: 500;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(67, 97, 238, 0.05);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Badges */
.badge {
    padding: 0.5em 0.8em;
    border-radius: 20px;
    font-weight: 500;
}

.badge-income {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.badge-expense {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.5rem;
}

/* Transaction Items */
.transaction-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: var(--transition);
}

.transaction-item:hover {
    background-color: #f8f9fa;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-amount {
    font-weight: 600;
    font-size: 1.1rem;
}

.transaction-amount.income {
    color: #28a745;
}

.transaction-amount.expense {
    color: #dc3545;
}

/* Category Colors */
.category-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

/* Modal */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
}

/* Footer */
footer {
    margin-top: auto;
    padding: 20px 0;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Responsive Design */
@media (max-width: 768px) {
    #sidebar {
        position: static;
        height: auto;
        min-height: auto;
        margin-bottom: 20px;
    }
    
    main {
        padding: 15px !important;
    }
    
    .stat-card .card-text {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        border: none;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #dee2e6;
}

.empty-state h4 {
    margin-bottom: 10px;
    color: #495057;
}

.empty-state p {
    margin-bottom: 20px;
}