/* GLOBAL STYLES */
* { box-sizing: border-box; font-family: 'Segoe UI', Arial, sans-serif; margin: 0; padding: 0; }
html, body { height: 100%; }

/* INTRO & MODAL */
body.intro-page {
    background: url('image/Logo.png') no-repeat center center fixed; background-size: cover;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.intro-wrapper {
    max-width: 500px; width: 90%; background: rgba(15,15,15,0.92); padding: 40px;
    border-radius: 20px; text-align: center; color: white; border: 1px solid rgba(255,255,255,0.1);
}
.intro-side-image { width: 160px; height: 160px; border-radius: 15px; object-fit: cover; margin: 20px 0; }
.primary-btn { padding: 15px 40px; background: #fff; color: #000; border: none; border-radius: 30px; font-weight: bold; cursor: pointer; }

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; z-index: 2000;
}
.modal-content { background: #1a1a1a; padding: 40px; border-radius: 20px; width: 85%; max-width: 350px; text-align: center; color: white; border: 1px solid #333; }
.login-section input { width: 100%; padding: 12px; margin-bottom: 10px; background: #222; border: 1px solid #444; color: #fff; border-radius: 5px; }
.login-section button { width: 100%; padding: 12px; background: #fff; color: #000; border: none; border-radius: 5px; font-weight: bold; cursor: pointer; }

/* SPINNER */
.spinner { display: inline-block; width: 16px; height: 16px; border: 3px solid rgba(0,0,0,.1); border-radius: 50%; border-top-color: #000; animation: spin 1s infinite linear; margin-right: 8px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* MODERN DASHBOARD LAYOUT */
body.modern-layout { background: #0b1426; color: #fff; display: flex; flex-direction: column; }
/* Navigation Dropdown Logic */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #0b1426;
    position: relative;
}

.nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #0b1426;
    list-style: none;
    z-index: 1000;
    border-bottom: 2px solid #b8924a;
}

.nav-links.active {
    display: flex;
}

.nav-links li a {
    padding: 15px 25px;
    display: block;
    color: #fff;
    text-decoration: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Balance Styling */
.account-card-modern {
    margin: 0 20px 20px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
}

.balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.balance-masked {
    font-size: 1.8rem;
    font-weight: bold;
}

.fa-eye, .fa-eye-slash {
    cursor: pointer;
    font-size: 1.2rem;
    color: #b8924a;
}

.notif-bell { position: relative; font-size: 1.2rem; }
.badge { position: absolute; top: -5px; right: -8px; background: #ff4d4d; font-size: 10px; padding: 2px 5px; border-radius: 10px; }

.profile-header { padding: 20px; display: flex; justify-content: space-between; align-items: center; }
.avatar-placeholder { width: 45px; height: 45px; background: #2a3a5a; border-radius: 50%; display: flex; justify-content: center; align-items: center; }
.greeting-text { font-size: 0.85rem; font-weight: bold; }
.last-login { font-size: 0.65rem; opacity: 0.6; }

.account-card-modern { margin: 0 20px 20px; padding: 20px; background: rgba(255,255,255,0.1); border-radius: 15px; border: 1px solid rgba(255,255,255,0.05); }
.acc-number-label { font-size: 0.75rem; opacity: 0.7; margin-bottom: 10px; }
.balance-row { display: flex; justify-content: space-between; align-items: center; }
.balance-masked { font-size: 1.6rem; font-weight: bold; }

.white-bottom-section { background: #fff; border-radius: 30px 30px 0 0; padding: 30px 20px; flex-grow: 1; color: #333; }
.quick-actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.action-item { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.action-icon { width: 55px; height: 55px; background: #f8f9fa; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.3rem; color: #b8924a; border: 1px solid #eee; }
.action-item p { font-size: 0.75rem; font-weight: 500; }

.ad-banner { background: #fcf8f0; padding: 15px; border-radius: 12px; border-left: 4px solid #b8924a; }
.ad-content h3 { font-size: 0.9rem; margin-bottom: 4px; }
.ad-content p { font-size: 0.75rem; opacity: 0.8; }

/* SHARED ERROR OVERLAY */
.error-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); display: flex; justify-content: center; align-items: center; z-index: 3000; }
.error-box { background: #1a1a1a; padding: 30px; border-radius: 20px; width: 85%; max-width: 350px; text-align: center; color: white; }
.error-box button { margin-top: 20px; padding: 10px 25px; background: #fff; border: none; border-radius: 5px; font-weight: bold; cursor: pointer; }

.primary-btn-modern {
    padding: 15px 35px;
    background: #b8924a; /* Golden theme */
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(184, 146, 74, 0.3);
}

/* Investment Ad Styling */
.ad-banner {
    background: #f8f9fa;
    border-radius: 15px;
    overflow: hidden; /* Clips the image corners */
    margin-top: 20px;
    border: 1px solid #eee;
}

.ad-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.ad-content {
    padding: 15px;
}

.ad-content h3 { font-size: 1rem; color: #b8924a; margin-bottom: 5px; }
.ad-content p { font-size: 0.8rem; color: #666; line-height: 1.4; }

/* Modal Inputs fix */
.login-section input {
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    color: white;
}

/* Bank Logo Styling */
.bank-logo {
    height: 25px; /* Adjust based on your image size */
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
}

.nav-left {
    display: flex;
    align-items: center;
}

/* Adjusted Grid for more buttons */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px; /* Tighter gap for better mobile fit */
    margin-bottom: 25px;
}

.action-item p {
    font-size: 0.7rem; /* Slightly smaller to prevent text wrapping */
    font-weight: 500;
}

/* Ensure Logo displays well on Intro Page */
.intro-page .bank-logo {
    height: 30px;
}
/* 4. PC Optimization - Prevents overlapping icons */
@media (min-width: 1024px) {
    .dashboard-container {
        max-width: 1100px;
        margin: 0 auto;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(6, 1fr) !important; /* Forces 6 columns on PC */
        gap: 30px;
    }

    .action-icon {
        width: 70px;
        height: 70px;
        font-size: 1.5rem;
    }
}

/* 5. Profile Picture Styling */
.profile-pic-container {
    position: relative;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #b8924a;
    margin-right: 12px;
}

.profile-pic-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0,0,0,0.4);
    color: white;
    font-size: 0.6rem;
    text-align: center;
    padding: 2px 0;
    opacity: 0;
    transition: 0.3s;
}

.profile-pic-container:hover .upload-overlay { opacity: 1; }

.register-promo {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #666;
}

#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.puzzle-loader {
    position: relative;
    width: 60px;
    height: 60px;
}

.piece {
    position: absolute;
    width: 28px;
    height: 28px;
    background: #3498db; /* Your brand color */
    border-radius: 4px;
    animation: puzzle 1.5s infinite ease-in-out;
}

/* Initial positions (the corners) */
.p1 { top: 0; left: 0; background: #3498db; }
.p2 { top: 0; right: 0; background: #2ecc71; opacity: 0.8; }
.p3 { bottom: 0; left: 0; background: #f1c40f; opacity: 0.8; }
.p4 { bottom: 0; right: 0; background: #e74c3c; opacity: 0.8; }

@keyframes puzzle {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        /* This moves them all to the center to "fit" together */
        transform: translate(calc(50% - 14px), calc(50% - 14px));
        border-radius: 0; /* Makes them look like a solid block when they meet */
    }
}

.fade-out {
    opacity: 0;
    pointer-events: none;
}

