/* Mobile improvements and responsive utilities */

/* Form improvements for mobile */
@media (max-width: 640px) {
    /* Stack form elements */
    .space-x-2 > * + *,
    .space-x-3 > * + *,
    .space-x-4 > * + * {
        margin-left: 0 !important;
        margin-top: 0.5rem !important;
    }
    
    /* Full width buttons on mobile */
    .btn, button, input[type="submit"] {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }
    
    /* Smaller padding for mobile */
    .p-6 {
        padding: 1rem !important;
    }
    
    .p-8 {
        padding: 1.5rem !important;
    }
    
    /* Adjust text sizes */
    .text-3xl {
        font-size: 1.875rem !important; /* 30px */
    }
    
    .text-2xl {
        font-size: 1.5rem !important; /* 24px */
    }
    
    /* Better spacing for cards */
    .grid.gap-6 {
        gap: 1rem !important;
    }
    
    .grid.gap-4 {
        gap: 0.75rem !important;
    }
    
    /* Responsive filters */
    .filter-form {
        padding: 1rem !important;
    }
    
    .filter-form .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Better select dropdowns */
    select {
        min-height: 2.5rem;
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
    
    input[type="text"],
    input[type="email"],
    input[type="url"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    textarea {
        font-size: 16px !important; /* Prevent zoom on iOS */
        min-height: 2.5rem;
    }
}

/* Touch-friendly interactions */
@media (max-width: 768px) {
    /* Larger touch targets */
    .btn, button, a[class*="btn"], .clickable {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    /* Better spacing for interactive elements */
    .hover\\:bg-gray-50 {
        padding: 0.75rem !important;
    }
    
    /* Improve details/summary for mobile */
    details summary {
        padding: 0.75rem 0;
        font-size: 1rem;
        font-weight: 500;
    }
    
    details[open] summary {
        border-bottom: 1px solid #E5E7EB;
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    /* Better form layouts */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Pagination improvements */
    .pagination {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .pagination .flex {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

/* Specific mobile improvements for common patterns */
@media (max-width: 640px) {
    /* Better alert boxes */
    .bg-red-50,
    .bg-green-50,
    .bg-blue-50,
    .bg-yellow-50,
    .bg-amber-50 {
        margin: 0.5rem 0 !important;
        padding: 1rem !important;
        border-radius: 0.5rem !important;
    }
    
    /* Improve badge/tag layouts */
    .space-x-2 {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.25rem !important;
    }
    
    .space-x-2 > * + * {
        margin-left: 0 !important;
    }
    
    /* Better status indicators */
    .px-2.py-1,
    .px-3.py-1 {
        padding: 0.375rem 0.75rem !important;
        font-size: 0.75rem !important;
        white-space: nowrap;
    }
    
    /* Profile sections */
    .profile-section {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Improve sidebar user info */
    .text-xs {
        font-size: 0.75rem !important;
        line-height: 1rem !important;
    }
}

/* Loading states and transitions */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Dark mode adjustments for mobile (if implemented later) */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .mobile-header {
        background-color: #1F2937;
        border-bottom-color: #374151;
    }
    
    .sidebar {
        background-color: #1F2937;
        border-right-color: #374151;
    }
}