:root {
    --primary-color: #8e2de2;
    --secondary-color: #4a00e0;
    --success-color: #11998e;
    --danger-color: #ef476f;
    --text-light: #f0f0f0;
    --text-muted: rgba(240, 240, 240, 0.7);
    --border-color: rgba(255, 255, 255, 0.25);
    --card-bg: rgba(255, 255, 255, 0.1);
    --font-family: 'Be Vietnam Pro', sans-serif;
    --border-radius: 12px;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInDown { from { transform: translateY(-30px) scale(0.95); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes aurora-move {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    50% { transform: translate(15vw, 10vh) rotate(180deg) scale(1.2); }
    100% { transform: translate(0, 0) rotate(360deg) scale(1); }
}

/* Base Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font-family);
    background-color: #0d0c1d;
    color: var(--text-light);
    line-height: 1.6;
    padding: 20px;
    overflow-x: hidden;
}

/* Aurora Background */
.aurora-background {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1; overflow: hidden;
}
.aurora-blob {
    position: absolute; border-radius: 50%;
    filter: blur(150px); opacity: 0.3;
}
.aurora-blob:nth-child(1) { width: 60vmax; height: 60vmax; background: var(--primary-color); top: -20%; left: -20%; animation: aurora-move 35s infinite alternate; }
.aurora-blob:nth-child(2) { width: 50vmax; height: 50vmax; background: var(--secondary-color); bottom: -20%; right: -20%; animation: aurora-move 30s infinite alternate-reverse; }
.aurora-blob:nth-child(3) { width: 40vmax; height: 40vmax; background: #00c6ff; bottom: 10%; right: 40%; animation: aurora-move 25s infinite alternate; }

.container { max-width: 1140px; margin: auto; animation: fadeIn 0.8s ease; }
header { text-align: center; margin-bottom: 3rem; }
header h1 { font-size: 3rem; font-weight: 700; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }
header p { font-size: 1.1rem; color: var(--text-muted); }
h2 { font-weight: 500; font-size: 1.2rem; margin-bottom: 0.5rem; }
h2 i { margin-right: 0.75rem; }

/* Card - Liquid Glass */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}
.card-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color); }
.card-body { padding: 1.5rem; }

/* Forms & Controls */
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-control, .btn {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 0.8rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
    width: 100%;
}
.form-control::placeholder { color: var(--text-muted); opacity: 0.8; }
.form-control:focus {
    outline: none;
    border-color: rgba(142, 45, 226, 0.8);
    box-shadow: 0 0 0 4px rgba(142, 45, 226, 0.2);
}
select option { background-color: #2a2a2a; }
.amount-wrapper small { display: none; font-weight: 500; color: var(--success-color); margin-top: 0.5rem; font-size: 0.9rem; }
#expense-form { display: grid; gap: 1.5rem; grid-template-columns: 1fr 1fr; }
.full-width { grid-column: 1 / -1; }
@media (max-width: 768px) { #expense-form { grid-template-columns: 1fr; } }


/* Buttons */
.btn { cursor: pointer; text-align: center; }
.btn-primary { background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)); border: none; }
.btn-primary:hover { box-shadow: 0 0 20px rgba(142, 45, 226, 0.5); transform: translateY(-2px); }
.btn-secondary { background: rgba(255, 255, 255, 0.15); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.25); }
.btn.large { padding: 1rem 1.5rem; font-size: 1.1rem; }
.submit-btn.loading .btn-text { opacity: 0; }
.submit-btn.loading .btn-loader { opacity: 1; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 20px; height: 20px; border: 2px solid; border-top-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; }
.delete-btn { background: none; border: none; color: var(--danger-color); font-size: 1.1rem; transition: transform 0.2s; padding: 0.5rem; }
.delete-btn:hover { transform: scale(1.2); }

/* Table */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border-color); }
th { font-weight: 500; color: var(--text-muted); }
th i { margin-right: 0.5rem; }
tr.settled { opacity: 0.5; }
tr.settled td:not(:first-child, :last-child) { text-decoration: line-through; }
.split-icon { cursor: help; color: var(--secondary-color); }

/* Modals & Checkboxes */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; }
.modal-content { background: rgba(30, 30, 30, 0.8); border: 1px solid var(--border-color); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); margin: 10% auto; padding: 2rem; border-radius: 15px; width: 90%; max-width: 500px; animation: slideInDown 0.4s ease-out; }
.close-btn { float: right; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; }
.styled-checkbox-container { display: flex; align-items: center; justify-content: center; }
.styled-checkbox-container input { display: none; }
.checkmark { height: 22px; width: 22px; background-color: rgba(255,255,255,0.2); border-radius: 4px; cursor: pointer; position: relative; }
.styled-checkbox-container input:checked ~ .checkmark { background-color: var(--success-color); }
.checkmark:after { content: ""; position: absolute; display: none; left: 7px; top: 3px; width: 5px; height: 10px; border: solid white; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.styled-checkbox-container input:checked ~ .checkmark:after { display: block; }
#split-members-list .styled-checkbox-container { justify-content: flex-start; } /* Align left in split modal */

/* Summary, Tooltips, Notifications */
#summary { margin-top: 1.5rem; }
.summary-table { width: 100%; margin: 1.5rem 0; }
.summary-table .amount-plus { color: #28f7b4; font-weight: 500; }
.summary-table .amount-minus { color: var(--danger-color); font-weight: 500; }
[data-tooltip]::after { background: #111; color: white; padding: 5px 10px; border-radius: 5px; font-size: 0.8em; white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity 0.2s; z-index: 100; position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%); }
[data-tooltip]:hover::after { opacity: 1; visibility: visible; }
#notification-container { position: fixed; top: 20px; right: 20px; z-index: 2000; }
.toast { background: linear-gradient(45deg, #232526, #414345); color: white; padding: 1rem 1.5rem; border-radius: 8px; margin-bottom: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); animation: slideInDown 0.4s ease; border-left: 4px solid; }
.toast.success { border-color: var(--success-color); }
.toast.error { border-color: var(--danger-color); }