﻿/* Mobile Adaptation for EventMaster Pro */
@media screen and (max-width: 768px) {

    /* Reset Layout */
    #app {
        display: block !important;
        /* Override flex default if present */
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
    }

    body,
    html {
        overflow-y: auto !important;
        height: auto !important;
    }

    /* Sidebar - Off-canvas navigation */
    aside.sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        /* Start hidden */
        width: 80%;
        max-width: 300px;
        height: 100vh;
        z-index: 2000;
        /* Higher than header */
        transition: left 0.3s ease;
        background-color: var(--bg-secondary) !important;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.5);
        overflow-y: auto !important;
        /* Enable Sidebar Scrolling */
    }

    aside.sidebar.active {
        left: 0;
        /* Slide in */
        transform: none;
        /* Remove transform dependency */
    }

    /* Overlay when sidebar is open */
    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(2px);
    }

    /* Main Content */
    main.content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 1rem;
        padding-top: 70px;
        /* Space for Top Bar */
    }

    /* Top Bar Mobile */
    .mobile-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background-color: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        padding: 0 1rem;
        z-index: 900;
    }

    /* Dashboard Grid */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* Tables */
    .data-table,
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    /* Modals */
    .modal-content {
        width: 95% !important;
        margin: 20px auto;
        max-height: 85vh;
        overflow-y: auto;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Stats Cards */
    .stat-card {
        margin-bottom: 1rem;
    }

    /* Toolbox */
    .floating-toolbox {
        bottom: 20px;
        right: 20px;
    }
}