/* ===== ROOT VARIABLES ===== */
:root {
    --primary: #6c63ff;
    --danger: #ff4757;
    --success: #2ed573;
    --dark: #0f0f1a;
    --card: #1a1a2e;
    --text: #ffffff;
    --text-muted: #a0a0b8;
    --border: #2d2d4f;
    --radius: 12px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--dark);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 600px;
    width: 100%;
    background: var(--card);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* ===== HEADINGS ===== */
h1 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 24px;
}

h2 {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-muted);
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ===== BALANCE ===== */
.balance-section {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.balance-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin: 4px 0 0;
    color: var(--primary);
}

/* ===== SUMMARY ===== */
.summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.summary > div {
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.summary .income p {
    color: var(--success);
    font-size: 1.5rem;
    font-weight: 700;
}

.summary .expense p {
    color: var(--danger);
    font-size: 1.5rem;
    font-weight: 700;
}

/* ===== ADD TRANSACTION ===== */
.add-transaction {
    background: rgba(255, 255, 255, 0.02);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

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

.add-transaction label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.add-transaction input,
.add-transaction select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: 0.3s;
}

.add-transaction input:focus,
.add-transaction select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

.add-transaction button {
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.add-transaction button:hover {
    background: #5a52d9;
    transform: scale(1.02);
}

/* ===== HISTORY ===== */
.history {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 4px solid transparent;
    transition: 0.3s;
}

.transaction-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.transaction-item small {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: block;
}

.transaction-item button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
}

.transaction-item button:hover {
    color: var(--danger);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .container {
        padding: 20px;
    }

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

    .balance-section h1 {
        font-size: 2.2rem;
    }
}
