﻿/* LiteWire Inventory Management System - Mobile Styles
 * Responsive overrides for smaller screens.
 */

@media (max-width: 768px) {

    /* --- GENERAL LAYOUT --- */
    .hover-zone {
        display: none;
    }

    .sidebar {
        width: 0;
        padding-top: 55px;
        transition: width 0.3s ease-in-out, transform 0.3s ease-in-out;
        transform: translateX(-60px);
    }
    .sidebar.expanded {
        width: 180px;
        transform: translateX(0);
        box-shadow: 4px 0 8px rgba(0,0,0,0.25);
    }

    /* MOBILE HEADER — scrolls away naturally */
    header#mainHeader {
        position: relative !important;
        width: 100% !important;
        left: 0 !important;
        top: 0 !important;
        box-shadow: none;
        padding: 12px 0;
    }

    /* Content no longer needs desktop padding */
    .content-area {
        margin-left: 0;
        padding: 10px;
        width: 100%;
    }
    .content-area.compressed {
        margin-left: 0;
    }

    .logo {
        margin-left: 10px;
        font-size: 1.3em;
    }

    /* --- DASHBOARD (index.php) --- */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .quick-actions {
        flex-direction: column;
    }
    .floating-widget {
        position: static;
        width: auto;
        margin-top: 20px;
        margin-right: 0;
    }

    /* --- FORMS (submit.php legacy groups) --- */
    .item-group {
        padding: 10px;
    }

    /* --- LOGS (logs.php) --- */
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }
    .filter-bar input,
    .filter-bar select {
        width: 100%;
    }
    .log-table {
        font-size: 0.85em;
        display: block;
        overflow-x: auto;
    }
    .log-table th,
    .log-table td {
        white-space: nowrap;
        padding: 8px 10px;
    }

    /* ---------------------------------------------------------
       INVENTORY TRANSFER UI — MOBILE OPTIMIZED PANELS
       --------------------------------------------------------- */

    /* Keep both panels side-by-side */
    .stock-panels {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 4px;
        flex-wrap: nowrap;
    }

    /* Panels use half the screen each */
    .stock-panel {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 10px;
        overflow: visible;
    }

    /* Hide desktop column headers */
    .stock-panel-columns {
        display: none;
    }

    /* Stacked mobile row layout */
    .stock-item {
        display: grid;
        grid-template-columns: 1fr;
        row-gap: 4px;
        padding: 10px 6px;
        font-size: 0.9rem;
        border-bottom: 1px solid #ddd;
    }

    /* Item name full width */
    .stock-item-label {
        font-size: 0.9rem;
        font-weight: 600;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Numbers line */
    .stock-item-current,
    .stock-item-adjust {
        display: inline-block;
        font-size: 0.8rem;
    }

    .stock-item-current {
        margin-right: 8px;
    }

    /* No inner scrollbars — panels extend down the page */
    .stock-panel-items {
        padding: 4px;
        overflow: visible;
        max-height: none;
    }

    /* --- MOBILE SIDEBAR TOGGLE BUTTON --- */
    #mobileSidebarToggle {
        position: fixed;
        top: 14px !important;
        left: 14px !important;
        width: 32px;
        height: 32px;
        background: #225094;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 2000;
        cursor: pointer;
    }
}