/* Reset */

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

/* Body */

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f9;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

/* Container */

.container {
    width: 100%;
    max-width: 900px;
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,.1);
}

/* Header */

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #333;
}

/* Summary */

.summary {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    flex: 1;
    padding: 20px;
    border-radius: 10px;
    color: white;
    text-align: center;
}

.card h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.card p {
    font-size: 24px;
    font-weight: bold;
}

.balance-card {
    background: #3498db;
}

.income-card {
    background: #27ae60;
}

.expense-card {
    background: #e74c3c;
}

/* Form */

.transaction-form {
    margin-bottom: 35px;
}

.transaction-form h2 {
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

textarea {
    resize: vertical;
}

/* Button */

#addTransactionBtn {
    width: 100%;
    padding: 14px;
    border: none;
    background: #3498db;
    color: white;
    font-size: 17px;
    border-radius: 8px;
    cursor: pointer;
    transition: .3s;
}

#addTransactionBtn:hover {
    background: #2980b9;
}

/* History */

.history h2 {
    margin-bottom: 20px;
}

/* Transaction */

.transaction {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
}

.transaction-info h3 {
    margin-bottom: 5px;
    color: #333;
}

.transaction-info p {
    color: #666;
    margin-bottom: 5px;
}

.transaction-info small {
    color: #999;
}

.transaction-details {
    text-align: right;
}

.transaction-details span {
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: bold;
}

.income {
    color: #27ae60;
}

.expense {
    color: #e74c3c;
}

/* Delete Button */

.delete-btn {
    border: none;
    padding: 8px 15px;
    background: #e74c3c;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: .3s;
}

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

/* Responsive */

@media (max-width: 768px) {

    .summary {
        flex-direction: column;
    }

    .transaction {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .transaction-details {
        width: 100%;
        text-align: left;
    }

}