:root {
    --primary-color: #4CAF50; /* Green */
    --secondary-color: #2196F3; /* Blue */
    --accent-color: #FFC107; /* Amber */
    --dark-bg: #1A1A2E;
    --dark-bg-light: #2C2C4A;
    --text-color: #E0E0E0;
    --glass-border-color: rgba(255, 255, 255, 0.18);
    --glass-bg-color: rgba(255, 255, 255, 0.05);
    --glass-backdrop-blur: 10px;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--dark-bg) 0%, #0F0F1A 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

a {
    color: var(--text-color);
    text-decoration: none;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    font-family: inherit;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column; /* Ensure main sections stack vertically under the header */
    width: 100%;
    max-width: 1920px; /* Max width for large screens */
    min-height: 100vh;
    background: rgba(0, 0, 0, 0.2); /* Slightly transparent overlay for overall app */
    border-radius: 15px;
    overflow: hidden;
    padding-top: 80px; /* Height of the sticky top nav, to prevent content overlap */
}

/* Glassmorphism Effect */
.glass-card {
    background: var(--glass-bg-color);
    border: 1px solid var(--glass-border-color);
    backdrop-filter: blur(var(--glass-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--glass-backdrop-blur));
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 12px 48px 0 rgba(0, 0, 0, 0.45);
    transform: translateY(-2px);
}

/* New Top Navbar */
.top-navbar-fixed {
    position: fixed; /* Changed to fixed for constant visibility */
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(26, 26, 46, 0.8); /* Slightly less transparent for better readability */
    backdrop-filter: blur(var(--glass-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--glass-backdrop-blur));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.top-navbar-fixed .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 20px; /* Space between logo and nav/hamburger */
}

.top-navbar-fixed .logo img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.top-navbar-fixed .logo span {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #FFF;
    letter-spacing: 0.5px;
}

.top-navbar-fixed .hamburger-menu {
    display: none; /* Hidden by default on larger screens */
    font-size: 24px;
    cursor: pointer;
    order: 2; /* Position hamburger after logo on mobile when shown */
}

.top-navbar-fixed .main-top-nav {
    flex-grow: 1;
    display: flex;
    justify-content: center; /* Center nav links */
}

.top-navbar-fixed .main-top-nav .nav-links {
    display: flex;
    gap: 25px;
}

.top-navbar-fixed .main-top-nav .nav-links li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    transition: all 0.3s ease;
    white-space: nowrap; /* Prevent wrapping */
}

.top-navbar-fixed .main-top-nav .nav-links li a i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.top-navbar-fixed .main-top-nav .nav-links li a:hover,
.top-navbar-fixed .main-top-nav .nav-links li a.active {
    background: var(--dark-bg-light);
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.2);
}

.nav-right-items {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: 20px; /* Space between nav and right items */
}

.nav-right-items .search-bar {
    position: relative;
    width: 250px; /* Adjusted for top nav */
}

.nav-right-items .search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-size: 15px;
    transition: all 0.3s ease;
}

.nav-right-items .search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.nav-right-items .search-bar input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.nav-right-items .search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
}

.nav-right-items .navbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-right-items .icon-button {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    position: relative;
    transition: all 0.3s ease;
}

.nav-right-items .icon-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--primary-color);
}

.nav-right-items .icon-button .badge {
    position: absolute;
    top: 3px;
    right: 3px;
    background: var(--accent-color);
    color: #1A1A2E;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 50%;
    font-weight: 600;
}

.nav-right-items .user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 10px; /* Spacing from other elements */
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-right-items .user-profile .avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.nav-right-items .user-profile .user-info {
    display: flex;
    flex-direction: column;
}

.nav-right-items .user-profile .user-name {
    font-size: 16px;
    font-weight: 600;
}

.nav-right-items .user-profile .user-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Glassmorphism Effect - General, existing */
.glass-card {
    background: var(--glass-bg-color);
    border: 1px solid var(--glass-border-color);
    backdrop-filter: blur(var(--glass-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--glass-backdrop-blur));
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 12px 48px 0 rgba(0, 0, 0, 0.45);
    transform: translateY(-2px);
}


