/* Mobile-First Responsive Design Enhancements for ILJAZI SOLUTIONS */

/* Touch Optimizations */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Mobile Menu Animations */
#mobile-menu {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: top center;
}

/* Improved Button Styles for Mobile */
@media (max-width: 768px) {
    /* Minimum touch target size */
    .btn, button, [role="button"], input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Form inputs optimization */
    input, textarea, select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
        padding: 12px 16px;
        border-radius: 8px;
    }
    
    /* Modal optimizations */
    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Card layouts */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Typography scaling */
    h1 { font-size: 1.875rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    /* Spacing optimizations */
    .container-mobile {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* Navigation improvements */
    .nav-link {
        padding: 16px 20px;
        display: flex;
        align-items: center;
        font-size: 16px;
        font-weight: 500;
    }
    
    /* Table responsiveness */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-mobile {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Form layouts */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Dashboard cards */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Fixed bottom navigation for mobile apps */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e5e7eb;
        padding: 12px 16px;
        z-index: 50;
        display: flex;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    /* Content with bottom nav */
    .with-bottom-nav {
        padding-bottom: 80px;
    }
    
    /* Appointment cards mobile */
    .appointment-card {
        padding: 20px;
        margin-bottom: 16px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    /* Status badges mobile */
    .status-badge {
        font-size: 12px;
        padding: 6px 12px;
        border-radius: 20px;
        font-weight: 600;
    }
    
    /* Action buttons */
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 16px;
    }
    
    .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Cookie banner mobile specific */
    .cookie-banner-mobile {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 80vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Loading states */
    .loading-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.9);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
    }
    
    /* Notification positioning */
    .notification-mobile {
        position: fixed;
        top: 80px;
        left: 16px;
        right: 16px;
        z-index: 1000;
    }
    
    /* Search optimizations */
    .search-mobile {
        position: sticky;
        top: 60px;
        background: white;
        padding: 16px;
        border-bottom: 1px solid #e5e7eb;
        z-index: 40;
    }
    
    /* Inventory table mobile */
    .inventory-mobile {
        display: block;
    }
    
    .inventory-mobile .item {
        display: block;
        padding: 16px;
        border-bottom: 1px solid #e5e7eb;
        background: white;
        margin-bottom: 8px;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    /* Booking form mobile */
    .booking-form-mobile {
        padding: 20px;
        background: white;
        border-radius: 16px;
        margin: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    /* Date/time picker improvements */
    input[type="date"], input[type="time"], input[type="datetime-local"] {
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 16px;
        padding-right: 40px;
    }
    
    /* Invoice mobile layout */
    .invoice-mobile {
        padding: 16px;
    }
    
    .invoice-mobile .invoice-header {
        text-align: center;
        margin-bottom: 24px;
    }
    
    .invoice-mobile .invoice-details {
        display: block;
    }
    
    .invoice-mobile .invoice-item {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid #e5e7eb;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .tablet-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .tablet-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* Dashboard adjustments for tablet */
    .dashboard-tablet {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    /* Form layouts for tablet */
    .form-tablet {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn, button {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 1px solid currentColor;
    }
}

/* Dark mode optimizations (if supported) */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .mobile-bottom-nav {
        background: #1f2937;
        border-top-color: #374151;
    }
}

/* Landscape phone optimizations */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .nav-height {
        height: 50px;
    }
    
    .modal-content {
        max-height: 90vh;
    }
    
    .cookie-banner-mobile {
        max-height: 70vh;
    }
}

/* Print optimizations */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-before: always;
    }
    
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .ios-fix {
        -webkit-overflow-scrolling: touch;
    }
    
    input {
        border-radius: 0;
    }
    
    .sticky-ios {
        position: -webkit-sticky;
        position: sticky;
    }
}

/* Progressive Web App optimizations */
@media (display-mode: standalone) {
    .pwa-padding {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus visible for better keyboard navigation */
:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 2px;
}

/* Loading animations */
@keyframes pulse-mobile {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.loading-pulse {
    animation: pulse-mobile 2s infinite;
}

/* Skeleton loading for better UX */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}