:root {
    --azure-blue: #007fff;
    --azure-light: #3399ff;
    --azure-dark: #0059b3;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #e0f2ff;
    --bg-gradient: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
    padding-bottom: 80px; /* Space for FAB */
    box-sizing: border-box;
}

body.no-scroll {
    overflow: hidden;
}

.container {
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0; /* Hidden initially */
}

/* Staggered defaults */
.animate:nth-child(1) { animation-delay: 0.1s; }
.animate:nth-child(2) { animation-delay: 0.2s; }
.animate:nth-child(3) { animation-delay: 0.3s; }
.animate:nth-child(4) { animation-delay: 0.4s; }

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    margin-bottom: 30px;
}

.navbar .logo {
    margin: 0;
    font-size: 1.5rem;
    text-align: left;
}

.nav-actions {
    display: flex;
    gap: 15px;
}

.nav-btn {
    text-decoration: none;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.accounts-btn {
    background: rgba(50, 200, 100, 0.2);
}

.accounts-btn:hover {
    background: rgba(50, 200, 100, 0.3);
}

.calendar-btn {
    background: rgba(255, 255, 255, 0.1);
}

h1, h2, h3 {
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Glassmorphism Card */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    border-color: rgba(255,255,255,0.3);
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    text-align: center;
}

/* Responsive Grid Layout */
.main-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    transition: transform 0.2s;
    backdrop-filter: blur(5px);
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}


.stat-val {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 5px;
}

/* Transaction List */
.transaction-list {
    list-style: none;
    padding: 0;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    transition: background 0.2s;
}

.transaction-item:hover {
    background: rgba(255,255,255,0.05);
}

.transaction-item:last-child {
    border-bottom: none;
}

.t-info {
    display: flex;
    flex-direction: column;
}

.t-desc {
    font-weight: 500;
}

.t-meta {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 2px;
}

.t-amount {
    font-weight: bold;
}

.type-Income { color: #4caf50; }
.type-Expense { color: #ff5252; }
.type-Loan { color: #ff9800; }

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--azure-blue);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
    z-index: 100;
    border: none;
    user-select: none;
}

.fab:hover {
    background: var(--azure-light);
    transform: scale(1.1);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 200;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #1a2632;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
}

/* Type Selection Grid */
.type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.type-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 15px;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-align: center;
    transition: background 0.3s;
}

.type-btn:hover {
    background: rgba(255,255,255,0.1);
}

.type-btn.active {
    background: var(--azure-blue);
    border-color: var(--azure-blue);
}

/* Form Styles inside Modal */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    opacity: 0.8;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
}

option {
    background: #203a43;
    color: white;
}

button.submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--azure-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}
button.delete-btn {
    width: 100%;
    padding: 12px;
    background: #ff5252;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px; 
}

.hidden { display: none !important; }

.section-title {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
}
