* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6C63FF;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

h1 i {
    margin-right: 10px;
    color: #3498db;
}

h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.balance-section {
    text-align: center;
    margin-bottom: 40px;
}

.balance {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 10px 0 20px;
}

.income-expense {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.plus, .minus {
    padding: 20px;
    border-radius: 10px;
}

.plus {
    background: #e8f5e9;
}

.minus {
    background: #ffebee;
}

.plus h3, .minus h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.plus p {
    color: #2ecc71;
    font-size: 1.5rem;
    font-weight: bold;
}

.minus p {
    color: #e74c3c;
    font-size: 1.5rem;
    font-weight: bold;
}

.transaction-section {
    margin-bottom: 40px;
}

.transaction-list {
    max-height: 300px;
    overflow-y: auto;
}

.transaction {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 5px solid #ddd;
    transition: transform 0.2s;
}

.transaction:hover {
    transform: translateX(5px);
}

.transaction.income {
    border-left-color: #2ecc71;
}

.transaction.expense {
    border-left-color: #e74c3c;
}

.transaction-info {
    flex-grow: 1;
}

.transaction-description {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
}

.transaction-details {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.transaction-amount {
    font-weight: bold;
}

.income .transaction-amount {
    color: #2ecc71;
}

.expense .transaction-amount {
    color: #e74c3c;
}

.delete-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.transaction:hover .delete-btn {
    opacity: 1;
}

.new-transaction {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
}

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

input:focus, select:focus {
    outline: none;
    border-color: #3498db;
}

small {
    color: #7f8c8d;
    font-size: 0.8rem;
}

.btn {
    background: #3498db;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    transition: background 0.3s;
}

.btn:hover {
    background: #2980b9;
}

.analytics-section {
    margin-top: 40px;
}

.chart-container {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .income-expense {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .balance {
        font-size: 2rem;
    }

    .transaction {
        flex-direction: column;
        text-align: center;
    }

    .transaction-amount {
        margin-top: 10px;
    }

    .delete-btn {
        opacity: 1;
        margin-top: 10px;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.transaction {
    animation: slideIn 0.3s ease-out;
}

/* Chart Legend Styling */
.chart-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    background: rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

.legend-item:hover {
    transform: translateX(5px);
    background: rgba(0, 0, 0, 0.05);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-info {
    flex-grow: 1;
}

.legend-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.legend-amount {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Notification Styling */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    background: white;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.success i {
    color: var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--danger-color);
}

.notification.error i {
    color: var(--danger-color);
}

.notification i {
    font-size: 1.2rem;
}