/* Mobile Responsive Styles for ZinkCloud */

/* =========================================
   Global Mobile Adjustments (Max-Width 768px)
   ========================================= */
@media (max-width: 768px) {

    /* =========================================
       Performance & Layout Fixes
       ========================================= */
    html, body {
        overflow-x: hidden !important;
        width: 100%;
        position: relative;
    }

    /* Disable heavy hero animation on mobile for performance */
    .hero::before {
        animation: none !important;
        background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%) !important;
        width: 100% !important;
        left: 0 !important;
        height: 100% !important;
        top: 0 !important;
    }

    /* Reduce blur load */
    .zink-header {
        backdrop-filter: blur(10px) !important; /* Reduced from 20px */
        padding: 15px 0 !important;
    }

    /* Fix Hero Spacing */
    .hero {
        padding-top: 100px !important;
        padding-bottom: 40px !important;
        min-height: auto !important; /* Allow content to dictate height */
    }

    /* Typography Overrides */
    h1.display-3 {
        font-size: 2rem !important;
        /* Fix Home Hero Text */
    }

    h2 {
        font-size: 1.5rem !important;
    }

    .hero-content h1 span {
        font-size: 1.5rem !important;
    }

    /* =========================================
       Sidebar & Layout
       ========================================= */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1050;
        /* Above everything */
        width: 250px;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .content {
        margin-left: 0 !important;
        /* Full width content */
        padding: 15px !important;
        padding-top: 60px !important;
        /* Space for toggle button */
    }

    /* Sidebar Toggle Button Positioning */
    .sidebar-toggle {
        display: block !important;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1060;
        /* Above sidebar */
        background: var(--zm-accent-primary, #3b82f6);
        color: white;
        border: none;
        border-radius: 5px;
        padding: 8px 12px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }

    /* Fixed Header Mobile Alignment */
    .zink-nav {
        justify-content: center !important;
        flex-direction: column;
        gap: 10px;
    }

    .zink-nav .d-flex {
        display: flex !important;
        /* Ensure Login button is visible if it was hidden */
    }

    /* =========================================
       Flex Containers (Headers, Toolbars)
       ========================================= */
    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }

    .d-flex.justify-content-between>* {
        width: 100%;
        /* Full width items */
    }

    /* Specific fix for Search forms/Buttons group */
    .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    /* Index/Home Header Menu */
    .zink-nav .d-flex {
        display: none !important;
        /* Hide Desktop Menu Buttons on VERY small screens if needed, or style hamburger */
    }

    /* =========================================
       Tables -> Card View
       ========================================= */
    /* =========================================
       Tables -> Compact Scroll View
       ========================================= */
    .table-responsive {
        border: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure table behaves like a table */
    .table thead {
        display: table-header-group !important;
    }

    .table tbody tr {
        display: table-row !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .table tbody td {
        display: table-cell !important;
        text-align: left !important;
        border-bottom: 1px solid #333 !important;
        padding: 0.5rem !important; /* Compact padding */
        font-size: 0.85rem !important; /* Smaller text */
        white-space: nowrap; /* Prevent wrapping */
    }

    .table tbody td::before {
        display: none !important; /* Remove labels */
    }
    
    /* Header Font Size Reduction */
    .table thead th {
        font-size: 0.75rem !important;
        padding: 0.5rem !important;
        white-space: nowrap;
    }

    /* Actions Column Adjustment */
    .table tbody td:last-child {
        display: table-cell !important;
        margin: 0 !important;
        border: none !important; /* Reset specific border */
        border-bottom: 1px solid #333 !important;
    }

    /* =========================================
       User Management Specifics
       ========================================= */
    /* User Details (Avatar + Name) */
    .table tbody tr td:first-child {
        display: flex;
        align-items: center;
        grid-column: 1 / -1;
    }

    /* =========================================
       Dashboard Specifics for Compact Mobile View
       ========================================= */

    /* 1. Header Text Reduction */
    .d-flex.justify-content-between h3.mb-0.text-white.fw-bold {
        font-size: 1.1rem !important;
        /* Much smaller */
        line-height: 1.2;
    }

    .d-flex.justify-content-between p.text-muted.small {
        font-size: 0.6rem !important;
        letter-spacing: 1px !important;
        margin-top: 5px;
        line-height: 1.4;
    }

    /* 2. Stats Grid (2 Columns) */
    .stats-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* Make the last odd item span full width if needed, or just let it consist */
    .stats-container .status-card:last-child:nth-child(odd) {
        grid-column: span 2;
    }

    /* 3. Card Styling for Mobile */
    .status-card {
        padding: 12px !important;
        /* Reduced padding */
        min-height: auto !important;
    }

    .status-info h3 {
        font-size: 0.65rem !important;
        /* Smaller Label */
        color: #aaa;
        margin-bottom: 5px !important;
    }

    .status-info p {
        font-size: 1.2rem !important;
        /* Smaller Number */
        font-weight: 700;
        margin: 0 !important;
    }

    .status-card .status-icon {
        display: none !important;
        /* Hide icon to save space if present */
    }

    /* 4. Sidebar Toggle & Header Spacing */
    .content {
        padding-top: 70px !important;
        /* Ensure toggle doesn't overlap text */
    }

    /* 5. Section Headers */
    .mb-5 h4 {
        font-size: 1rem !important;
        margin-bottom: 15px !important;
    }

}