/* Mobile CSS for POS System */

/* Base mobile styles */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        line-height: 1.4;
        background-color: #f8f9fa;
    }
    
    /* Hide desktop elements on mobile */
    .d-mobile-none {
        display: none !important;
    }
    
    /* Show mobile elements only */
    .d-mobile-block {
        display: block !important;
    }
    
    .d-mobile-flex {
        display: flex !important;
    }
    
    /* Mobile navigation */
    .mobile-navbar {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 10px 15px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1030;
    }
    
    .mobile-navbar .navbar-brand {
        color: white !important;
        font-weight: bold;
        font-size: 18px;
        margin: 0;
    }
    
    .mobile-menu-toggle {
        background: none;
        border: none;
        color: white;
        font-size: 20px;
        padding: 5px;
    }
    
    /* Mobile content */
    .mobile-content {
        margin-top: 70px;
        padding: 15px;
        min-height: calc(100vh - 140px);
        padding-bottom: 80px; /* Space for bottom nav */
    }
    
    /* Mobile cards */
    .mobile-card {
        background: white;
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border: none;
    }
    
    /* Mobile buttons */
    .btn-mobile {
        width: 100%;
        margin-bottom: 10px;
        border-radius: 8px;
        padding: 12px;
        font-weight: 500;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Mobile stats cards */
    .stat-card {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-radius: 15px;
        padding: 20px;
        margin-bottom: 15px;
        text-align: center;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
    
    .stat-card h4 {
        font-size: 24px;
        font-weight: bold;
        margin-bottom: 5px;
    }
    
    .stat-card p {
        font-size: 12px;
        opacity: 0.9;
        margin: 0;
    }
    
    /* Bottom navigation */
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #dee2e6;
        padding: 8px 0;
        z-index: 1020;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        transition: transform 0.3s ease;
    }
    
    .bottom-nav .nav-item {
        flex: 1;
        text-align: center;
    }
    
    .bottom-nav .nav-link {
        color: #6c757d;
        font-size: 11px;
        padding: 5px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        transition: color 0.2s;
    }
    
    .bottom-nav .nav-link.active {
        color: #667eea;
    }
    
    .bottom-nav .nav-link i {
        font-size: 18px;
        margin-bottom: 2px;
    }
    
    /* Quick actions grid */
    .quick-actions {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .quick-action {
        background: white;
        border-radius: 12px;
        padding: 15px;
        text-align: center;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        color: #495057;
        text-decoration: none;
        transition: transform 0.2s, box-shadow 0.2s;
    }
    
    .quick-action:hover {
        transform: translateY(-2px);
        color: #495057;
        text-decoration: none;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    }
    
    .quick-action i {
        font-size: 24px;
        color: #667eea;
        margin-bottom: 8px;
        display: block;
    }
    
    .quick-action span {
        font-size: 12px;
        font-weight: 500;
    }
    
    /* Mobile tables */
    .mobile-table {
        background: white;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .mobile-table-item {
        padding: 15px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .mobile-table-item:last-child {
        border-bottom: none;
    }
    
    /* Forms */
    .form-control {
        border-radius: 8px;
        border: 1px solid #dee2e6;
        padding: 10px 12px;
    }
    
    .form-control:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    }
    
    .input-group-text {
        border-radius: 8px 0 0 8px;
        background-color: #f8f9fa;
        border-color: #dee2e6;
    }
    
    /* Floating action button */
    .fab {
        position: fixed;
        bottom: 80px;
        right: 20px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        z-index: 999;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        transition: transform 0.2s;
    }
    
    .fab:hover {
        transform: scale(1.1);
    }
    
    /* Offcanvas mobile menu */
    .offcanvas {
        max-width: 280px;
    }
    
    .offcanvas-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }
    
    .list-group-item.active {
        background-color: #667eea;
        border-color: #667eea;
    }
    
    /* Responsive images */
    .mobile-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: bold;
    }
    
    /* Mobile alerts */
    .alert {
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 15px;
    }
    
    /* Mobile badges */
    .badge {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    /* Scrollable content */
    .mobile-scroll {
        max-height: 300px;
        overflow-y: auto;
    }
    
    /* Touch-friendly sizing */
    .btn {
        min-height: 44px;
        border-radius: 8px;
    }
    
    .btn-group-sm .btn {
        min-height: 32px;
        padding: 6px 12px;
    }
    
    /* Loading states */
    .loading {
        opacity: 0.6;
        pointer-events: none;
    }
    
    .loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        margin: -10px 0 0 -10px;
        border: 2px solid #f3f3f3;
        border-top: 2px solid #667eea;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    
    /* Desktop switch button */
    .desktop-switch {
        position: fixed;
        top: 80px;
        right: 15px;
        z-index: 999;
    }
    
    /* Hide desktop-only elements */
    .d-md-block,
    .d-lg-block,
    .sidebar {
        display: none !important;
    }
    
    /* Mobile-specific spacing */
    .mt-mobile {
        margin-top: 1rem;
    }
    
    .mb-mobile {
        margin-bottom: 1rem;
    }
    
    .p-mobile {
        padding: 1rem;
    }
    
    /* Mobile grid */
    .mobile-grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .mobile-grid-3 {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 10px;
    }
    
    /* Search bar */
    .mobile-search {
        position: sticky;
        top: 70px;
        z-index: 100;
        background: #f8f9fa;
        padding: 10px 15px;
        margin: -15px -15px 15px -15px;
    }
    
    /* Mobile-optimized typography */
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    h4 { font-size: 16px; }
    h5 { font-size: 14px; }
    h6 { font-size: 12px; }
    
    /* Touch-friendly checkboxes and radios */
    .form-check-input {
        width: 20px;
        height: 20px;
    }
    
    .form-check-label {
        padding-left: 8px;
    }
    
    /* Mobile-specific utilities */
    .text-mobile-center {
        text-align: center;
    }
    
    .w-mobile-100 {
        width: 100%;
    }
}

/* Landscape mobile styles */
@media (max-width: 768px) and (orientation: landscape) {
    .mobile-content {
        margin-top: 60px;
        padding-bottom: 60px;
    }
    
    .mobile-navbar {
        padding: 8px 15px;
    }
    
    .bottom-nav {
        padding: 4px 0;
    }
    
    .bottom-nav .nav-link {
        font-size: 10px;
    }
    
    .bottom-nav .nav-link i {
        font-size: 16px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .mobile-content {
        padding: 10px;
    }
    
    .mobile-card {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-action {
        padding: 12px;
    }
    
    .quick-action i {
        font-size: 20px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card h4 {
        font-size: 20px;
    }
}

/* Mobile Return Page Styles */
.return-item {
    background: white;
    transition: all 0.2s ease;
}

.return-item.selected {
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.return-item .form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.return-item .input-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.return-item .input-group-sm .form-control {
    font-size: 0.875rem;
    font-weight: bold;
}

.avatar-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

/* Quick Cancel Modal Styles */
.modal-content {
    border-radius: 10px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px 10px 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Enhanced mobile form controls */
.form-select, .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

.form-select:focus, .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Mobile-specific spacing adjustments */
.mobile-card .row {
    margin-bottom: 0.5rem;
}

.mobile-card .row:last-child {
    margin-bottom: 0;
}

/* Improved badge styling */
.badge {
    padding: 0.5em 0.75em;
    font-size: 0.75em;
    border-radius: 6px;
}

.badge.bg-light {
    color: #495057 !important;
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6;
}

/* Mobile filter form styles */
@media (max-width: 768px) {
    /* Filter form enhancements */
    .quick-date-filter {
        font-size: 12px;
        padding: 6px 12px;
        border-radius: 20px;
    }
    
    .quick-date-filter.active {
        background-color: #0d6efd !important;
        border-color: #0d6efd !important;
        color: white !important;
    }
    
    .form-control-sm, .form-select-sm {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .form-label.small {
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 4px;
    }
    
    /* Mobile card improvements for filter */
    .mobile-card form {
        position: relative;
    }
    
    .input-group-text {
        background-color: #f8f9fa;
        border-color: #dee2e6;
        color: #6c757d;
    }
    
    /* Quick filter buttons layout */
    .quick-date-filter {
        flex: 1;
        min-width: 70px;
        white-space: nowrap;
    }
    
    /* Responsive form layout */
    @media (max-width: 480px) {
        .quick-date-filter {
            font-size: 11px;
            padding: 4px 8px;
        }
    }
}
