/* Comprehensive Responsive Styles for Small SEO Engine Marketing Site */

/* Base responsive settings */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
}

img, 
video, 
iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container responsive padding */
.container,
.max-w-7xl,
.max-w-6xl,
.max-w-5xl {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Navigation Responsive Styles */
@media (max-width: 1024px) {
    /* Tablet Navigation */
    nav .max-w-7xl {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    nav .space-x-8 {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Mobile Navigation */
    nav .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    nav .text-xl {
        font-size: 1.125rem;
        line-height: 1.75rem;
    }
    
    /* Mobile menu full width */
    #mobile-menu {
        width: 100%;
    }
    
    /* Ensure mobile menu is accessible */
    .md\:hidden {
        display: block;
    }
    
    .md\:flex {
        display: none;
    }
}

/* Hero Section Responsive */
@media (max-width: 1024px) {
    .hero-gradient,
    .hero-section {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
        line-height: 3rem;
    }
    
    .hero-section h2 {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding-top: 3rem;
        padding-bottom: 3rem;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        line-height: 2.5rem;
    }
    
    .hero-section h2 {
        font-size: 1.5rem;
        line-height: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
        line-height: 1.5rem;
    }
    
    .hero-section .text-xl {
        font-size: 1.125rem;
    }
    
    .hero-section .text-2xl {
        font-size: 1.5rem;
    }
    
    /* Hero buttons stack on mobile */
    .hero-section .flex.space-x-4,
    .hero-section .flex.gap-4 {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .hero-section a,
    .hero-section button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 1.75rem;
        line-height: 2.25rem;
    }
    
    .hero-section h2 {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }
}

/* Grid Systems Responsive */
@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .grid-cols-4,
    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .grid {
        gap: 1.5rem;
    }
    
    /* Feature grids */
    .feature-grid,
    .product-grid,
    .stats-grid,
    .service-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Card Components Responsive */
@media (max-width: 768px) {
    .card,
    .feature-card,
    .product-card,
    .pricing-card {
        margin-bottom: 1.5rem;
    }
    
    .card-hover:hover {
        transform: none;
    }
    
    /* Pricing cards stack */
    .pricing-cards,
    .pricing-grid {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* Typography Responsive */
@media (max-width: 768px) {
    h1, .text-5xl, .text-6xl {
        font-size: 2rem;
        line-height: 2.5rem;
    }
    
    h2, .text-4xl {
        font-size: 1.75rem;
        line-height: 2.25rem;
    }
    
    h3, .text-3xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }
    
    h4, .text-2xl {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }
    
    h5, .text-xl {
        font-size: 1.125rem;
        line-height: 1.75rem;
    }
}

@media (max-width: 480px) {
    h1, .text-5xl, .text-6xl {
        font-size: 1.75rem;
        line-height: 2.25rem;
    }
    
    h2, .text-4xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }
}

/* Button Responsive */
@media (max-width: 768px) {
    .btn,
    .btn-primary,
    .btn-secondary,
    button[class*="bg-"],
    a[class*="bg-"] {
        width: 100%;
        display: block;
        text-align: center;
        padding: 0.875rem 1.5rem;
    }
    
    /* Button groups */
    .flex.space-x-4 > .btn,
    .flex.space-x-4 > button,
    .flex.gap-4 > .btn,
    .flex.gap-4 > button {
        margin-bottom: 0.75rem;
    }
}

/* Forms Responsive */
@media (max-width: 768px) {
    form input,
    form textarea,
    form select {
        width: 100%;
        font-size: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Tables Responsive */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Footer Responsive */
@media (max-width: 1024px) {
    footer .grid-cols-4,
    footer .grid-cols-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    footer .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    footer .flex.justify-between {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Spacing Adjustments for Mobile */
@media (max-width: 768px) {
    section {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }
    
    .py-24 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .py-20 {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }
    
    .py-16 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .px-8 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .gap-8 {
        gap: 1.5rem;
    }
    
    .space-y-8 > * + * {
        margin-top: 1.5rem;
    }
}

@media (max-width: 480px) {
    section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .py-24,
    .py-20,
    .py-16 {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .max-w-7xl,
    .max-w-6xl,
    .max-w-5xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Images and Media Responsive */
@media (max-width: 768px) {
    .screenshot-frame,
    .image-frame {
        padding: 0.5rem;
        margin: 0 auto;
    }
    
    .animate-float {
        animation: none;
    }
}

/* FAQ Accordion Responsive */
@media (max-width: 768px) {
    .faq-content.active {
        max-height: 400px;
    }
}

/* Stats/Metrics Responsive */
@media (max-width: 768px) {
    .stats-container {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stat-item {
        width: 100%;
        text-align: center;
    }
}

/* Testimonial Responsive */
@media (max-width: 768px) {
    .testimonial-grid {
        grid-template-columns: 1fr;
    }
    
    .testimonial-card {
        margin: 0;
    }
}

/* CTA Sections Responsive */
@media (max-width: 768px) {
    .cta-section {
        text-align: center;
        padding: 2rem 1rem;
    }
    
    .cta-section .flex {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Modal/Popup Responsive */
@media (max-width: 768px) {
    .modal,
    .popup,
    #exit-popup > div {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        padding: 1.5rem;
    }
}

/* Logo Responsive */
@media (max-width: 480px) {
    .logo,
    nav .text-xl.font-bold {
        font-size: 1rem;
        line-height: 1.5rem;
    }
}

/* Flexbox Adjustments */
@media (max-width: 768px) {
    .flex-row {
        flex-direction: column;
    }
    
    .flex.justify-between {
        flex-direction: column;
        gap: 1rem;
    }
    
    .flex.items-center {
        align-items: stretch;
    }
    
    .space-x-4,
    .space-x-6,
    .space-x-8 {
        gap: 0.75rem;
    }
}

/* Touch-friendly Interactive Elements */
@media (max-width: 768px) {
    button,
    a[role="button"],
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1rem;
    }
    
    /* Increase tap targets */
    nav a,
    .menu-item {
        padding: 0.75rem 0.5rem;
    }
}

/* Horizontal Scroll Prevention */
@media (max-width: 768px) {
    .max-w-full {
        max-width: 100%;
    }
    
    /* Prevent content overflow */
    * {
        max-width: 100vw;
    }
    
    .container,
    section,
    div[class*="max-w"] {
        overflow-x: hidden;
    }
}

/* Print Styles */
@media print {
    nav,
    footer,
    .no-print,
    #mobile-menu,
    #mobile-menu-btn,
    .btn,
    button {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }
    
    a {
        text-decoration: underline;
        color: black;
    }
}

/* Accessibility Enhancements for Mobile */
@media (max-width: 768px) {
    /* Ensure focus states are visible */
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 2px solid #2563eb;
        outline-offset: 2px;
    }
    
    /* Skip to main content link */
    .skip-to-main {
        position: absolute;
        top: -40px;
        left: 0;
        background: #2563eb;
        color: white;
        padding: 8px;
        text-decoration: none;
        z-index: 100;
    }
    
    .skip-to-main:focus {
        top: 0;
    }
}

/* Landscape Orientation Adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    section {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
}

/* Very Large Screens */
@media (min-width: 1536px) {
    .max-w-7xl {
        max-width: 1536px;
    }
}
