/* Responsive Design handling for mobile and smaller screens */
@media (max-width: 768px) {
    .mobile-only { display: flex; align-items: center; justify-content: center; }

    .navbar {
        height: 60px;
        min-height: 60px;
        flex-direction: row;
        padding: 0 1rem;
        flex-wrap: nowrap;
    }
    .navbar .logo { font-size: 1.25rem; }
    .navbar .logo-badge {
        font-size: 1.05rem;
        padding: 3px 8px;
    }
    .navbar .logo-title {
        font-size: 0.85rem;
    }
    .nav-actions { gap: 0.5rem; }
    
    /* Floating action buttons at the bottom */
    #theme-toggle, #lang-toggle {
        position: fixed;
        z-index: 9999;
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--border);
        width: 44px; /* Larger tap target on mobile */
        height: 44px;
        background-color: var(--card-bg);
    }
    
    #theme-toggle {
        bottom: 20px;
        right: 20px;
    }
    
    #lang-toggle {
        bottom: 20px;
        right: 74px;
    }

    .toast-container {
        bottom: 80px;
    }
    [dir="rtl"] .toast-container {
        bottom: 80px;
        right: auto;
        left: 20px;
    }
    
    /* Make standard buttons slightly smaller on mobile */
    button { padding: 0.5rem 1rem; font-size: 0.8rem; border-radius: 6px; }
    .navbar button svg { width: 16px; height: 16px; }
    
    .layout {
        flex-direction: column;
        margin-top: 60px;
        height: calc(100vh - 60px);
        overflow: hidden;
    }
    
    .content {
        padding: 1.5rem;
        padding-bottom: 6rem; /* Ensure space for scrolling content */
        overflow-y: auto;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        background-color: var(--card-bg);
        flex-direction: column;
        padding: 0;
        box-shadow: var(--shadow-lg);
        border-bottom: 1px solid var(--border);
        z-index: 99;
    }
    .nav-links.open {
        display: flex;
    }
    .nav-item {
        width: 100%;
        text-align: center;
        padding: 1.25rem;
        border-radius: 0;
        border-bottom: 1px solid var(--border);
        font-size: 1rem;
    }
    .nav-item:last-child {
        border-bottom: none;
    }
    .nav-item:hover {
        transform: none;
        background-color: rgba(229, 9, 20, 0.04);
    }
    
    /* Dashboard Stats Responsive */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }
    .stat-card {
        padding: 1.25rem;
        border-radius: 12px;
    }
    .stat-card p {
        font-size: 2rem;
    }
    
    /* Seating Map Responsive */
    .seating-grid {
        grid-template-columns: repeat(9, 1fr);
        gap: 0.35rem;
        padding-bottom: 8rem; /* Lift map extra high from bottom on mobile screen */
    }
    .seat:nth-child(18n + 10) {
        grid-column-start: auto;
    }
    .seat-label-text {
        font-size: 0.6rem;
    }
    
    /* Database Table Responsive */
    .table-container {
        max-height: calc(100vh - 280px);
    }
    .data-table th, .data-table td {
        padding: 0.85rem;
        font-size: 0.85rem;
    }
    
    /* Modals Responsive */
    .qr-modal-content {
        padding: 1.75rem;
        width: 90%;
        min-width: 290px;
    }
    
    /* Admin list items */
    .admin-list-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
    }
    .admin-list-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .seating-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.25rem;
    }
}
