/* Mobile-specific styles for LiquidFromCloud */

/* Base mobile styles */
body {
    padding-bottom: 60px; /* Space for bottom navigation */
    overflow-x: hidden;
    background-color: #eff6ff; /* Light blue background */
}

/* Mobile navigation */
.mobile-nav {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Hide scrollbar on mobile */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Touch-friendly buttons */
.touch-btn {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

/* Swipe gestures */
.swipeable {
    touch-action: pan-y;
}

/* Mobile product cards */
.mobile-product-card {
    transition: transform 0.2s ease;
}

.mobile-product-card:active {
    transform: scale(0.98);
}

/* Mobile hero section */
.mobile-hero {
    min-height: 50vh;
    background-attachment: scroll; /* Better performance on mobile */
}

/* Mobile search bar animation */
.mobile-search {
    transition: all 0.3s ease;
}

.mobile-search.active {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Mobile menu animations */
.mobile-menu-enter {
    transform: translateX(100%);
}

.mobile-menu-enter-active {
    transform: translateX(0);
    transition: transform 0.3s ease-out;
}

.mobile-menu-exit {
    transform: translateX(0);
}

.mobile-menu-exit-active {
    transform: translateX(100%);
    transition: transform 0.3s ease-in;
}

/* Mobile cart sidebar */
.mobile-cart {
    width: 100vw;
    max-width: 100vw;
}

/* Mobile modal */
.mobile-modal {
    padding: 0;
    margin: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    max-width: 100vw;
    max-height: 100vh;
}

.mobile-modal-content {
    height: 100%;
    overflow-y: auto;
}

/* Safe area handling 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);
}

/* iOS-style navigation */
.ios-nav {
    -webkit-appearance: none;
    border-radius: 0;
    background: rgba(248, 248, 248, 0.8);
}

/* Android-style navigation */
.android-nav {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Pull-to-refresh styles */
.pull-to-refresh {
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.pull-to-refresh.pulling {
    transform: translateY(60px);
}

.ptr-indicator {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

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

/* Mobile grid optimizations */
.mobile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.mobile-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Mobile typography */
.mobile-heading {
    font-size: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.2;
}

.mobile-subheading {
    font-size: clamp(1.125rem, 3vw, 1.25rem);
    line-height: 1.3;
}

.mobile-body {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    line-height: 1.5;
}

.mobile-caption {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    line-height: 1.4;
}

/* Mobile spacing */
.mobile-section {
    padding: 1rem;
}

.mobile-container {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Mobile forms */
.mobile-input {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

.mobile-input:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.mobile-button {
    min-height: 44px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    touch-action: manipulation;
    user-select: none;
}

.mobile-button:active {
    transform: scale(0.98);
}

.mobile-button-primary {
    background-color: #1e40af;
    color: white;
    border: none;
}

.mobile-button-primary:hover {
    background-color: #93c5fd;
}

.mobile-button-secondary {
    background-color: #93c5fd;
    color: #1e3a8a;
    border: none;
}

.mobile-button-outline {
    background-color: transparent;
    color: #1e40af;
    border: 2px solid #1e40af;
}

/* Mobile cards */
.mobile-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.mobile-card:active {
    transform: scale(0.98);
}

.mobile-card-elevated {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Mobile list items */
.mobile-list-item {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.mobile-list-item:active {
    background-color: #f9fafb;
}

.mobile-list-item:last-child {
    border-bottom: none;
}

/* Mobile badges */
.mobile-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 10px;
    background-color: #3b82f6;
    color: white;
}

/* Mobile notifications */
.mobile-notification {
    position: fixed;
    top: 20px;
    left: 16px;
    right: 16px;
    z-index: 1000;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-100px);
    transition: transform 0.3s ease;
}

.mobile-notification.show {
    transform: translateY(0);
}

/* Mobile tabs */
.mobile-tabs {
    display: flex;
    background: white;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mobile-tab {
    flex: 1;
    padding: 8px 16px;
    text-align: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
}

.mobile-tab.active {
    background-color: #1e40af;
    color: white;
}

/* Mobile bottom sheet */
.mobile-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    max-height: 90vh;
    overflow-y: auto;
}

.mobile-bottom-sheet.open {
    transform: translateY(0);
}

.mobile-bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 12px auto 20px;
}

/* Mobile image optimizations */
.mobile-image {
    object-fit: cover;
    width: 100%;
    height: auto;
}

.mobile-image-lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-image-lazy.loaded {
    opacity: 1;
}

/* Mobile performance optimizations */
.mobile-optimized {
    will-change: transform;
    transform: translateZ(0);
}

.mobile-no-bounce {
    overscroll-behavior: none;
}

/* Landscape mode adjustments */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .mobile-hero {
        min-height: 40vh;
    }
    
    .mobile-section {
        padding: 0.5rem;
    }
    
    .mobile-container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mobile-card {
        background: #1f2937;
        color: white;
    }
    
    .mobile-input {
        background: #374151;
        border-color: #4b5563;
        color: white;
    }
    
    .mobile-list-item {
        border-color: #374151;
    }
    
    .mobile-list-item:active {
        background-color: #374151;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

/* Print styles for mobile */
@media print {
    .mobile-nav,
    .mobile-tabs,
    .mobile-button,
    .mobile-bottom-sheet {
        display: none !important;
    }
    
    body {
        padding-bottom: 0;
    }
}

/* PWA specific styles */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
    }
    
    .mobile-nav {
        padding-top: env(safe-area-inset-top);
    }
}
