:root {
    --bg-color: #000;
    --text-primary: #fff;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #fff;
    --danger: #ff453a;
    --success: #30d158;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.liquid-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.1s ease-out;
    animation: fade-in-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Reflection overlay */
.liquid-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(1200px circle at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 0.04),
            transparent 80%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.liquid-glass:hover::before {
    opacity: 1;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 60px 40px;
    text-align: center;
    animation-delay: 0.1s;
}

h1 {
    font-weight: 600;
    font-size: 2.5rem;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px 20px;
    color: #fff;
    font-size: 1rem;
    margin-bottom: 20px;
    outline: none;
    transition: background 0.2s;
}

input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

button {
    width: 100%;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

button:active {
    transform: scale(0.98);
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    border-bottom: 1px solid var(--glass-border);
}

.nav-logo {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    animation: fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sidebar {
    padding: 24px;
    height: fit-content;
}

.main-content {
    padding: 40px;
    min-height: 600px;
}

.list-item {
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

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

.list-item.active {
    background: rgba(255, 255, 255, 0.1);
}

.expense-item {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.expense-item:last-child {
    border-bottom: none;
}

.amount {
    font-weight: 700;
    font-size: 1.1rem;
}

.positive {
    color: var(--success);
}

.negative {
    color: var(--danger);
}

/* Custom Selectables */
.selectable-chip {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    user-select: none;
}

.selectable-chip:hover {
    background: rgba(255, 255, 255, 0.05);
}

.selectable-chip.selected {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.selectable-chip input {
    display: none;
}

.selectable-chip span {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Modals */
/* Dropdown Menu */
.menu-container {
    position: relative;
    display: inline-block;
}

.triple-dot-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 32px;
    /* Smaller to match other icons */
    height: 32px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background 0.2s;
}

.triple-dot-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 200px;
    background: rgba(40, 40, 40, 0.5);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 8px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.dropdown-menu.active {
    display: flex;
}

.dropdown-item {
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: background 0.2s;
    text-align: left;
    background: transparent;
    width: 100%;
}

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

.dropdown-item.danger {
    color: var(--danger);
}

.dropdown-item.danger:hover {
    background: rgba(255, 69, 58, 0.1);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(40, 40, 40, 0.5);
    width: 90%;
    max-width: 500px;
    padding: 32px;
}

#edit-members-list .list-item {
    padding: 8px 16px;
    margin-bottom: 2px;
}

#edit-members-list .list-item:last-child {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .liquid-glass::before {
        opacity: 1;
        --mouse-x: 50%;
        --mouse-y: 50%;
        animation: ambient-glow 8s infinite ease-in-out;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .container {
        margin: 20px auto;
    }

    .main-content {
        padding: 24px 16px;
    }

    h1 {
        font-size: 2rem;
    }

    .amount {
        font-size: 1rem;
    }

    .expense-item {
        padding: 16px;
    }

    .modal-content {
        padding: 24px;
    }

    /* Reduce margins for names in expense list */
    .expense-item>div:first-child>div:first-child {
        font-size: 1rem;
    }

    .expense-item>div:first-child>div:last-child {
        font-size: 0.75rem;
    }
}