/* ============================================
   MOBILE DASHBOARD OPTIMIZATION
   Professional & User-Friendly Mobile Design
   ============================================ */

/* ============================================
   MOBILE BOTTOM NAVIGATION BAR
   ============================================ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 991px) {
    .mobile-bottom-nav {
        display: block !important;
    }

    /* Add padding to body to prevent content hiding behind bottom nav */
    body.has-mobile-nav {
        padding-bottom: 70px !important;
    }
}

.mobile-bottom-nav-list {
    display: flex;
    justify-content: space-around;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 600px;
    margin: 0 auto;
}

.mobile-bottom-nav-item {
    flex: 1;
    text-align: center;
}

.mobile-bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    color: #667085;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-bottom-nav-link svg {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.mobile-bottom-nav-link svg path {
    fill: #667085;
    transition: all 0.3s ease;
}

.mobile-bottom-nav-link.active {
    color: #1DBF73;
}

.mobile-bottom-nav-link.active svg path {
    fill: #1DBF73;
}

.mobile-bottom-nav-link:active {
    transform: scale(0.95);
}

/* Badge for notifications */
.mobile-nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(50%);
    background: #ef4444;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 999px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   MOBILE SIDEBAR SLIDE-IN - UNIFIED VERSION
   ============================================ */
@media (max-width: 991px) {

    /* Sidebar Column - Fixed Position Off-Screen */
    .profile-settings-area .col-xl-3.col-lg-4 {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 300px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        z-index: 50000 !important;
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        background: #ffffff !important;
        overflow-y: auto !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12) !important;
        display: block !important;
        /* Override the display: none */
    }

    /* Sidebar Column - Active State (Slide In) */
    .profile-settings-area .col-xl-3.col-lg-4.active {
        left: 0 !important;
    }

    /* Make main content full width on mobile */
    .profile-settings-area .col-xl-9.col-lg-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Profile Settings Menu - Also support direct menu targeting */
    .profile-settings-menu {
        position: relative;
        width: 100%;
        height: 100%;
    }

    .profile-settings-menu-inner {
        padding: 20px;
    }

    /* Overlay - Dark Backdrop */
    .responsive-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        z-index: 40000 !important;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .responsive-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
}

/* ============================================
   MOBILE HEADER OPTIMIZATION
   ============================================ */
@media (max-width: 991px) {
    .mobile-dashboard-header {
        position: sticky;
        top: 0;
        background: var(--white);
        z-index: var(--z-sticky);
        padding: 12px 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .mobile-header-left {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mobile-menu-toggle {
        background: none;
        border: none;
        padding: 8px;
        cursor: pointer;
        color: var(--text-dark);
        font-size: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-md);
        transition: var(--transition-fast);
    }

    .mobile-menu-toggle:active {
        background: var(--bg-light);
    }

    .mobile-header-title {
        font-size: 18px;
        font-weight: 600;
        color: var(--text-dark);
        margin: 0;
    }

    .mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-header-action-btn {
        background: none;
        border: none;
        padding: 8px;
        cursor: pointer;
        color: var(--text-medium);
        font-size: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-md);
        position: relative;
        transition: var(--transition-fast);
    }

    .mobile-header-action-btn:active {
        background: var(--bg-light);
    }
}

/* ============================================
   MOBILE DASHBOARD CARDS
   ============================================ */
@media (max-width: 991px) {
    .mobile-stats-container {
        display: flex;
        overflow-x: auto;
        gap: 12px;
        padding: 16px;
        margin: 0 -16px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .mobile-stats-container::-webkit-scrollbar {
        display: none;
    }

    .mobile-stat-card {
        flex: 0 0 280px;
        scroll-snap-align: start;
        background: var(--white);
        border-radius: var(--radius-lg);
        padding: 20px;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--border-light);
    }

    .mobile-stat-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
    }

    .mobile-stat-card-icon {
        width: 40px;
        height: 40px;
        border-radius: var(--radius-md);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
    }

    .mobile-stat-card-value {
        font-size: 28px;
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 4px;
    }

    .mobile-stat-card-label {
        font-size: 13px;
        color: var(--text-light);
        font-weight: 500;
    }
}

/* ============================================
   MOBILE QUICK ACTIONS
   ============================================ */
@media (max-width: 991px) {
    .mobile-quick-actions {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        padding: 16px;
        background: var(--white);
        border-radius: var(--radius-lg);
        margin-bottom: 16px;
    }

    .mobile-quick-action {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 12px 8px;
        text-decoration: none;
        color: var(--text-medium);
        border-radius: var(--radius-md);
        transition: var(--transition-fast);
    }

    .mobile-quick-action:active {
        background: var(--bg-light);
        transform: scale(0.95);
    }

    .mobile-quick-action-icon {
        width: 48px;
        height: 48px;
        border-radius: var(--radius-md);
        background: var(--bg-light);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        color: var(--main-color-one);
    }

    .mobile-quick-action-label {
        font-size: 11px;
        font-weight: 500;
        text-align: center;
        line-height: 1.2;
    }
}

/* ============================================
   MOBILE CONTENT SPACING
   ============================================ */
@media (max-width: 991px) {
    .profile-settings-area {
        padding-top: 0 !important;
        padding-bottom: 80px !important;
    }

    .profile-settings-wrapper {
        padding: 16px;
    }

    /* Hide desktop breadcrumb on mobile */
    .breadcrumb-area {
        display: none;
    }
}

/* ============================================
   MOBILE SIDEBAR MENU ITEMS
   ============================================ */
@media (max-width: 991px) {
    .profile-settings-menu-list {
        padding: 0;
        margin: 0;
    }

    .profile-settings-menu-item {
        margin-bottom: 4px;
    }

    .profile-settings-menu-item-link {
        padding: 12px 16px;
        font-size: 14px;
        border-radius: var(--radius-md);
    }

    .profile-settings-menu-item-link svg {
        width: 20px;
        height: 20px;
    }
}