@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #000000;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --card-border: rgba(255, 255, 255, 0.15);
    --radius-lg: 28px;
    --radius-md: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    position: relative;
}

/* Top Bar */
.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: calc(env(safe-area-inset-top) + 10px) 20px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}
.month-selector button {
    background: none;
    border: none;
    color: #fff;
    padding: 4px;
}

.notification-bell {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    position: relative;
    transition: transform 0.3s;
}
.notification-bell:active {
    transform: scale(0.9);
}
.notif-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #ff453a;
    border-radius: 50%;
    display: none;
    box-shadow: 0 0 8px #ff453a;
}
.notif-dot.active {
    display: block;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 69, 58, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(255, 69, 58, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 69, 58, 0); }
}

/* App Views */
.app-content {
    height: 100dvh;
    display: none;
    flex-direction: column;
}
.app-content.active {
    display: flex;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-scroll {
    flex: 1;
    overflow-y: auto;
    padding: calc(env(safe-area-inset-top) + 60px) 20px 0;
    -webkit-overflow-scrolling: touch;
}

/* Cards Shared */
.card {
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--card-border);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.card:active {
    transform: scale(0.98);
}

.card::before {
    content: '';
    position: absolute;
    z-index: 0;
    filter: blur(50px);
    opacity: 0.6;
    border-radius: 50%;
    transition: all 0.5s ease;
}

.card > * {
    position: relative;
    z-index: 1;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 14px;
    font-weight: 500;
}

/* Main Card */
.card-main {
    background: #111;
}
.card-main::before {
    width: 150px;
    height: 150px;
    background: #4facfe;
    top: -50px;
    right: -50px;
    animation: floatGlow 8s ease-in-out infinite;
}

@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); opacity: 0.6; }
    50% { transform: translate(-20px, 20px) scale(1.2); opacity: 0.8; }
    100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
}

.balance-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.balance-amount {
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(90deg, #fff, #a1c4fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Quick Add */
.card-quick {
    background: #111;
    padding: 16px 20px;
}
.card-quick::before {
    width: 200px;
    height: 100px;
    background: #ff416c;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
}
.card-title-alt {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}
.quick-avatars {
    display: flex;
    justify-content: space-between;
}
.avatar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
}
.avatar-item:active {
    transform: scale(0.9);
}
.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid transparent;
    padding: 2px;
    background: linear-gradient(#111, #111) padding-box, linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.1)) border-box;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.avatar-circle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}
.avatar-item span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Grid Cards */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.card-spending { background: #111; }
.card-spending::before { width: 120px; height: 120px; background: #ff416c; top: -30px; left: -30px; animation: floatGlow 6s ease-in-out infinite reverse; }

.card-income { background: #111; }
.card-income::before { width: 120px; height: 120px; background: #00b09b; top: -30px; right: -30px; animation: floatGlow 7s ease-in-out infinite; }

.card-savings { background: #111; }
.card-savings::before { width: 120px; height: 120px; background: #8e2de2; top: -30px; right: -30px; animation: floatGlow 9s ease-in-out infinite alternate; }

.chart-line { width: 100%; height: 40px; margin-bottom: 12px; overflow: visible; }
.card-bottom-sm { margin-top: 10px; }
.card-bottom-sm.right-align { text-align: right; }
.sm-amount { font-size: 24px; font-weight: 600; }
.sm-label { font-size: 11px; color: var(--text-muted); }

/* Transactions list */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.section-header h3 { font-size: 16px; font-weight: 600; }

.transaction-list { list-style: none; }
.transaction-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 16px;
    margin-bottom: 8px;
    transition: transform 0.2s, background 0.2s;
    animation: slideIn 0.3s ease-out backwards;
}
.transaction-list li:hover, .transaction-list li:active {
    background: rgba(255,255,255,0.1);
    transform: scale(1.02);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.tx-info { display: flex; flex-direction: column; }
.tx-cat { font-weight: 600; font-size: 15px; }
.tx-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px;}
.tx-amount { font-weight: 700; font-size: 16px; }
.positive { color: #30d158; text-shadow: 0 0 10px rgba(48,209,88,0.4); } /* Vibrant Green */
.negative { color: #ff453a; text-shadow: 0 0 10px rgba(255,69,58,0.4); } /* Vibrant Red */

/* Form inputs */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-muted);
}
.glass-input {
    width: 100%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
}
.glass-input:focus {
    border-color: #fff;
}
.btn-small {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.recurring-row {
    display: grid;
    grid-template-columns: 1fr 1fr 100px 30px;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

/* Floating Dock */
.floating-dock {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom) + 20px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40,40,40,0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50px;
    display: flex;
    padding: 6px;
    gap: 8px;
    z-index: 100;
}

.dock-item {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s;
}
.dock-item.active { background: #fff; color: #000; }

/* Full Screen Modals */
.full-modal {
    position: fixed;
    top: 100%;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: radial-gradient(circle at center, #ff4b2b, #ff416c);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: top 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.5s ease;
}
.full-modal.active { top: 0; }

.modal-header {
    display: flex;
    align-items: center;
    padding: calc(env(safe-area-inset-top) + 20px) 24px 20px;
    gap: 16px;
}
.btn-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.2);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-header h2 { font-size: 18px; font-weight: 500; }

.recipient-selector { display: flex; align-items: center; padding: 0 30px; margin-top: 20px; gap: 16px; }
.recipient-selector img { width: 60px; height: 60px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); }
.recipient-info { display: flex; flex-direction: column; }
.clean-select { background: none; border: none; color: #fff; font-size: 20px; font-weight: 500; outline: none; }
.clean-select option { background: #333; color: #fff; }

.amount-display { text-align: center; font-size: 64px; font-weight: 300; margin: 40px 0; display: flex; justify-content: center; align-items: flex-start; }
.currency { font-size: 32px; margin-top: 12px; margin-right: 4px; }

.numpad { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 20px; }
.num-row { display: flex; justify-content: center; }
.num-btn { width: 33.33%; height: 80px; background: transparent; border: 1px solid rgba(255,255,255,0.05); color: #fff; font-size: 28px; font-weight: 300; }
.num-btn:active { background: rgba(255,255,255,0.1); }

.category-select-wrapper { padding: 0 30px 20px; }
.glass-select { width: 100%; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 16px; border-radius: 16px; font-size: 16px; outline: none; }
.glass-select option { background: #222; color: #fff; }

.btn-send {
    margin: 0 30px calc(env(safe-area-inset-bottom) + 20px);
    padding: 18px;
    border-radius: 50px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: calc(100% - 60px);
}

.toast {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #000;
    padding: 12px 24px;
    border-radius: 20px;
    font-weight: 500;
    z-index: 1000;
    transition: top 0.3s;
}
.toast.show { top: calc(env(safe-area-inset-top) + 20px); }
