/* Color Palette & Variables */
:root {
    --bg-dark: #0a0f1c;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --accent-blue: #00f0ff;
    --accent-purple: #7000ff;
    --profit-green: #00e676;
    --loss-red: #ff3d00;
    --text-main: #ffffff;
    --text-muted: #8b9bb4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Ambient Glows for 3D/Liquid effect */
.ambient-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
}
.glow-1 {
    top: -100px;
    left: -100px;
    background: var(--accent-purple);
    opacity: 0.4;
}
.glow-2 {
    bottom: 100px;
    right: -100px;
    background: var(--accent-blue);
    opacity: 0.3;
}

/* Glassmorphism Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}

/* Header */
.glass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.logo { font-size: 1.5rem; font-weight: 700; letter-spacing: 1px; }
.icon-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

/* Side Navigation */
.side-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    z-index: 100;
    border-radius: 0 24px 24px 0;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
}
.side-nav.active { left: 0; }
.profile-section { text-align: center; margin-bottom: 40px; }
.avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}
.profile-section p { color: var(--text-muted); font-size: 0.9rem; }
.nav-links { list-style: none; }
.nav-links li { margin-bottom: 20px; }
.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 15px;
}
.nav-links i { color: var(--accent-blue); width: 20px; }
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
}

/* Dashboard Layout */
.dashboard { padding: 0 20px; }
.card { padding: 25px; margin-bottom: 20px; }

/* Main Balance */
.main-balance { text-align: center; }
.main-balance h3 { color: var(--text-muted); font-size: 1rem; font-weight: 500; }
.main-balance h2 { font-size: 2.8rem; margin: 10px 0; font-weight: 700; background: linear-gradient(to right, #fff, var(--text-muted)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.remaining { font-size: 0.9rem; color: var(--accent-blue); }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.stat-card { display: flex; align-items: center; gap: 15px; padding: 15px; }
.stat-card.expense { grid-column: span 2; }
.icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.expense .icon-wrapper { background: rgba(255, 255, 255, 0.1); color: var(--text-main); }
.profit .icon-wrapper { background: rgba(0, 230, 118, 0.2); color: var(--profit-green); }
.loss .icon-wrapper { background: rgba(255, 61, 0, 0.2); color: var(--loss-red); }
.stat-card h4 { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.stat-card p { font-size: 1.2rem; font-weight: 600; }

/* Quick Action Button */
.glass-btn {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: var(--glass-bg);
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
}
.glass-btn.primary { background: linear-gradient(135deg, rgba(112, 0, 255, 0.5), rgba(0, 240, 255, 0.5)); border: none; margin-bottom: 20px; }

/* Transactions */
.transactions h3 { font-size: 1.1rem; margin-bottom: 15px; }
#transactionList { list-style: none; }
.tx-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--glass-border);
}
.tx-item:last-child { border-bottom: none; }
.tx-info h4 { font-size: 1rem; }
.tx-info p { font-size: 0.8rem; color: var(--text-muted); }
.tx-amount.positive { color: var(--profit-green); }
.tx-amount.negative { color: var(--text-main); }

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    display: flex;
    justify-content: space-around;
    padding: 15px 10px;
    border-radius: 24px;
    z-index: 50;
}
.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
}
.nav-item.active { color: var(--accent-blue); }
.nav-item i { font-size: 1.4rem; }

/* Calculator Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.calculator { width: 90%; max-width: 350px; padding: 25px; }
.calc-display {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 20px;
    font-size: 2rem;
    text-align: right;
    margin-bottom: 20px;
    overflow-x: auto;
}
.calc-keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.calc-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 18px 0;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
}
.calc-btn.operator { color: var(--accent-blue); background: rgba(0, 240, 255, 0.1); }
.calc-btn.equals { background: var(--accent-purple); color: white; grid-column: span 1; }
.calc-btn.zero { grid-column: span 2; }
.close-modal { margin-top: 20px; background: rgba(255,255,255,0.1); }

/* --- APPEND THESE STYLES TO YOUR EXISTING CSS --- */

/* Modal Content Formatting */
.modal-content {
    width: 90%;
    max-width: 400px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.modal-content h3 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

/* Glass Inputs for Forms */
.glass-input {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 15px;
    outline: none;
    transition: border 0.3s ease;
}
.glass-input:focus {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.1);
}
.glass-input option {
    background: var(--bg-dark); /* Fallback for select dropdowns */
    color: var(--text-main);
}

/* Developer Info Section */
.about-content {
    text-align: center;
}
.version {
    color: var(--accent-blue);
    font-size: 0.9rem;
    margin-bottom: 20px;
}
.dev-info {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    text-align: left;
}
.dev-info h4 {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.dev-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-purple);
    margin-bottom: 10px;
}
.dev-info p {
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dev-info i {
    color: var(--text-muted);
}


/* --- NEW STYLES FOR SPA & BRAINS --- */

/* View Routing System */
.view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}
.view.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Small Buttons & Danger Button */
.small-btn {
    padding: 8px 12px;
    width: auto;
    border-radius: 8px;
}
.glass-btn.danger {
    background: rgba(255, 61, 0, 0.2);
    border-color: rgba(255, 61, 0, 0.4);
    color: var(--loss-red);
}

/* Budget Progress Bar */
.budget-tracker-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.progress-container {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 10px;
    transition: width 0.5s ease, background 0.5s ease;
}
.progress-bar.danger {
    background: var(--loss-red);
}

/* Virtual Credit Card Styling */
.virtual-card {
    background: linear-gradient(135deg, rgba(112,0,255,0.6), rgba(0,240,255,0.4));
    border-radius: 20px;
    padding: 25px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 20px;
}
.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.card-number {
    font-size: 1.4rem;
    letter-spacing: 3px;
    margin-bottom: 20px;
    font-family: 'Courier New', Courier, monospace;
}
.card-bottom {
    display: flex;
    justify-content: space-between;
}
.card-bottom p {
    font-size: 0.7rem;
    text-transform: uppercase;
    opacity: 0.8;
}

/* ==========================================
   SPLASH SCREEN & LIQUID ANIMATIONS
   ========================================== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000; /* Deep black to blend perfectly with the logo's background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Glassmorphism Card with 3D Depth */
.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 40px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 25px 50px rgba(0, 200, 80, 0.1); /* Subtle green under-glow */
    border-radius: 30px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.splash-logo {
    width: 140px;
    height: 140px;
    border-radius: 24px;
    margin-bottom: 35px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.splash-title {
    font-size: 1.8rem;
    color: #ffffff;
    margin-top: 25px;
    letter-spacing: 4px;
    font-weight: 700;
}

.logo-x {
    color: #00d23a; /* NxB Green */
    font-family: cursive;
    text-transform: lowercase;
}

.pro-badge {
    color: #00d23a;
    font-size: 1rem;
    font-style: italic;
    vertical-align: super;
}

/* Professional Liquid Loader */
.liquid-loader {
    width: 55px;
    height: 55px;
    border: 3px solid transparent;
    border-radius: 50%;
    border-top-color: #00d23a; /* Green from logo */
    border-bottom-color: #ffffff; /* White from logo text */
    /* Snappy, fluid cubic-bezier spin */
    animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite; 
    position: relative;
}

.liquid-loader::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 3px solid transparent;
    border-radius: 50%;
    border-left-color: rgba(0, 210, 58, 0.6);
    animation: spin 0.8s linear infinite reverse;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


