/* ===================================
   DASHBOARD MOBILE NAVIGATION OPTIMIZATION
   For User/Bidder Dashboard Sidebar
   =================================== */

/* ===================================
   1. MOBILE SIDEBAR OPTIMIZATION
   =================================== */

/* Override the default behavior that hides text labels on mobile */
@media (max-width: 767px) {
    /* Fix grid layout - content should take full width on mobile */
    .dashboard-section .dashboard-wrapper {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    /* Keep text labels visible on mobile - override line 25811 from style.css */
    .dashboard-section .dashboard-wrapper .dashboard-sidebar-menu ul li a h6 {
        display: block !important;
        font-size: 14px;
        text-align: left !important;
    }

    /* Keep horizontal layout with icon and text */
    .dashboard-section .dashboard-wrapper .dashboard-sidebar-menu ul li a {
        flex-direction: row !important;
        justify-content: flex-start !important;
        gap: 12px;
        padding: 14px 15px;
        min-height: 48px; /* Minimum 44px touch target + padding */
    }

    /* Reduce sidebar padding on mobile to save space */
    .dashboard-section .dashboard-wrapper .dashboard-sidebar-menu ul {
        padding: 20px 12px !important;
        background-color: #111a22;
        border-radius: 10px;
    }

    /* Optimize menu item spacing */
    .dashboard-section .dashboard-wrapper .dashboard-sidebar-menu ul li {
        margin-bottom: 12px;
    }

    .dashboard-section
        .dashboard-wrapper
        .dashboard-sidebar-menu
        ul
        li:last-child {
        margin-bottom: 0;
    }

    /* Ensure SVG icons are properly sized */
    .dashboard-section .dashboard-wrapper .dashboard-sidebar-menu ul li a svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        fill: var(--white-color);
    }

    /* Ensure content area takes full width */
    .dashboard-section .dashboard-wrapper .dashboard-content-wrap {
        width: 100% !important;
        padding: 20px 15px !important;
    }
}

