/* ===================================
   MOBILE RESPONSIVE ENHANCEMENTS
   Add these styles to improve mobile UX
   =================================== */

/* Prevent zoom on input focus (iOS) */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Touch-friendly tap targets */
@media (max-width: 768px) {
    button,
    a,
    .clickable {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Responsive padding and margins */
@media (max-width: 640px) {
    .glass-card,
    .card {
        padding: 1rem !important;
    }
    
    .container,
    .wrapper {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Responsive typography */
@media (max-width: 640px) {
    h1 { font-size: 1.875rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    
    .text-3xl { font-size: 1.875rem !important; }
    .text-4xl { font-size: 2.25rem !important; }
    .text-5xl { font-size: 2.5rem !important; }
    .text-6xl { font-size: 3rem !important; }
}

/* Simplified animations on mobile */
@media (max-width: 768px) {
    .card-hover:hover {
        transform: translateY(-4px) scale(1.01) !important;
    }
    
    .btn-hover:hover {
        transform: translateY(-2px) !important;
    }
}

/* Responsive grid adjustments */
@media (max-width: 640px) {
    .grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
    
    .grid-cols-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    
    .grid-cols-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* Responsive modal */
@media (max-width: 640px) {
    .modal,
    .modal-content {
        max-width: 95vw !important;
        margin: 1rem !important;
    }
}

/* Sticky header adjustments */
@media (max-width: 640px) {
    header {
        padding: 0.75rem 1rem !important;
    }
    
    header h1 {
        font-size: 1.25rem !important;
    }
}

/* Chat container mobile */
@media (max-width: 640px) {
    .chat-container {
        height: calc(100vh - 160px) !important;
    }
    
    .user-message,
    .ai-message {
        max-width: 90% !important;
    }
}

/* Progress ring mobile */
@media (max-width: 640px) {
    .progress-ring {
        width: 140px !important;
        height: 140px !important;
    }
    
    .progress-ring svg {
        width: 140px !important;
        height: 140px !important;
    }
}

/* Quiz options mobile */
@media (max-width: 640px) {
    .option-btn {
        padding: 1rem !important;
        font-size: 0.875rem !important;
    }
}

/* Flexbox responsive adjustments */
@media (max-width: 640px) {
    .flex-row {
        flex-direction: column !important;
    }
    
    .flex-1 {
        width: 100% !important;
    }
}

/* Scrollbar mobile */
@media (max-width: 640px) {
    ::-webkit-scrollbar {
        width: 4px !important;
        height: 4px !important;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .safe-top {
        padding-top: max(1rem, env(safe-area-inset-top)) !important;
    }
    
    .safe-bottom {
        padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
    }
    
    .safe-left {
        padding-left: max(1rem, env(safe-area-inset-left)) !important;
    }
    
    .safe-right {
        padding-right: max(1rem, env(safe-area-inset-right)) !important;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 896px) and (orientation: landscape) {
    .h-screen {
        height: auto !important;
        min-height: 100vh !important;
    }
}

/* Better touch feedback */
@media (hover: none) and (pointer: coarse) {
    button:active,
    .btn:active {
        opacity: 0.7;
    }
}