* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 600px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Header */
.header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

.balance {
    margin-top: 15px;
}

.balance-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    margin-bottom: 5px;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 600;
    color: #333;
}

/* Summary Box */
.summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 10px;
}

.summary-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border-top: 4px solid transparent;
}

.summary-item.income {
    border-top-color: #28a745;
}

.summary-item.expense {
    border-top-color: #dc3545;
}

.summary-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-amount {
    font-size: 1.8rem;
    font-weight: 600;
}

.income-amount {
    color: #28a745;
}

.expense-amount {
    color: #dc3545;
}

/* History */
.history {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.clear-all-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Poppins', Arial, sans-serif;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.clear-all-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.clear-all-btn:active {
    transform: translateY(0);
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Custom Scrollbar */
.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

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

.history-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #ccc;
    transition: transform 0.2s, box-shadow 0.2s;
    opacity: 0;
    animation: fadeIn 0.4s ease-in forwards;
}

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


.history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.history-item.income-item {
    border-left-color: #28a745;
}

.history-item.expense-item {
    border-left-color: #dc3545;
}

.history-text {
    color: #333;
    font-weight: 500;
    flex: 1;
}

.history-amount {
    font-weight: 600;
    font-size: 1.1rem;
}

.history-amount.income {
    color: #28a745;
}

.history-amount.expense {
    color: #dc3545;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.delete-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.delete-btn:active {
    transform: scale(0.95);
}

/* Form */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.transaction-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.form-group input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', Arial, sans-serif;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-hint {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', Arial, sans-serif;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
        border-radius: 15px;
    }

    .title {
        font-size: 1.5rem;
    }

    .balance-amount {
        font-size: 2rem;
    }

    .summary {
        gap: 15px;
    }

    .summary-item {
        padding: 15px;
    }

    .summary-amount {
        font-size: 1.5rem;
    }

    .history-list {
        max-height: 250px;
    }

    .section-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .title {
        font-size: 1.3rem;
    }

    .balance-amount {
        font-size: 1.8rem;
    }

    .summary {
        grid-template-columns: 1fr;
    }

    .summary-amount {
        font-size: 1.3rem;
    }

    .history-list {
        max-height: 200px;
    }
}

