* {
    box-sizing: border-box;
}

body {
    background-color: #f7f7f7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.4s ease-in-out;
}

/* Dark Mode */
body.dark-mode {
    background-color: #2c3e50;
    color: #ecf0f1;
}

/* Container */
.container {
    background: #fff;
    padding: 20px;
    width: 350px;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    text-align: center;
    transition: background 0.4s ease-in-out;
}

/* Dark Mode Container */
body.dark-mode .container {
    background: #34495e;
}

/* Header Title */
h1, h2 {
    font-size: 24px;
    font-weight: bold;
    animation: fadeIn 0.8s ease-in-out;
}

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

/* Balance Animation */
#balance {
    font-size: 24px;
    font-weight: bold;
    transition: transform 0.2s ease-in-out;
}

/* Income & Expense Section */
.inc-exp-container {
    display: flex;
    justify-content: space-between;
    background: #f3f3f3;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    transition: background 0.4s ease-in-out;
}

body.dark-mode .inc-exp-container {
    background: #2c3e50;
}

.inc-exp-container > div {
    flex: 1;
    text-align: center;
    padding: 10px;
}

/* Amount Colors */
.money-plus {
    color: #27ae60;
    font-weight: bold;
}

.money-minus {
    color: #c0392b;
    font-weight: bold;
}

/* Category Expenses Section */
.category-expenses {
    background: #e0e0e0;
    padding: 10px;
    border-radius: 8px;
    text-align: left;
    margin-top: 10px;
    transition: background 0.4s ease-in-out;
}

body.dark-mode .category-expenses {
    background: #3b4c5a;
}

.category-expenses p {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    border-radius: 5px;
    margin-top: 5px;
    transition: width 0.5s ease-in-out;
}

.progress-bar.food { background: #e74c3c; }
.progress-bar.travel { background: #3498db; }
.progress-bar.clothing { background: #f39c12; }
.progress-bar.groceries { background: #27ae60; }

/* Form Styles */
label {
    display: block;
    margin: 10px 0 5px;
    font-weight: bold;
}

input[type="text"],
input[type="number"],
select {
    border: 2px solid #dedede;
    border-radius: 8px;
    display: block;
    font-size: 16px;
    padding: 10px;
    width: 100%;
    transition: 0.3s;
}

input:focus {
    border-color: #3498db;
    outline: none;
    transform: scale(1.02);
}

/* Floating Add Expense Button */
.add-expense-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #7b6bf5;
    color: white;
    font-size: 18px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.add-expense-btn:hover {
    transform: scale(1.1);
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
}

/* Transaction List */
.list {
    list-style-type: none;
    padding: 0;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}

/* Transactions */
.list li {
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    transition: transform 0.2s ease-in-out;
    opacity: 0;
    animation: fadeInList 0.5s ease-in-out forwards;
}

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

.list li.plus {
    border-left: 5px solid #27ae60;
}

.list li.minus {
    border-left: 5px solid #c0392b;
}

/* Delete Button */
.delete-btn {
    cursor: pointer;
    background: #e74c3c;
    color: white;
    font-size: 18px;
    padding: 5px 10px;
    border-radius: 5px;
    transition: 0.3s;
}

.delete-btn:hover {
    background: #c0392b;
}

/* Expense Modal */
.expense-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: none;
    z-index: 10;
}

.expense-modal.show {
    display: block;
}

/* Dark Mode Toggle */
.toggle-switch {
    margin-top: 10px;
}

.toggle-switch input {
    display: none;
}

.toggle-switch label {
    cursor: pointer;
    padding: 8px 15px;
    background: #9c88ff;
    color: white;
    border-radius: 5px;
    transition: 0.3s;
}

.toggle-switch label:hover {
    background: #7b6bf5;
}

/* Responsive */
@media (max-width: 400px) {
    .container {
        width: 90%;
    }
}
