:root {
    --primary-color: #6c5ce7;
    --primary-hover: #5b4dc7;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

h1 i {
    margin-right: 10px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    margin-bottom: 20px;
}

/* Budget status */
.budget-status {
    background: linear-gradient(to right, #a18cd1, #fbc2eb);
    color: white;
}

.budget-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.progress-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: white;
    border-radius: 10px;
    transition: width 0.5s ease;
}

#budget-warning {
    color: white;
    padding: 8px;
    border-radius: 6px;
    background-color: rgba(255, 0, 0, 0.3);
    text-align: center;
    font-weight: 500;
}

.hidden {
    display: none;
}

/* Form */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.error-message {
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 5px;
    min-height: 20px;
}

/* Expenses list */
.expense-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#category-filter {
    padding: 8px;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    animation: fadeIn 0.3s ease;
}

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

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

.expense-details {
    display: flex;
    flex-direction: column;
}

.expense-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.expense-category {
    font-size: 13px;
    color: var(--text-light);
    display: inline-block;
    padding: 3px 8px;
    background-color: #eee;
    border-radius: 20px;
}

.expense-amount {
    font-weight: 600;
    color: var(--danger-color);
}

.delete-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.3s;
}

.delete-btn:hover {
    color: var(--danger-color);
}

.no-expenses {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
}

/* Category summary */
.category-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.category-bar {
    height: 10px;
    background-color: #eee;
    border-radius: 5px;
    margin-top: 5px;
    position: relative;
    overflow: hidden;
}

.category-progress {
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    transition: width 0.5s ease;
}

.Food { background-color: #FF6384; }
.Transport { background-color: #36A2EB; }
.Utilities { background-color: #FFCE56; }
.Entertainment { background-color: #4BC0C0; }
.Shopping { background-color: #9966FF; }
.Health { background-color: #FF9F40; }
.Other { background-color: #C9CBCF; }

/* Back link styling */
.back-link {
  display: inline-block;
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
  margin-top: 5px;
  margin-bottom: 15px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: #2196f3; /* Use your project's primary color */
}

.back-link i {
  margin-right: 5px;
}

/* Responsive */
@media (max-width: 600px) {
    .expense-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .expense-details {
        margin-bottom: 10px;
    }
    
    .expense-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .expense-amount {
        margin-top: 10px;
    }
    
    .delete-btn {
        margin-top: 10px;
        align-self: flex-end;
    }
}