/* Section Common Styles - Existing */
.content-section {
    padding: 30px;
    margin-bottom: 40px;
    border-radius: 20px;
}

.content-section h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
}

.content-section h2::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -10px;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}


/* Hero Section (Landing Page) - Existing */
.hero-section {
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #2A0944, #17002C, #0F0F1A, #1A1A2E);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    border-radius: 15px; /* Match app-container styling */
    padding: 50px;
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-content {
    max-width: 900px;
    z-index: 1;
}

.hero-content h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 58px;
    font-weight: 700;
    color: #FFF;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #00C853, #69F0AE); /* Green-ish gradient for text */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-content .cta-buttons {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 60px;
}

.hero-content .stats-counter {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 30px 40px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

.hero-content .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-content .stat-item .stat-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.hero-content .stat-item .stat-suffix {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-color);
}

.hero-content .stat-item .stat-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Dashboard Section - Existing */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.dashboard-grid .glass-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.credit-score-card h3,
.approval-probability h3,
.alternative-data-breakdown h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #FFF;
    margin-bottom: 20px;
}

.score-circle {
    position: relative;
    width: 180px;
    height: 180px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.score-circle canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.score-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
    z-index: 1;
}

.risk-level {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
}

.risk-indicator {
    font-weight: 600;
}
.risk-indicator.low { color: #00C853; }
.risk-indicator.medium { color: #FFC107; }
.risk-indicator.high { color: #D32F2F; }

.probability-bar-container {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-top: 15px;
    position: relative;
}

.probability-bar {
    height: 100%;
    background: linear-gradient(90deg, #2196F3, #64B5F6);
    border-radius: 10px;
    transition: width 1s ease-out;
}

.probability-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 600;
    color: #FFF;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.alternative-data-breakdown .chart-container {
    width: 100%;
    max-width: 300px;
    height: 200px;
    margin: 20px auto;
}

.breakdown-list {
    width: 100%;
    margin-top: 20px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item span {
    font-size: 16px;
}

.score-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #1A1A2E;
}
.score-badge.good { background-color: #A5D6A7; }
.score-badge.excellent { background-color: #69F0AE; }
.score-badge.average { background-color: #FFECB3; }
.score-badge.poor { background-color: #EF9A9A; }


/* Explainable AI Section */
.explain-ai-section {
    text-align: center;
}

.explanation-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.explanation-card {
    text-align: left;
}

.explanation-card h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #FFF;
    margin-bottom: 10px;
}

.explanation-card p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
}

.contribution-chart {
    width: 100%;
    height: 120px;
}

.bias-detection-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    margin-top: 40px;
}

.bias-detection-badge i {
    font-size: 22px;
    color: #FFF;
}

.bias-detection-badge span {
    font-size: 16px;
    font-weight: 500;
}

.bias-status {
    font-weight: 700;
}
.bias-status.safe { color: #69F0AE; }


/* Financial Improvement Suggestions Section */
.recommendation-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.recommendation-card {
    text-align: left;
}

.recommendation-card h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #FFF;
    margin-bottom: 10px;
}

.recommendation-card p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
}

.recommendation-card .progress-tracker {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin-bottom: 15px;
    position: relative;
}

.recommendation-card .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FFC107, #FFEB3B);
    border-radius: 5px;
    transition: width 0.5s ease-out;
}

.recommendation-card .progress-tracker span {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: #1A1A2E;
    text-shadow: 0 0 3px rgba(255,255,255,0.3);
}


/* Loan Simulator Section */
.simulator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.input-form .form-group {
    margin-bottom: 20px;
}

.input-form label {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.input-form input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.prediction-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.prediction-results .result-item {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 10px 0;
    font-size: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.prediction-results .result-item:last-of-type {
    border-bottom: none;
    margin-bottom: 30px;
}

.approval-status {
    font-weight: 600;
}
.approval-status.pending { color: var(--accent-color); }
.approval-status.approved { color: var(--primary-color); }
.approval-status.denied { color: #D32F2F; }

.emi-value {
    font-weight: 600;
    color: var(--primary-color);
}

.probability-gauge-container {
    position: relative;
    width: 200px;
    height: 100px; /* Half circle */
    overflow: hidden;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.probability-gauge-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%; /* To draw a full circle and hide the bottom half */
    transform-origin: bottom center;
}

.probability-gauge-container .gauge-value {
    position: absolute;
    bottom: 0; /* Position at the base of the half-circle */
    font-family: 'Montserrat', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--secondary-color);
    z-index: 1;
    background: var(--glass-bg-color); /* To make value readable over gauge */
    padding: 5px 15px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}


/* Responsive Design */
@media (max-width: 1200px) {
    .top-navbar-fixed .main-top-nav .nav-links {
        gap: 15px;
    }
    .top-navbar-fixed .main-top-nav .nav-links li a {
        padding: 8px 12px;
        font-size: 15px;
    }
    .top-navbar-fixed .logo span {
        font-size: 20px;
    }
    .nav-right-items .search-bar {
        width: 200px;
    }
}

@media (max-width: 992px) {
    .app-container {
        padding-top: 0; /* No fixed padding when top nav wraps */
    }
    .top-navbar-fixed {
        flex-wrap: wrap; /* Allow items to wrap */
        justify-content: space-between;
        padding: 15px 20px;
        position: relative; /* Change to relative for mobile to allow content to scroll underneath */
    }
    .top-navbar-fixed .logo {
        margin-right: 0; /* Adjust margin */
    }
    .top-navbar-fixed .hamburger-menu {
        display: flex; /* Show hamburger on smaller screens */
        order: 2; /* Position hamburger after logo */
    }
    .top-navbar-fixed .main-top-nav {
        flex-basis: 100%; /* Take full width */
        order: 3; /* Position below logo and hamburger */
        display: none; /* Hidden by default */
        text-align: center;
        background: rgba(26, 26, 46, 0.9); /* Slightly darker background for dropdown */
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 15px 0;
        margin-top: 15px;
        border-radius: 0 0 10px 10px;
    }
    .top-navbar-fixed .main-top-nav.active {
        display: flex;
        flex-direction: column;
    }
    .top-navbar-fixed .main-top-nav .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    .top-navbar-fixed .main-top-nav .nav-links li a {
        padding: 12px 20px;
        justify-content: center;
        border-radius: 0;
    }
    .top-navbar-fixed .nav-right-items {
        order: 1; /* Position right items after logo and before hamburger */
        flex-basis: auto;
        gap: 10px;
    }
    .nav-right-items .search-bar {
        width: 150px;
    }
    .nav-right-items .user-profile {
        display: none; /* Hide user profile on smaller screens to save space */
    }

    /* Adjust main content padding for new top nav height */
    .main-content {
        padding-top: 100px; /* Adjusted for wrapping top nav on mobile */
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }
    .app-container {
        border-radius: 0;
        padding-top: 80px; /* Re-adjust for smaller top nav */
    }
    .top-navbar-fixed {
        padding: 10px 15px;
    }
    .nav-right-items .search-bar {
        display: none; /* Hide search bar on very small screens */
    }
    .nav-right-items .navbar-actions {
        width: 100%;
        justify-content: flex-end; /* Align notification and profile dropdown to right */
    }
    .main-content {
        padding: 15px;
    }
    .hero-content h1 {
        font-size: 32px;
    }
    .hero-content p {
        font-size: 14px;
    }
    .hero-content .stat-item .stat-number {
        font-size: 36px;
    }
    .content-section h2 {
        font-size: 28px;
    }
    .score-circle {
        width: 150px;
        height: 150px;
    }
    .score-value {
        font-size: 40px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 28px;
    }
    .hero-content .cta-buttons {
        flex-direction: column;
    }
    .hero-content .stats-counter {
        flex-direction: column;
    }
    .hero-content .stat-item {
        flex: 1 1 100%;
        margin-bottom: 10px;
    }
    .hero-content .stat-item:last-child {
        margin-bottom: 0;
    }
    .top-navbar-fixed .logo span {
        font-size: 18px;
    }
    .nav-right-items .icon-button {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    .profile-dropdown .dropdown-menu {
        top: 50px;
    }
}