/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Mobile First - Base styles for small screens */
@media (max-width: 768px) {

    /* Sidebar - Hide on mobile, show with toggle */
    .app-sidebar {
        transform: translateX(-100%);
        width: 280px;
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    /* Main content - Full width on mobile */
    .app-main {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 16px !important;
    }

    /* Mobile header */
    .mobile-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 16px;
        background: #fff;
        border-bottom: 1px solid #e5e7eb;
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        padding: 8px;
    }

    /* Container */
    .container {
        padding: 0 16px;
        margin: 16px auto;
    }

    /* Cards */
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Stats Grid - Stack on mobile */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 24px;
    }

    /* Tables - Horizontal scroll */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }

    .table th,
    .table td {
        padding: 8px 6px;
        font-size: 13px;
    }

    /* Buttons */
    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr !important;
    }

    .form-input {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* Card Header - Stack on mobile */
    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    .card-header .actions {
        width: 100%;
        flex-direction: column;
    }

    .card-header .actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Inline forms - Stack on mobile */
    .inline-form {
        flex-direction: column;
        align-items: stretch !important;
    }

    .inline-form>* {
        width: 100% !important;
    }

    /* Welcome section */
    .welcome-section {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px;
    }

    .welcome-title {
        font-size: 1.5rem !important;
    }

    /* Hero section */
    .hero-title {
        font-size: 2rem !important;
    }

    .hero-meta {
        font-size: 0.9rem !important;
        flex-direction: column;
        gap: 8px;
    }

    /* Reservation steps */
    .time-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .people-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Modal */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 20px;
    }

    /* QR Modal */
    .qr-modal-content {
        max-width: 90%;
        padding: 20px;
    }
}

/* Tablet - Medium screens */
@media (min-width: 769px) and (max-width: 1024px) {
    .app-sidebar {
        width: 220px;
    }

    .app-main {
        margin-left: 220px !important;
        width: calc(100% - 220px) !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .mobile-header {
        display: none !important;
    }
}

/* Desktop - Large screens */
@media (min-width: 1025px) {
    .mobile-header {
        display: none !important;
    }

    .menu-toggle {
        display: none;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets */
    .btn {
        min-height: 44px;
        padding: 12px 16px;
    }

    .nav-item {
        min-height: 44px;
        padding: 12px 16px;
    }

    .table-actions .btn {
        min-height: 40px;
    }

    /* Remove hover effects on touch devices */
    .btn:hover {
        transform: none;
    }

    .nav-item:hover {
        background: transparent;
    }
}

/* Landscape phone */
@media (max-width: 768px) and (orientation: landscape) {
    .app-sidebar {
        width: 240px;
    }

    .hero-title {
        font-size: 1.8rem !important;
    }
}

/* Very small screens (old phones) */
@media (max-width: 375px) {
    .container {
        padding: 0 12px;
    }

    .card {
        padding: 12px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .stat-value {
        font-size: 20px;
    }

    .welcome-title {
        font-size: 1.3rem !important;
    }
}

/* Print styles */
@media print {

    .app-sidebar,
    .mobile-header,
    .menu-toggle,
    .btn,
    .actions {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
        width: 100% !important;
    }
}