/* ===============================================================================
                    FINANCEOFBD - YELLOW & NIGHT BLUE THEME
=============================================================================== */

:root {
    /* Primary Colors */
    --primary-yellow: #FFD700;
    --secondary-yellow: #FFA500;
    --light-yellow: #FFEB3B;
    --night-blue: #0A1128;
    --dark-blue: #001F54;
    --medium-blue: #034078;
    --light-blue: #1282A2;
    --accent-blue: #0C2D48;
    
    /* Additional Colors */
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --text-light: #E0E0E0;
    --text-dark: #CCCCCC;
    --border-color: rgba(255, 215, 0, 0.2);
    
    /* Status Colors */
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    --info-color: #3B82F6;
    
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, var(--primary-yellow) 0%, var(--secondary-yellow) 100%);
    --blue-gradient: linear-gradient(135deg, var(--night-blue) 0%, var(--dark-blue) 100%);
    --accent-gradient: linear-gradient(135deg, var(--light-blue) 0%, var(--medium-blue) 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
}

/* ===============================================================================
                    GLOBAL STYLES
=============================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--night-blue);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 0; /* Ensure no top padding conflicts */
}

/* ===============================================================================
                    HEADER STYLES
=============================================================================== */

.header {
    background: var(--blue-gradient);
    color: var(--white);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    border-bottom: 2px solid var(--primary-yellow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header .subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
}

/* Profile Dropdown Styles */
.profile-section {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-yellow);
    margin: 0;
}

.profile-role {
    font-size: 12px;
    color: var(--text-light);
    margin: 0;
    text-transform: capitalize;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-yellow);
    color: var(--night-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-yellow);
    box-shadow: var(--shadow-md);
}

.profile-avatar:hover {
    background: var(--secondary-yellow);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Debug styles for header issues */
.profile-avatar {
    cursor: pointer !important;
    position: relative;
    z-index: 1001;
}

.profile-avatar:active {
    background: var(--light-yellow) !important;
    transform: scale(0.95) !important;
}

.profile-avatar:hover {
    background: var(--secondary-yellow) !important;
    transform: scale(1.05) !important;
    box-shadow: var(--shadow-lg) !important;
}

/* Ensure dropdown is visible when shown */
.profile-dropdown.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
    z-index: 1002 !important;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--dark-blue);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 5px;
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: block !important;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.profile-dropdown-item:last-child {
    border-bottom: none;
}

.profile-dropdown-item:hover {
    background: var(--medium-blue);
    color: var(--primary-yellow);
}

.profile-dropdown-item .icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.profile-dropdown-item.danger {
    color: var(--error-color);
}

.profile-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.profile-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 5px 0;
}

/* ===============================================================================
                    CONTAINER & LAYOUT
=============================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 80px; /* Space for fixed bottom navigation */
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* ===============================================================================
                    CARD STYLES
=============================================================================== */

.card {
    background: var(--dark-blue);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-yellow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-yellow);
}

.card-icon {
    font-size: 24px;
    margin-right: 10px;
}

/* ===============================================================================
                    STATS CARDS
=============================================================================== */

.stat-card {
    background: var(--blue-gradient);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: var(--white);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--primary-yellow);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-yellow);
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-change {
    font-size: 12px;
    margin-top: 5px;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.stat-change.positive {
    background: var(--success-color);
    color: var(--white);
}

.stat-change.negative {
    background: var(--error-color);
    color: var(--white);
}

/* ===============================================================================
                    BUTTONS
=============================================================================== */

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--night-blue);
    border: 2px solid var(--primary-yellow);
}

.btn-primary:hover {
    background: var(--secondary-yellow);
    color: var(--white);
}

.btn-secondary {
    background: var(--accent-gradient);
    color: var(--white);
    border: 2px solid var(--light-blue);
}

.btn-secondary:hover {
    background: var(--light-blue);
    border-color: var(--primary-yellow);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
    border: 2px solid var(--success-color);
}

.btn-danger {
    background: var(--error-color);
    color: var(--white);
    border: 2px solid var(--error-color);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
    border: 2px solid var(--warning-color);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* ===============================================================================
                    FORMS
=============================================================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-yellow);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--dark-blue);
    color: var(--text-light);
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
    background: var(--medium-blue);
}

