/* Mobile Responsiveness Enhancements for ECILA Marketplace */

/* Touch-friendly interactions */
@media (max-width: 768px) {
    
    /* Better button spacing on mobile */
    .btn-group button,
    .btn-group a {
        margin: 0.25rem;
        padding: 0.75rem 1rem;
    }
    
    /* Improved form inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        border-radius: 0.5rem;
    }
    
    /* Better modal sizing */
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    
    /* Improved table responsiveness */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 600px;
    }
    
    /* Better card layouts */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card-grid.two-col {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Improved navigation */
    .mobile-nav-item {
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    /* Better spacing for mobile */
    .mobile-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Improved text sizing */
    .mobile-text-lg {
        font-size: 1.125rem;
        line-height: 1.5;
    }
    
    .mobile-text-sm {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    /* Better image handling */
    .mobile-img {
        width: 100%;
        height: auto;
        border-radius: 0.5rem;
    }
    
    /* Improved loading states */
    .loading-spinner {
        width: 2rem;
        height: 2rem;
        margin: 1rem auto;
    }
    
    /* Better error messages */
    .error-message {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Improved success messages */
    .success-message {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Better pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .pagination button,
    .pagination a {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Improved dropdown menus */
    .dropdown-menu {
        position: fixed;
        top: auto;
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-height: 50vh;
        overflow-y: auto;
        border-radius: 1rem;
    }
    
    /* Better search interface */
    .search-container {
        position: relative;
        width: 100%;
    }
    
    .search-input {
        width: 100%;
        padding: 0.75rem 3rem 0.75rem 1rem;
        font-size: 16px;
        border-radius: 0.5rem;
    }
    
    .search-button {
        position: absolute;
        right: 0.5rem;
        top: 50%;
        transform: translateY(-50%);
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Improved filter interface */
    .filter-container {
        position: sticky;
        top: 0;
        z-index: 40;
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(10px);
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .filter-button {
        width: 100%;
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        text-align: left;
        border-radius: 0.5rem;
    }
    
    /* Better product cards */
    .product-card {
        border-radius: 1rem;
        overflow: hidden;
        transition: transform 0.2s ease;
    }
    
    .product-card:active {
        transform: scale(0.98);
    }
    
    .product-card-image {
        aspect-ratio: 16/9;
        object-fit: cover;
        width: 100%;
    }
    
    .product-card-content {
        padding: 1rem;
    }
    
    .product-card-title {
        font-size: 1rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }
    
    .product-card-price {
        font-size: 1.125rem;
        font-weight: 700;
        color: #10b981;
    }
    
    /* Improved order cards */
    .order-card {
        border-radius: 0.75rem;
        padding: 1rem;
        margin-bottom: 1rem;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .order-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 0.75rem;
    }
    
    .order-card-actions {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        margin-top: 0.75rem;
    }
    
    .order-card-action {
        flex: 1;
        min-width: 120px;
        padding: 0.5rem 1rem;
        text-align: center;
        border-radius: 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Better status indicators */
    .status-badge {
        display: inline-flex;
        align-items: center;
        padding: 0.25rem 0.75rem;
        border-radius: 9999px;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    /* Improved notification banners */
    .notification-banner {
        padding: 1rem;
        border-radius: 0.75rem;
        margin-bottom: 1rem;
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .notification-banner-icon {
        flex-shrink: 0;
        width: 1.5rem;
        height: 1.5rem;
        margin-top: 0.125rem;
    }
    
    .notification-banner-content {
        flex: 1;
        min-width: 0;
    }
    
    .notification-banner-title {
        font-weight: 600;
        margin-bottom: 0.25rem;
        font-size: 0.875rem;
    }
    
    .notification-banner-message {
        font-size: 0.8125rem;
        line-height: 1.4;
        opacity: 0.9;
    }
    
    .notification-banner-action {
        margin-top: 0.5rem;
        padding: 0.5rem 1rem;
        border-radius: 0.375rem;
        font-size: 0.8125rem;
        font-weight: 500;
    }
    
    /* Better loading states */
    .skeleton {
        background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%);
        background-size: 200% 100%;
        animation: skeleton-loading 1.5s infinite;
        border-radius: 0.375rem;
    }
    
    @keyframes skeleton-loading {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }
    
    /* Improved accessibility */
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    
    /* Focus indicators */
    .focus-visible {
        outline: 2px solid #60a5fa;
        outline-offset: 2px;
    }
    
    /* Better scroll behavior */
    .smooth-scroll {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Improved safe areas for notched devices */
    .safe-area-top {
        padding-top: env(safe-area-inset-top);
    }
    
    .safe-area-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .safe-area-left {
        padding-left: env(safe-area-inset-left);
    }
    
    .safe-area-right {
        padding-right: env(safe-area-inset-right);
    }
}
