:root {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --income-color: #10b981;
    --expense-color: #ef4444;
    --primary-btn: #3b82f6;
    --primary-btn-hover: #2563eb;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 35vw;
    height: 35vw;
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.app-container {
    width: 100%;
    max-width: 450px;
    margin: 2rem;
    padding: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.balance-container h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
    letter-spacing: -1px;
}

.summary-container {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.25rem;
    border-radius: 16px;
    margin-top: 1.5rem;
    border: 1px solid var(--glass-border);
}

.summary-box {
    flex: 1;
    text-align: center;
}

.summary-box:first-child {
    border-right: 1px solid var(--glass-border);
}

.summary-box h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

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

.income .amount { color: var(--income-color); }
.expense .amount { color: var(--expense-color); }

main h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.add-transaction {
    margin-bottom: 2rem;
}

.form-control {
    margin-bottom: 1.25rem;
}

.form-control label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-control input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.form-control input:focus {
    border-color: var(--primary-btn);
}

.btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-btn);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
}

.btn:hover { background: var(--primary-btn-hover); }
.btn:active { transform: scale(0.98); }

.list {
    list-style-type: none;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.list::-webkit-scrollbar {
    width: 4px;
}

.list::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.list li {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    border-left: 4px solid #fff;
    transition: transform 0.2s;
}

.list li:hover {
    transform: translateX(2px);
}

.list li.plus { border-left-color: var(--income-color); }
.list li.minus { border-left-color: var(--expense-color); }

.delete-btn {
    cursor: pointer;
    background: var(--expense-color);
    color: #fff;
    border: 0;
    font-size: 1.2rem;
    line-height: 1.2rem;
    padding: 0.1rem 0.4rem;
    position: absolute;
    top: 50%;
    right: -25px;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s, right 0.3s;
    border-radius: 4px;
}

.list li:hover .delete-btn {
    opacity: 1;
    right: 10px;
}