.form-input::placeholder {
    color: var(--text-dark);
}

/* ===============================================================================
                    TABLES
=============================================================================== */

.table-container {
    background: var(--dark-blue);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--dark-blue);
}

.table th {
    background: var(--accent-blue);
    color: var(--primary-yellow);
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--primary-yellow);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
}

.table tbody tr:hover {
    background: var(--medium-blue);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ===============================================================================
                    BADGES & STATUS
=============================================================================== */

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: var(--success-color);
    color: var(--white);
}

.badge-warning {
    background: var(--warning-color);
    color: var(--white);
}

.badge-danger {
    background: var(--error-color);
    color: var(--white);
}

.badge-info {
    background: var(--info-color);
    color: var(--white);
}

.badge-primary {
    background: var(--primary-yellow);
    color: var(--night-blue);
}

/* ===============================================================================
                    NAVIGATION
=============================================================================== */

.nav-tabs {
    display: flex;
    background: var(--dark-blue);
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
    overflow: hidden;
}

.nav-tab {
    flex: 1;
    padding: 15px 20px;
    background: var(--dark-blue);
    color: var(--text-light);
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
    border-right: 1px solid var(--border-color);
}

.nav-tab:last-child {
    border-right: none;
}

.nav-tab:hover {
    background: var(--medium-blue);
    color: var(--primary-yellow);
}

.nav-tab.active {
    background: var(--primary-gradient);
    color: var(--night-blue);
}

/* ===============================================================================
                    BOTTOM NAVIGATION
=============================================================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--blue-gradient);
    display: flex;
    justify-content: space-around;
    padding: 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    border-top: 2px solid var(--primary-yellow);
    z-index: 100;
}

.nav-item {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: var(--text-light);
    font-size: 12px;
    padding: 8px 5px;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.nav-item:hover {
    color: var(--primary-yellow);
    background: rgba(255, 215, 0, 0.1);
}

.nav-item.active {
    color: var(--primary-yellow);
    background: rgba(255, 215, 0, 0.2);
}

.nav-icon {
    display: block;
    font-size: 20px;
    margin-bottom: 3px;
}

/* ===============================================================================
                    ALERTS & NOTIFICATIONS
=============================================================================== */

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
    box-shadow: var(--shadow-md);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--success-color);
    color: var(--success-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--warning-color);
    color: var(--warning-color);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--error-color);
    color: var(--error-color);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--info-color);
    color: var(--info-color);
}

/* ===============================================================================
                    MODALS
=============================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 17, 40, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--dark-blue);
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-yellow);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: var(--primary-yellow);
    background: rgba(255, 215, 0, 0.1);
}

/* ===============================================================================
                    RESPONSIVE DESIGN
=============================================================================== */

@media (max-width: 768px) {
    .container {
        padding: 15px;
        padding-bottom: 90px; /* Extra space for mobile navigation */
    }
    
    .header {
        padding: 12px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .profile-section {
        align-self: flex-end;
        margin-top: 5px;
    }
    
    .profile-info {
        display: none; /* Hide profile info on mobile to save space */
    }
    
    .profile-avatar {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .profile-dropdown {
        min-width: 180px;
        right: -10px;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .card {
        padding: 15px;
    }
    
    .header {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .nav-tab {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
        padding-bottom: 100px; /* Extra space for small mobile navigation */
    }
    
    .header {
        padding: 10px 12px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .profile-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .profile-dropdown {
        min-width: 160px;
        right: -15px;
    }
    
    .profile-dropdown-item {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .card {
        padding: 12px;
    }
    
    .header {
        padding: 12px 15px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .nav-item {
        font-size: 11px;
        padding: 6px 3px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
    
    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    .search-btn {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
}

/* ===============================================================================
                    UTILITY CLASSES
=============================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-yellow); }
.text-secondary { color: var(--secondary-yellow); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--error-color); }
.text-info { color: var(--info-color); }

.bg-primary { background: var(--primary-gradient); }
.bg-secondary { background: var(--blue-gradient); }
.bg-dark { background: var(--dark-blue); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 25px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mt-5 { margin-top: 25px; }

.p-0 { padding: 0; }
.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.p-4 { padding: 20px; }
.p-5 { padding: 25px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 16px; }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
