/* 
    Campus Junction - Seller Center Mobile Responsiveness 
    Strictly handles mobile-first layout overrides for the Seller Dashboard
*/

/* --- Desktop Sidebar Defaults (Non-Mobile) --- */
@media (min-width: 769px) {
    .dashboard-sidebar {
        width: 280px;
        height: calc(100vh - 70px);
        position: sticky;
        top: 70px;
        background: white;
        border-right: 1px solid var(--border-color);
        display: block;
    }
    .dashboard-nav {
        display: flex;
        flex-direction: column;
        padding: 1.5rem;
        gap: 0.5rem;
    }
    .mobile-more-trigger, .seller-mobile-popup {
        display: none !important;
    }
    .logout-link {
        margin-top: auto;
        color: var(--danger);
        border-top: 1px solid var(--border-color);
        padding-top: 1rem !important;
    }
}

/* --- Mobile View Overrides --- */
@media (max-width: 768px) {
    /* General body fix to prevent horizontal scroll */
    body { overflow-x: hidden; }

    /* Hide top navbar text/badges for space */
    .navbar-inner .badge, .navbar-inner .text-muted, .navbar-inner .text-main {
        display: none !important;
    }

    /* Dashboard Layout Reset */
    .dashboard-layout {
        display: block !important; 
        padding: 1rem !important;
        padding-bottom: 120px !important;
    }

    /* PREMIUM FLOATING BOTTOM BAR */
    .dashboard-sidebar {
        display: flex !important;
        position: fixed !important;
        bottom: 25px !important;
        left: 20px !important;
        right: 20px !important;
        width: auto !important;
        height: 70px !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-radius: 35px !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
        z-index: 999999 !important;
        padding: 0 !important;
        margin: 0 !important;
        top: auto !important;
        left: 20px !important;
        right: 20px !important;
    }

    .dashboard-nav {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        height: 100% !important;
        justify-content: space-around !important;
        align-items: center !important;
        padding: 0 20px !important;
        gap: 0 !important;
    }

    .dashboard-nav-link {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        color: #1e293b !important; /* Solid Navy */
        text-decoration: none !important;
        flex: 1 !important;
        height: 100% !important;
        background: none !important;
        border: none !important;
    }

    /* SVG ICON FIXES */
    .dashboard-nav-link svg, .mobile-more-trigger svg {
        display: block !important;
        width: 26px !important;
        height: 26px !important;
        stroke: #1e293b !important; /* High contrast */
        stroke-width: 2px !important;
    }

    .dashboard-nav-link.active svg {
        stroke: var(--primary) !important; /* Orange for active */
    }

    /* Hide all text spans for pure icon look */
    .dashboard-nav-link span, .mobile-more-trigger span {
        display: none !important;
    }

    /* More Toggle Trigger */
    .mobile-more-trigger {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 1 !important;
        cursor: pointer !important;
        height: 100% !important;
    }

    /* Hide Sidebar links that should only be in popup */
    .sidebar-desktop-only, .dashboard-user {
        display: none !important;
    }

    /* Popup Drawer Fixes */
    .seller-mobile-popup {
        display: block;
        position: fixed;
        bottom: -100%;
        left: 15px;
        right: 15px;
        background: white;
        border-radius: 25px;
        box-shadow: 0 -20px 60px rgba(0,0,0,0.4);
        z-index: 1000000;
        transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 1.5rem;
    }
    .seller-mobile-popup.active {
        bottom: 110px;
    }

    .popup-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; border-bottom: 1px solid #f3f4f6; padding-bottom: 1rem; }
    .popup-item { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; color: #1e293b; text-decoration: none; font-weight: 700; border-radius: 15px; }
    .popup-item svg { stroke: #1e293b; }
    .popup-item:active { background: #f9fafb; }
    .popup-item.danger { color: var(--danger); border-top: 1px solid #f3f4f6; margin-top: 0.5rem; }

    /* Tables to Cards (Listings) */
    table, thead, tbody, th, td, tr { display: block; width: 100% !important; }
    thead tr { display: none !important; }
    tr { border: 1px solid #e5e7eb; margin-bottom: 1rem; border-radius: 15px; background: white; padding: 1.25rem; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
    td { border: none; padding: 0.4rem 0 !important; font-size: 0.9rem; }
    
    /* Stats and Grid adjustments */
    .grid { grid-template-columns: 1fr !important; gap: 1rem !important; }
    .card { padding: 1.25rem !important; border-radius: 20px !important; }

    /* Typography Polish */
    h1 { font-size: 1.5rem !important; margin-bottom: 1rem !important; }
    h2 { font-size: 1.3rem !important; }
    .flex.justify-between.items-center.mb-6 { flex-direction: column !important; align-items: flex-start !important; gap: 1rem !important; }
    .flex.gap-4 { width: 100% !important; justify-content: space-between !important; }
    select.form-control { width: 100% !important; }
}
