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

/* ===================== Body ===================== */
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* ===================== App Card ===================== */
.app {
    background: white;
    width: 380px;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* ===================== Titel & Balance ===================== */
h2 {
    text-align: center;
    margin-bottom: 15px;
}

#balance {
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 20px;
}

/* ===================== Inputs ===================== */
input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
}

/* ===================== Buttons ===================== */
.buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-direction: column;
}

@media(min-width: 481px) {
    .buttons {
        flex-direction: row;
    }
}

button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s ease;
}

/* Income & Expense Buttons */
#addIncome {
    background: #4CAF50;
    color: white;
}
#addIncome:hover {
    background: #45a049;
}

#addExpense {
    background: #f44336;
    color: white;
}
#addExpense:hover {
    background: #e53935;
}

/* Toggle Chart Button */
#toggleChart {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
#toggleChart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* Theme Toggle Button */
#themeToggle {
    margin-bottom: 15px;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    background: #222;
    color: white;
}

/* ===================== List / Transactions ===================== */
ul {
    list-style: none;
    margin-top: 15px;
    padding: 0;
}

li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 10px;
    font-size: 14px;
    transition: 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

li:hover {
    transform: translateY(-2px);
}

/* Delete Button inside list */
li button {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s ease;
}

li button:hover {
    transform: scale(1.2);
}
li span {
    flex: 1;          /* Nimmt den ganzen Platz links */
}

li strong {
    margin-left: 15px; /* Abstand zwischen Beschreibung und Betrag */
}
li .income {
    color: #4CAF50; /* grün */
}

li .expense {
    color: #f44336; /* rot */
}

/* ===================== Chart ===================== */
#chartContainer canvas {
    width: 100% !important;
    max-width: 350px;
    margin: 10px auto;
    display: block;
}

/* ===================== Dark Mode ===================== */
body.dark {
    background: linear-gradient(135deg, #1e1e1e, #121212);
}

body.dark .app {
    background: #1f1f1f;
    color: white;
}

body.dark input {
    background: #2c2c2c;
    color: white;
    border: 1px solid #444;
}

body.dark li {
    background: #2c2c2c;
}

body.dark #toggleChart {
    background: linear-gradient(135deg, #444, #222);
    color: #fff;
}

body.dark #toggleChart:hover {
    background: linear-gradient(135deg, #555, #333);
}

/* ===================== Mobile Anpassung ===================== */
@media (max-width: 480px) {
    .app {
        width: 90%;
        padding: 15px;
    }

    input, #toggleChart, .buttons button {
        font-size: 14px;
        padding: 8px;
    }

    li {
        font-size: 14px;
        padding: 8px;
    }

    #balance {
        font-size: 18px;
    }

    h2 {
        font-size: 20px;
    }
}
