/**
 * Mobile Common Styles
 * Shared mobile UI/UX enhancements for Q-Mak pages
 * November 23, 2025
 */

/* Mobile-optimized base styles */
@media (max-width: 768px) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* Touch-friendly buttons */
    button, .btn {
        min-height: 48px;
        min-width: 48px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    button:active, .btn:active {
        transform: scale(0.97);
    }
    
    /* Touch-friendly links */
    a {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Touch-friendly inputs */
    input, textarea, select {
        font-size: 16px !important; /* Prevents iOS zoom */
        min-height: 48px;
        padding: 0.875rem 1rem;
        border-radius: 0.75rem;
        transition: all 0.2s;
    }
    
    input:focus, textarea:focus, select:focus {
        outline: none;
        border-width: 2px;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    /* Card enhancements */
    .card, .bg-white {
        border-radius: 1.25rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
    
    /* Better modal sizing */
    .modal {
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Improved form spacing */
    .space-y-6 > * + * {
        margin-top: 1.25rem;
    }
    
    .space-y-4 > * + * {
        margin-top: 1rem;
    }
    
    /* Better typography */
    h1, h2, h3, h4 {
        line-height: 1.2;
        letter-spacing: -0.02em;
    }
    
    p, label {
        line-height: 1.5;
    }
    
    /* Logo sizing */
    img[alt*="Logo"] {
        max-height: 4rem;
        width: auto;
    }
    
    /* Improved shadows */
    .shadow-2xl {
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    }
    
    /* Better padding */
    .p-8 {
        padding: 1.5rem !important;
    }
    
    .p-10 {
        padding: 1.75rem !important;
    }
    
    /* Grid improvements */
    .grid-cols-2 {
        gap: 0.75rem;
    }
    
    .grid-cols-3 {
        gap: 0.75rem;
    }
    
    /* Form label improvements */
    label {
        font-weight: 600;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    /* Error/success message improvements */
    .bg-red-50, .bg-green-50, .bg-blue-50 {
        border-radius: 0.75rem;
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Better icon sizing */
    svg {
        flex-shrink: 0;
    }
    
    /* Improved progress indicators */
    .progress-indicator {
        padding: 0.5rem;
    }
    
    /* Better spacing for info boxes */
    .info-box {
        padding: 1rem;
        border-radius: 0.875rem;
        margin-bottom: 1rem;
    }
}

/* Landscape optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding: 0.5rem;
    }
    
    .p-8, .p-10 {
        padding: 1rem !important;
    }
    
    h1, h2, h3 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
}

/* Touch feedback animation */
@keyframes touchRipple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.touch-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
}

.touch-ripple:active::after {
    animation: touchRipple 0.6s ease-out;
}

/* Better focus states */
*:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.5);
    outline-offset: 2px;
}

/* Smooth transitions */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent overscroll */
body {
    overscroll-behavior-y: contain;
}

/* Safe area insets */
@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
