/* --- Base Variables & Vibrant Colors --- */
:root {
    --bg-gradient: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    --panel-bg: rgba(255, 255, 255, 0.95);
    --text-main: #2b2d42;
    --text-muted: #6c757d;
    --accent-color: #4361ee;
    --accent-gradient: linear-gradient(135deg, #4361ee 0%, #f72585 100%);
    --success-color: #2ecc71;
    --success-bg: rgba(46, 204, 113, 0.1);
    --danger-color: #ff4757;
    --danger-bg: rgba(255, 71, 87, 0.1);
    --border-radius: 16px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Layout --- */
.dashboard-container {
    display: flex;
    width: 90%;
    max-width: 1100px;
    gap: 20px;
    margin: 40px auto;
    flex: 1;
}

.input-panel, .data-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.input-panel {
    flex: 1;
    max-width: 340px;
}

.data-panel {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- Typography & Forms --- */
h2, h3 {
    margin-bottom: 20px;
    color: var(--text-main);
    font-weight: 700;
}

h1#balance {
    font-size: 36px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text; /* <-- Add this standard property */
    -webkit-text-fill-color: transparent;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select {
    padding: 12px 16px;
    border: 1px solid #e1e5eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background-color: #fff;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.btn {
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(247, 37, 133, 0.2);
}

/* --- Dashboard Specifics --- */
.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 24px;
}

.summary-cards {
    display: flex;
    gap: 16px;
}

.card {
    padding: 16px 24px;
    border-radius: 12px;
    text-align: center;
    min-width: 140px;
    border: 1px solid transparent;
}

.card h4 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card p {
    font-size: 20px;
    font-weight: 700;
    margin-top: 8px;
}

.card.income {
    background: var(--success-bg);
    border-color: rgba(46, 204, 113, 0.2);
}
.card.income p { color: var(--success-color); }

.card.expense {
    background: var(--danger-bg);
    border-color: rgba(255, 71, 87, 0.2);
}
.card.expense p { color: var(--danger-color); }

.visuals-section {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.chart-container {
    flex: 1;
    position: relative;
    height: 280px;
}

.history-container {
    flex: 1;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Custom Scrollbar for history */
.history-container::-webkit-scrollbar { width: 6px; }
.history-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* --- List Styles --- */
.list { list-style-type: none; }

.list li {
    background-color: #fff;
    border: 1px solid #f1f5f9;
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px;
    border-left: 5px solid #ddd;
    transition: transform 0.2s, box-shadow 0.2s;
}

.list li:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

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

.category-badge {
    font-size: 11px;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    margin-right: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.delete-btn {
    cursor: pointer;
    background-color: #ffe3e3;
    border: none;
    color: var(--danger-color);
    font-size: 14px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-left: 12px;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.delete-btn:hover {
    background-color: var(--danger-color);
    color: #fff;
}

/* --- HEADER --- */
.site-header {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-wrapper, .footer-wrapper {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    font-size: 22px;
    margin: 0;
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.main-nav { display: flex; gap: 30px; }

.main-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 15px;
    position: relative;
    padding: 8px 4px;
    transition: color 0.3s ease;
}

.main-nav a.active, .main-nav a:hover { color: var(--accent-color); }

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -2px;
    left: 50%;
    background-color: var(--accent-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 4px;
}

.main-nav a.active::after, .main-nav a:hover::after { width: 100%; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.avatar-container {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.theme-btn {
    background: rgba(67, 97, 238, 0.08);
    border: none;
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background: var(--accent-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

/* --- Footer --- */
.site-footer {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 24px 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.site-footer p, .footer-links a {
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
}

.footer-links { display: flex; gap: 24px; }
.footer-links a:hover { color: var(--accent-color); }

/* --- Dark Mode Overrides --- */
body.dark-theme {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --panel-bg: rgba(30, 41, 59, 0.85);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --success-bg: rgba(46, 204, 113, 0.15);
    --danger-bg: rgba(255, 71, 87, 0.15);
}

body.dark-theme .site-header,
body.dark-theme .site-footer {
    background-color: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-theme input, 
body.dark-theme select,
body.dark-theme .list li {
    background-color: #334155;
    color: var(--text-main);
    border-color: #475569;
}

body.dark-theme .category-badge {
    background: #475569;
    color: #e2e8f0;
}

body.dark-theme .avatar-container {
    background: #334155;
    border-color: #475569;
}

body.dark-theme .theme-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

body.dark-theme .theme-btn:hover {
    background: #fff;
    color: #0f172a;
}