/* ==========================================================================
   IDT POS — Mobile Card Layout + Header Tagline Centering v1.0
   Date: 2026-05-16
   
   Two fixes:
   1. Mobile dashboard cards — show 2 per row (not 1)
   2. IDT POS tagline in header — vertically centered with navbar
   ========================================================================== */

/* --------------------------------------------------------------------------
   FIX 1: HEADER TAGLINE — Vertically center next to hamburger
   -------------------------------------------------------------------------- */

/* Reset and properly align the navbar to use flexbox */
.main-header .navbar-static-top {
    display: flex !important;
    align-items: center !important;
    min-height: 60px !important;
    padding: 0 !important;
}

/* Sidebar toggle (hamburger) — proper vertical centering */
.main-header .navbar .sidebar-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 60px !important;
    padding: 0 18px !important;
    line-height: 1 !important;
    margin: 0 !important;
    float: none !important;
    font-size: 22px !important;
}

/* Tagline text — perfectly vertically centered */
.main-header .navbar .sidebar-toggle::after {
    content: 'IDT POS · The Best Inventory Management System';
    display: inline-flex !important;
    align-items: center !important;
    height: 60px !important;
    margin-left: 16px !important;
    padding-left: 16px !important;
    border-left: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: rgba(255, 255, 255, 0.92) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    text-transform: none !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Hind Siliguri', sans-serif !important;
    vertical-align: middle !important;
}

/* Ensure navbar-custom-menu (right side) stays on right */
.main-header .navbar-custom-menu {
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    height: 60px !important;
}

/* On medium screens, show shorter version */
@media (max-width: 1199px) and (min-width: 992px) {
    .main-header .navbar .sidebar-toggle::after {
        content: 'IDT POS · Inventory Management' !important;
        font-size: 13px !important;
    }
}

/* On tablet (768-991px), show very short */
@media (max-width: 991px) and (min-width: 768px) {
    .main-header .navbar .sidebar-toggle::after {
        content: 'IDT POS' !important;
        font-size: 14px !important;
    }
}

/* On mobile (<768px), hide completely */
@media (max-width: 767px) {
    .main-header .navbar .sidebar-toggle::after {
        display: none !important;
    }
    
    .main-header .navbar-static-top {
        min-height: 50px !important;
    }
    
    .main-header .navbar .sidebar-toggle {
        height: 50px !important;
        padding: 0 14px !important;
    }
    
    .main-header .navbar-custom-menu {
        height: 50px !important;
    }
}

/* --------------------------------------------------------------------------
   FIX 2: MOBILE DASHBOARD CARDS — 2 per row instead of 1
   -------------------------------------------------------------------------- */

/* The dashboard uses Bootstrap col-md-3 col-sm-4 col-xs-12 pattern.
   col-xs-12 = full width on mobile (the problem!)
   We override to col-xs-6 = half width = 2 cards per row */

/* Target the dashboard cards columns specifically */
@media screen and (max-width: 767px) {
    /* Main 8 dashboard cards container */
    .content-custom .col-md-3.col-sm-4.col-xs-12,
    .content-custom .col-md-3.col-xs-12,
    .content-custom .col-sm-4.col-xs-12,
    .content-custom .col-xs-12:has(.info-box),
    .content-custom .col-xs-12:has(.info-box-new-style) {
        width: 50% !important;
        float: left !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
    
    /* Cards themselves — compact for mobile 2-column layout */
    .info-box,
    .info-box-new-style {
        padding: 14px !important;
        min-height: 110px !important;
        margin-bottom: 10px !important;
    }
    
    /* Card title text */
    .info-box-text {
        font-size: 11px !important;
        margin-bottom: 6px !important;
        line-height: 1.3 !important;
    }
    
    /* Card number/amount */
    .info-box-number {
        font-size: 18px !important;
        line-height: 1.1 !important;
        margin-bottom: 4px !important;
    }
    
    /* The hidden tooltip texts like "Total Sell Return: ৳ 0.00" */
    .info-box .text-muted,
    .info-box-new-style .text-muted {
        font-size: 9.5px !important;
        line-height: 1.3 !important;
        margin-top: 2px !important;
    }
    
    /* Watermark icons — smaller on mobile */
    .info-box-new-style .info-box-icon i,
    .info-box .info-box-icon i {
        font-size: 65px !important;
    }
    
    .info-box-new-style .info-box-icon i.fa,
    .info-box .info-box-icon i.fa {
        font-size: 58px !important;
    }
    
    /* Info tooltip icon (the small i circle next to "Net") */
    .info-box-text .fa-info-circle,
    .info-box-text + .show_tooltip,
    .show_tooltip {
        font-size: 10px !important;
    }
}

/* Very small phones (< 380px) — keep 2-column but more compact */
@media screen and (max-width: 380px) {
    .content-custom .col-md-3.col-sm-4.col-xs-12,
    .content-custom .col-md-3.col-xs-12,
    .content-custom .col-sm-4.col-xs-12 {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
    
    .info-box,
    .info-box-new-style {
        padding: 12px !important;
        min-height: 100px !important;
    }
    
    .info-box-number {
        font-size: 16px !important;
    }
    
    .info-box-text {
        font-size: 10px !important;
    }
    
    .info-box-new-style .info-box-icon i,
    .info-box .info-box-icon i {
        font-size: 55px !important;
    }
}

/* --------------------------------------------------------------------------
   BONUS: Banner on mobile — better stacking
   -------------------------------------------------------------------------- */
@media screen and (max-width: 767px) {
    .content-header-custom {
        padding: 16px 18px !important;
        margin: 10px 10px 8px !important;
        max-height: none !important;
    }
    
    .idt-banner-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    
    .idt-banner-right {
        width: 100% !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
    }
    
    .idt-banner-title {
        font-size: 18px !important;
    }
    
    /* Quick action buttons — compact on mobile */
    .idt-quick-btn {
        padding: 8px 12px !important;
        font-size: 12px !important;
        height: 36px !important;
    }
    
    /* Hide labels on secondary buttons (Add Product), keep New Sale full */
    .idt-quick-btn:not(.idt-quick-btn-primary) .idt-btn-label {
        display: none !important;
    }
    
    .idt-quick-btn:not(.idt-quick-btn-primary) {
        width: 36px !important;
        padding: 8px !important;
        justify-content: center !important;
    }
    
    .idt-quick-btn-primary {
        flex: 1 1 auto !important;
        justify-content: center !important;
    }
}