/* Responsive Design Enhancements */

/* Extra Small Devices (Phones) */
@media (max-width: 640px) {
    /* Header */
    .mobile-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: white;
        z-index: 1000;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .logo-img {
        max-height: 60px !important;
        max-width: 60px !important;
    }
    
    /* Hero Section */
    .hero-section h1 {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .hero-section p {
        font-size: 1rem !important;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .hero-buttons a {
        width: 100%;
        text-align: center;
    }
    
    /* Pricing Cards */
    .pricing-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .pricing-card {
        transform: none !important;
        margin: 0 !important;
    }
    
    /* Feature Cards */
    .feature-grid {
        grid-template-columns: 1fr !important;
    }
    
    .feature-card {
        padding: 20px !important;
    }
    
    /* Forms */
    .contact-form {
        padding: 20px !important;
    }
    
    input, textarea, select {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    /* WhatsApp Button */
    .whatsapp-float {
        bottom: 20px !important;
        right: 20px !important;
        width: 60px !important;
        height: 60px !important;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr !important;
        text-align: center;
    }
    
    .footer-logo {
        margin-bottom: 30px;
    }
    
    /* Tables */
    .data-table {
        display: block;
        overflow-x: auto;
    }
}

/* Small Devices (Tablets) */
@media (min-width: 641px) and (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .feature-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Medium Devices (Laptops) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 90% !important;
    }
    
    .pricing-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Large Devices (Desktops) */
@media (min-width: 1025px) {
    .container {
        max-width: 1200px !important;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .whatsapp-float {
        display: none !important;
    }
    
    nav, footer {
        display: none !important;
    }
    
    body {
        font-size: 12pt !important;
        color: #000 !important;
        background: white !important;
    }
    
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    .pricing-card {
        break-inside: avoid;
        border: 1px solid #000 !important;
        color: #000 !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a202c;
        --bg-secondary: #2d3748;
        --text-primary: #f7fafc;
        --text-secondary: #cbd5e0;
    }
    
    body {
        background-color: var(--bg-primary);
        color: var(--text-primary);
    }
    
    .bg-white {
        background-color: var(--bg-secondary) !important;
    }
    
    .text-gray-800, .text-gray-900 {
        color: var(--text-primary) !important;
    }
    
    .text-gray-600, .text-gray-500 {
        color: var(--text-secondary) !important;
    }
    
    .border-gray-200, .border-gray-300 {
        border-color: #4a5568 !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    * {
        border-color: currentColor !important;
    }
    
    a {
        text-decoration: underline !important;
    }
    
    button, .btn {
        border: 2px solid currentColor !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-pulse, .animate-bounce, .animate-spin {
        animation: none !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    button, 
    a, 
    .btn, 
    .clickable {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    input, 
    select, 
    textarea {
        font-size: 16px !important; /* Prevents zoom */
    }
    
    /* Larger touch targets */
    .nav-link {
        padding: 12px 16px !important;
    }
    
    .form-control {
        padding: 12px !important;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
    
    .mobile-menu {
        max-height: 80vh;
        overflow-y: auto;
    }
}

/* Very Small Height Devices */
@media (max-height: 600px) {
    .hero-section h1 {
        font-size: 2rem !important;
        margin-bottom: 10px !important;
    }
    
    .hero-section p {
        font-size: 1rem !important;
        margin-bottom: 15px !important;
    }
    
    .section-padding {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e2e8f0;
    border-top-color: #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Accessibility Improvements */
.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-visible {
    outline: 3px solid #4299e1 !important;
    outline-offset: 2px !important;
}

/* Performance Optimizations */
img {
    content-visibility: auto;
}

.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-load.loaded {
    opacity: 1;
}