:root {
    --primary-gradient: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    --secondary-gradient: linear-gradient(135deg, #7209b7 0%, #560bad 100%);
    --success-gradient: linear-gradient(135deg, #4cc9f0 0%, #4895ef 100%);
    --warning-gradient: linear-gradient(135deg, #f72585 0%, #b5179e 100%);
    --light-bg: #f8f9ff;
    --card-shadow: 0 10px 30px rgba(67, 97, 238, 0.1);
    --hover-shadow: 0 15px 40px rgba(67, 97, 238, 0.2);
}

body {
    background-color: var(--light-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    position: relative; /* Required for pseudo-element positioning */
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('100.PNG'); /* Replace with your image path or URL */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.2; /* Very low opacity for transparency; adjust lower (e.g., 0.1) if needed */
    z-index: -1; /* Keeps it behind content */
}

/* Modern Navbar */
.navbar {
    background: var(--primary-gradient) !important;
    padding: 0.8rem 1rem;
    box-shadow: 0 4px 20px rgba(67, 97, 238, 0.2);
    animation: slideDown 0.5s ease-out;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

body {
    padding-top: 70px; /* Adjust for fixed navbar */
}

.navbar-brand {
    color: white !important;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    margin: 0 10px; /* More spacing for better arrangement */
    padding: 0.5rem 1.2rem !important;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Make logout look like a button */
.nav-item .logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white !important;
}

/* Welcome Header */
.welcome-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: 20px;
    padding: 1.5rem; /* Reduced padding for better top layout */
    margin: 1rem 0 2rem;
    box-shadow: var(--card-shadow);
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    overflow: hidden;
    text-align: center; /* Centered for better arrangement */
}

.welcome-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    opacity: 0.9; /* Subtle opacity */
}

.icon-savings { background: linear-gradient(135deg, #4cc9f0, #4895ef); color: white; }
.icon-loan { background: linear-gradient(135deg, #7209b7, #560bad); color: white; }
.icon-slot { background: linear-gradient(135deg, #f72585, #b5179e); color: white; }
.icon-consistency { background: linear-gradient(135deg, #38b000, #2a9134); color: white; }

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0.5rem 0;
}

.stat-label {
    color: #718096;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Modern Tabs */
.nav-tabs {
    border: none;
    margin-bottom: 2rem;
    background: white;
    border-radius: 15px;
    padding: 0.5rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    animation: fadeInUp 0.6s ease-out;
}

.nav-tabs .nav-link {
    border: none;
    color: #718096 !important;
    font-weight: 600;
    padding: 0.75rem 1.5rem !important;
    border-radius: 10px;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
    background: transparent;
}

.nav-tabs .nav-link.active {
    background: var(--primary-gradient) !important;
    color: white !important;
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
    transform: translateY(-2px);
}

/* Tab Content */
.tab-pane {
    animation: fadeIn 0.4s ease-out;
}

/* Tables */
.table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    animation: fadeInUp 0.6s ease-out;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead {
    background: var(--primary-gradient);
    color: white;
}

.table th {
    border: none;
    padding: 1.2rem; /* Increased for attractiveness */
    font-weight: 600;
    text-transform: uppercase; /* Modern look */
    letter-spacing: 0.5px;
}

.table td {
    padding: 1.2rem;
    border-top: 1px solid #f1f3f9; /* Subtle borders instead of striped */
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: rgba(67, 97, 238, 0.05);
    transition: background-color 0.3s ease;
}

/* Remove striped for cleaner look */
/* .table-striped tbody tr:nth-of-type(odd) { background-color: inherit; } */

/* Buttons */
.btn {
    border-radius: 12px;
    padding: 0.6rem 1.2rem; /* Reduced padding to make buttons smaller */
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #38b000, #2a9134);
    border: none;
}

/* Cards */
.card {
    border: none;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    animation: fadeInUp 0.6s ease-out;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-body {
    padding: 2rem;
}

/* Alerts */
.alert {
    border-radius: 15px;
    border: none;
    padding: 1.25rem;
    margin: 1rem 0;
    animation: slideInRight 0.5s ease-out;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.alert-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
}

/* Progress Bars */
.progress {
    height: 10px;
    border-radius: 10px;
    background: #e9ecef;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    background: var(--primary-gradient);
    border-radius: 10px;
    animation: progressFill 1.5s ease-out;
}

/* Form Controls */
.form-control {
    border-radius: 12px;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    transform: translateY(-1px);
}

/* Footer */
footer {
    background: var(--primary-gradient);
    color: white;
    margin-top: 3rem;
    padding: 2rem 0;
    animation: fadeInUp 0.6s ease-out;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes progressFill {
    from {
        width: 0%;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(67, 97, 238, 0.3);
    border-radius: 50%;
    border-top-color: #4361ee;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .welcome-header {
        padding: 1.2rem;
        margin: 0.5rem 0 1.5rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .table th, .table td {
        padding: 0.8rem; /* Adjust for mobile */
    }
    
    .table-responsive {
        border-radius: 15px;
        margin: 1rem 0;
    }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .welcome-header h2 {
        font-size: 1.3rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem; /* Further reduce for small screens */
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a0ca3;
}