/* Ultra-Modern Fintech UI Styles - 2025 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modern Fintech Color Palette */
    --neon-emerald: #10b981;
    --vivid-indigo: #6366f1;
    --deep-slate: #0f172a;
    --midnight: #020617;
    --glass-white: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glow-emerald: rgba(16, 185, 129, 0.4);
    --glow-indigo: rgba(99, 102, 241, 0.4);
}

html, body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(at top left, var(--deep-slate), var(--midnight));
    min-height: 100vh;
    color: #f8fafc;
    letter-spacing: -0.01em;
    line-height: 1.6;
    transition: background 0.5s ease, color 0.3s ease;
}

/* Light Mode Overrides */
body.light-mode {
    color: #1e293b;
}

body.light-mode .sidebar-item {
    color: #475569;
}

body.light-mode .sidebar-item:hover {
    color: #059669;
}

body.light-mode .card h3,
body.light-mode .dashboard-header h1,
body.light-mode .workspace-header h2,
body.light-mode .navbar h1 {
    color: #1e293b;
}

body.light-mode .card p,
body.light-mode .dashboard-header p {
    color: #64748b;
}

body.light-mode .form-label {
    color: #334155;
}

body.light-mode .input,
body.light-mode .select-input {
    background: rgba(0, 0, 0, 0.03);
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .input:focus,
body.light-mode .select-input:focus {
    background: rgba(5, 150, 105, 0.05);
    border-color: #059669;
}

body.light-mode .module-header {
    color: #059669;
}

body.light-mode .mesh-gradient {
    opacity: 0.3;
}

body.light-mode .neon-panel h3,
body.light-mode .mini-card .title {
    color: #1e293b;
}

body.light-mode .neon-panel .subtle,
body.light-mode .mini-card .meta {
    color: #64748b;
}

body.light-mode .neon-panel {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .mini-card {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .mini-card:hover {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.3);
}


/* Container Layout */
.container { 
    display: flex; 
    min-height: 100vh; 
    position: relative;
}

/* Floating Sidebar - Glassmorphism */
.sidebar { 
    width: 280px;
    background: var(--glass-white);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    margin: 20px;
    height: calc(100vh - 40px);
    position: sticky;
    top: 20px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.sidebar:hover {
    box-shadow: 0 8px 40px rgba(16, 185, 129, 0.15);
}

/* Main Content */
.main-content { 
    flex: 1; 
    display: flex; 
    flex-direction: column;
}

/* Navbar - Glassmorphism */
.navbar { 
    background: var(--glass-white);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    margin: 20px 20px 0 0;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.navbar h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: white;
}

/* Module Groups */
.module-group { 
    margin-bottom: 2rem; 
    padding: 0 1rem; 
}

.module-header { 
    font-weight: 700;
    padding: 0.75rem 1rem;
    color: var(--neon-emerald);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Calculator List Items */
.calculator-list { 
    display: flex; 
    flex-direction: column; 
    gap: 0.5rem; 
}

.sidebar-item { 
    padding: 0.9rem 1.2rem;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sidebar-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
    transition: left 0.5s ease;
}

.sidebar-item:hover::before {
    left: 100%;
}

.sidebar-item:hover { 
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    transform: translateX(4px);
    color: var(--neon-emerald);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

/* Glassmorphism Cards */
.glass { 
    background: var(--glass-white);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

/* Bento Grid Layout */
.cards-grid { 
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 0;
    width: 100%;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    justify-items: stretch;
}

@media (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
}

@media (max-width: 900px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Bento Cards with Soft Glow */
.card { 
    padding: 2.5rem;
    border-radius: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--glass-white);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.05), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card:hover { 
    transform: translateY(-8px);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 20px 60px rgba(16, 185, 129, 0.2),
                0 0 40px rgba(16, 185, 129, 0.1);
}

.card-icon { 
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--neon-emerald), var(--vivid-indigo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.3));
}

.card h3 { 
    margin-bottom: 0.75rem;
    color: white;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.card p { 
    color: #94a3b8;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Form Styles */
.form-group { 
    margin-bottom: 1.75rem;
    display: flex;
    flex-direction: column;
}

.form-label { 
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.input, .select-input { 
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transition: all 0.3s ease;
    font-weight: 500;
}

.input:focus, .select-input:focus { 
    outline: none;
    border-color: var(--neon-emerald);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15),
                0 0 20px rgba(16, 185, 129, 0.2);
}

/* Gradient Buttons */
.btn { 
    padding: 1rem 2rem;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    letter-spacing: -0.01em;
}

.btn-primary { 
    background: linear-gradient(135deg, var(--neon-emerald) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover { 
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--glow-emerald),
                0 0 40px rgba(16, 185, 129, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Dashboard */
.dashboard-header { 
    text-align: center;
    margin-bottom: 3.5rem;
    padding: 2rem 0;
}

.dashboard-header h1 { 
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, white 0%, var(--neon-emerald) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-header p { 
    font-size: 1.25rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Workspace Header */
.workspace-header { 
    margin-bottom: 2.5rem;
}

.workspace-header h2 { 
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: white;
}

/* Notifications */
.notification { 
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1.25rem 2rem;
    border-radius: 16px;
    font-weight: 600;
    animation: slideUp 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp { 
    from { 
        transform: translateY(100px);
        opacity: 0;
    } 
    to { 
        transform: translateY(0);
        opacity: 1;
    } 
}

.notification-success { 
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--neon-emerald);
    color: var(--neon-emerald);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.notification-error { 
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #fca5a5;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

/* Utilities */
.text-muted { 
    color: #64748b;
}

.hidden { 
    display: none !important;
}

.mt-4 { 
    margin-top: 2rem;
}

.alert { 
    padding: 1.25rem;
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    color: #93c5fd;
    font-weight: 500;
}

/* Custom Scrollbar */
::-webkit-scrollbar { 
    width: 10px;
}

::-webkit-scrollbar-track { 
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb { 
    background: rgba(16, 185, 129, 0.4);
    border-radius: 10px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover { 
    background: rgba(16, 185, 129, 0.6);
}

/* Badges */
.badge { 
    display: inline-block;
    padding: 0.35rem 0.9rem;
    background: rgba(16, 185, 129, 0.15);
    color: var(--neon-emerald);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-right: 0.5rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* App Content */
.app-content {
    padding: 2rem;
    margin-right: 2rem;
    width: 100%;
    max-width: 100%;
    flex: 1;
}

#content {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

/* Neon Panels - Large Feature Cards */
.neon-panel {
    padding: 3rem;
    border-radius: 24px;
    background: var(--glass-white);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeIn 0.8s ease backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.neon-panel:nth-child(1) { animation-delay: 0.1s; }
.neon-panel:nth-child(2) { animation-delay: 0.2s; }
.neon-panel:nth-child(3) { animation-delay: 0.3s; }

.neon-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.neon-panel:hover::before {
    opacity: 1;
}

.neon-panel:hover {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 20px 60px rgba(16, 185, 129, 0.25),
                0 0 100px rgba(16, 185, 129, 0.1);
    transform: translateY(-4px);
}

.neon-panel-emerald {
    border-color: rgba(16, 185, 129, 0.3);
}

.neon-panel-emerald:hover {
    box-shadow: 0 20px 60px rgba(16, 185, 129, 0.3);
}

.neon-panel-indigo {
    border-color: rgba(99, 102, 241, 0.3);
}

.neon-panel-indigo::before {
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent 60%);
}

.neon-panel-indigo:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.3);
}

.neon-panel h3 {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
    line-height: 1.3;
}

.neon-panel:hover h3 {
    color: #10b981;
}

.neon-panel .subtle {
    color: #94a3b8;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.neon-panel:hover .subtle {
    color: #cbd5e1;
}

/* Mini Grid - Calculator Grid Inside Panels */
.mini-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-top: 1.5rem;
    align-items: stretch;
}

@media (max-width: 768px) {
    .mini-grid {
        grid-template-columns: 1fr;
    }
}

/* Mini Cards - Individual Calculators */
.mini-card {
    padding: 2rem 1.75rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 140px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    animation: fadeInUp 0.6s ease backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mini-card:nth-child(1) { animation-delay: 0.1s; }
.mini-card:nth-child(2) { animation-delay: 0.15s; }
.mini-card:nth-child(3) { animation-delay: 0.2s; }
.mini-card:nth-child(4) { animation-delay: 0.25s; }

.mini-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.15), transparent);
    transition: left 0.6s ease;
}

.mini-card:hover::before {
    left: 100%;
}

.mini-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0), rgba(16, 185, 129, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.mini-card:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.25),
                0 0 80px rgba(16, 185, 129, 0.15);
}

.mini-card:hover::after {
    opacity: 1;
}

.mini-card:active {
    transform: translateY(-3px) scale(1.01);
}

.mini-card-emerald:hover {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
}

.mini-card-indigo:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}

.mini-card .title {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.mini-card:hover .title {
    color: #10b981;
}

.mini-card .meta {
    font-size: 2.5rem;
    opacity: 0.8;
    transition: all 0.4s ease;
    transform-origin: center;
}

.mini-card:hover .meta {
    opacity: 1;
    transform: scale(1.2) rotate(5deg);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--neon-emerald) 0%, #059669 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

.mobile-menu-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.6);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.sidebar.mobile-open {
    transform: translateX(0) !important;
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .container { 
        flex-direction: column;
    }
    
    .mobile-menu-btn {
        display: flex !important;
    }
    
    .sidebar { 
        position: fixed;
        left: 0;
        top: 0;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        margin: 0;
        border-radius: 0 24px 24px 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }
    
    .navbar {
        margin: 20px;
    }
    
    .main-content {
        margin: 0;
    }
    
    .app-content {
        margin: 0;
        padding: 20px;
    }
    
    .cards-grid { 
        grid-template-columns: 1fr;
    }
    
    .dashboard-header h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 640px) {
    .sidebar {
        width: 85%;
        border-radius: 0 16px 16px 0;
    }
    
    .navbar {
        border-radius: 16px;
        flex-direction: column;
        gap: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
}