/* Extra small devices - further optimization */
@media (max-width: 576px) {
    /* Fix grid layout - content should take full width on mobile */
    .dashboard-section .dashboard-wrapper {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    /* Keep text labels visible even on very small screens */
    .dashboard-section .dashboard-wrapper .dashboard-sidebar-menu ul li a h6 {
        display: block !important;
        font-size: 13px;
        text-align: left !important;
    }

    /* Maintain horizontal layout */
    .dashboard-section .dashboard-wrapper .dashboard-sidebar-menu ul li a {
        flex-direction: row !important;
        justify-content: flex-start !important;
        gap: 10px;
        padding: 12px 12px;
        min-height: 48px;
    }

    /* Reduce sidebar padding further */
    .dashboard-section .dashboard-wrapper .dashboard-sidebar-menu ul {
        padding: 15px 10px !important;
        margin-bottom: 0 !important;
    }

    /* Smaller icons on very small screens */
    .dashboard-section .dashboard-wrapper .dashboard-sidebar-menu ul li a svg {
        width: 16px;
        height: 16px;
    }

    /* Ensure content area takes full width */
    .dashboard-section .dashboard-wrapper .dashboard-content-wrap {
        width: 100% !important;
        padding: 15px 10px !important;
    }
}

/* ===================================
   2. HAMBURGER MENU FOR MOBILE
   =================================== */

/* Hamburger menu button - only visible on mobile */
.dashboard-mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 79%;
    left: 15px;
    padding: 10px 16px;
    background: #01aa85;
    background: linear-gradient(135deg, #01aa85, #018f6f);
    border-radius: 25px;
    border: none;
    box-shadow: 0 3px 12px rgba(1, 170, 133, 0.4);
    z-index: 1000;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    flex-direction: row;
    min-height: 44px;
}

@media (max-width: 767px) {
    .dashboard-mobile-menu-btn {
        display: flex;
    }
}

.dashboard-mobile-menu-btn:hover {
    transform: translateX(3px);
    box-shadow: 0 4px 16px rgba(1, 170, 133, 0.5);
    background: linear-gradient(135deg, #02c299, #01aa85);
}

.dashboard-mobile-menu-btn:active {
    transform: translateX(0);
}

/* Menu label */
.dashboard-mobile-menu-btn .menu-label {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-dmsans);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    line-height: 1;
    margin: 0;
    padding: 0;
}

.dashboard-mobile-menu-btn.active .menu-label {
    display: none;
}

/* Hamburger icon container */
.dashboard-mobile-menu-btn span:first-child {
    width: 20px;
    height: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* Hamburger lines */
.dashboard-mobile-menu-btn span:first-child::before,
.dashboard-mobile-menu-btn span:first-child::after {
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    position: absolute;
    left: 0;
}

.dashboard-mobile-menu-btn span:first-child::before {
    top: 0;
}

.dashboard-mobile-menu-btn span:first-child::after {
    bottom: 0;
}

/* Middle line (using a pseudo element on the span itself) */
.dashboard-mobile-menu-btn span:first-child {
    background: linear-gradient(#ffffff 0%, #ffffff 100%);
    background-position: center;
    background-size: 100% 2px;
    background-repeat: no-repeat;
}

/* Active state (X icon) */
.dashboard-mobile-menu-btn.active {
    width: 44px;
    left: 13rem;
    top: 2rem;
    height: 44px;
    border-radius: 50%;
    padding: 0;
    gap: 0;
}

.dashboard-mobile-menu-btn.active span:first-child {
    width: 20px;
    height: 20px;
    background: none;
}

.dashboard-mobile-menu-btn.active span:first-child::before {
    transform: rotate(45deg);
    top: 50%;
    margin-top: -1px;
}

.dashboard-mobile-menu-btn.active span:first-child::after {
    transform: rotate(-45deg);
    bottom: 50%;
    margin-bottom: -1px;
}

/* ===================================
   3. MOBILE SIDEBAR SLIDE-IN BEHAVIOR
   =================================== */

/* Desktop - ensure sidebar is visible */
@media (min-width: 768px) {
    .dashboard-section .dashboard-wrapper .dashboard-sidebar-menu {
        position: static !important;
        transform: none !important;
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
        background-color: transparent !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    /* Hide mobile menu button on desktop */
    .dashboard-mobile-menu-btn {
        display: none !important;
    }
}

/* Extra small screens - adjust button size */
@media (max-width: 576px) {
    .dashboard-mobile-menu-btn {
        /* top: 81%; */
        left: 0rem;
        padding: 8px 14px;
        min-height: 40px;
    }

    .dashboard-mobile-menu-btn .menu-label {
        font-size: 12px;
    }

    .dashboard-mobile-menu-btn span:first-child {
        width: 18px;
        height: 12px;
    }

    .dashboard-mobile-menu-btn.active {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 767px) {
    /* Make sidebar slide in from left on mobile */
    .dashboard-section .dashboard-wrapper .dashboard-sidebar-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 999;
        background-color: #111a22;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        padding: 20px 0;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
    }

    .dashboard-section .dashboard-wrapper .dashboard-sidebar-menu.show-menu {
        transform: translateX(0);
    }

    .dashboard-section .dashboard-wrapper .dashboard-sidebar-menu ul {
        position: static;
        margin-bottom: 0;
        border-radius: 0;
    }

    /* Add close button to mobile sidebar */
    .dashboard-sidebar-menu .mobile-menu-close {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .dashboard-sidebar-menu .mobile-menu-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    .dashboard-sidebar-menu .mobile-menu-close::before,
    .dashboard-sidebar-menu .mobile-menu-close::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 16px;
        height: 2px;
        background-color: #ffffff;
    }

    .dashboard-sidebar-menu .mobile-menu-close::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .dashboard-sidebar-menu .mobile-menu-close::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    /* Add logo/header to mobile sidebar */
    .dashboard-sidebar-menu .mobile-sidebar-header {
        display: block;
        padding: 20px 15px 15px 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 15px;
    }

    .dashboard-sidebar-menu .mobile-sidebar-header h5 {
        color: #ffffff;
        font-size: 16px;
        font-weight: 600;
        margin: 0;
        padding-right: 40px;
    }
}

/* Hide close button and header on desktop */
@media (min-width: 768px) {
    .dashboard-sidebar-menu .mobile-menu-close,
    .dashboard-sidebar-menu .mobile-sidebar-header {
        display: none;
    }
}

/* ===================================
   4. OVERLAY FOR MOBILE MENU
   =================================== */

@media (max-width: 767px) {
    /* Add overlay when menu is open */
    .dashboard-mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .dashboard-mobile-overlay.show {
        display: block;
        opacity: 1;
    }
}

/* ===================================
   5. PREVENT BODY SCROLL WHEN MENU IS OPEN
   =================================== */

body.dashboard-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ===================================
   6. SMOOTH SCROLLING FOR MOBILE SIDEBAR
   =================================== */

@media (max-width: 767px) {
    .dashboard-section .dashboard-wrapper .dashboard-sidebar-menu {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #c19b5c #1a2530;
    }

    .dashboard-section
        .dashboard-wrapper
        .dashboard-sidebar-menu::-webkit-scrollbar {
        width: 6px;
    }

    .dashboard-section
        .dashboard-wrapper
        .dashboard-sidebar-menu::-webkit-scrollbar-track {
        background: #1a2530;
    }

    .dashboard-section
        .dashboard-wrapper
        .dashboard-sidebar-menu::-webkit-scrollbar-thumb {
        background: #c19b5c;
        border-radius: 3px;
    }

    .dashboard-section
        .dashboard-wrapper
        .dashboard-sidebar-menu::-webkit-scrollbar-thumb:hover {
        background: #8b4513;
    }
}

/* ===================================
   7. ACCESSIBILITY IMPROVEMENTS
   =================================== */

@media (max-width: 767px) {
    /* Focus states for keyboard navigation */
    .dashboard-section
        .dashboard-wrapper
        .dashboard-sidebar-menu
        ul
        li
        a:focus {
        outline: 2px solid #c19b5c;
        outline-offset: 2px;
    }

    /* Tap highlight color for mobile */
    .dashboard-section .dashboard-wrapper .dashboard-sidebar-menu ul li a,
    .dashboard-mobile-menu-btn {
        -webkit-tap-highlight-color: rgba(193, 155, 92, 0.2);
    }
}

/* ===================================
   8. ANTIQUE AUCTION THEME ENHANCEMENTS
   =================================== */

@media (max-width: 767px) {
    /* Enhanced hover states with antique theme colors */
    .dashboard-section
        .dashboard-wrapper
        .dashboard-sidebar-menu
        ul
        li
        a:hover {
        background: linear-gradient(
            135deg,
            rgba(193, 155, 92, 0.2),
            rgba(139, 69, 19, 0.2)
        );
        border-left: 3px solid #c19b5c;
        padding-left: 12px;
    }

    /* Active menu item with antique theme */
    .dashboard-section
        .dashboard-wrapper
        .dashboard-sidebar-menu
        ul
        li.active
        a {
        background: linear-gradient(
            135deg,
            rgba(193, 155, 92, 0.25),
            rgba(139, 69, 19, 0.25)
        );
        border-left: 3px solid #c19b5c;
        padding-left: 12px;
        font-weight: 600;
    }

    /* Notification badge styling */
    .dashboard-section
        .dashboard-wrapper
        .dashboard-sidebar-menu
        ul
        li
        a
        .notification-badge {
        background: linear-gradient(135deg, #c19b5c, #8b4513);
        box-shadow: 0 2px 6px rgba(193, 155, 92, 0.3);
    }
}

/* ===================================
   9. RESPONSIVE DASHBOARD CONTENT
   =================================== */

@media (max-width: 767px) {
    /* Enhanced profile header responsive */
    .enhanced-profile-header {
        padding: 20px 15px !important;
        margin-bottom: 20px !important;
    }

    .profile-main {
        flex-direction: column;
        text-align: center;
        gap: 15px !important;
    }

    .greeting-section h3 {
        font-size: 20px !important;
    }

    /* Counter cards responsive */
    .single-counter-card {
        padding: 20px 15px !important;
        min-height: 100px !important;
    }

    .counter-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 20px !important;
    }

    .counter-number {
        font-size: 24px !important;
    }

    .counter-content span {
        font-size: 12px !important;
    }

    /* Financial summary and quick actions */
    .financial-summary-card,
    .quick-actions-card {
        margin-bottom: 20px;
    }

    .card-header {
        padding: 15px !important;
    }

    .card-header h6 {
        font-size: 16px !important;
    }

    .financial-stats,
    .quick-actions {
        padding: 15px !important;
    }

    .quick-actions {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .action-btn {
        padding: 15px !important;
        min-height: 60px !important;
    }

    /* Alert boxes */
    .alert {
        padding: 15px !important;
        margin: 15px 0 !important;
    }

    /* Verification status card */
    .verification-status-card .card-header {
        padding: 20px 15px !important;
    }

    .verification-items-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

@media (max-width: 576px) {
    /* Extra small devices - further optimization */
    .enhanced-profile-header {
        padding: 15px 10px !important;
        margin-bottom: 15px !important;
    }

    .greeting-section h3 {
        font-size: 18px !important;
    }

    .single-counter-card {
        padding: 15px 12px !important;
        min-height: 90px !important;
    }

    .counter-icon {
        width: 45px !important;
        height: 45px !important;
        font-size: 18px !important;
    }

    .counter-number {
        font-size: 20px !important;
    }

    .card-header {
        padding: 12px !important;
    }

    .card-header h6 {
        font-size: 14px !important;
    }

    .financial-stats,
    .quick-actions {
        padding: 12px !important;
    }

    .action-btn {
        padding: 12px !important;
        min-height: 55px !important;
    }

    .btn-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }

    .action-btn span {
        font-size: 13px !important;
    }
}
