/* 
 * Infiknowledge - Responsive Design Enhancements
 * Mobile-first responsive improvements for all pages
 */

/* Base responsive adjustments */
html {
    font-size: 16px; /* Base font size */
}

@media (max-width: 1200px) {
    .container {
        padding: 0 2rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 992px) {
    html {
        font-size: 15px;
    }
    
    h1 {
        font-size: 2.3rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    section {
        padding: 4rem 0;
    }
    
    /* Adjust grid layouts to fewer columns */
    .grid-layout-3,
    .grid-layout-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    /* Convert multi-column layouts to single column */
    .grid-layout-2,
    .grid-layout-3,
    .grid-layout-4 {
        grid-template-columns: 1fr;
    }
    
    /* Adjust flexbox to column layout */
    .flex-row {
        flex-direction: column;
    }
    
    /* Ensure buttons stack properly on mobile */
    .btn-group {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-group .btn {
        margin: 0.5rem 0;
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 576px) {
    html {
        font-size: 13px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    section {
        padding: 2.5rem 0;
    }
    
    .container {
        padding: 0 1.25rem;
    }
}

/* Images and media responsiveness */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* Improved table responsiveness */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Fix for hero sections across pages */
@media (max-width: 768px) {
    .hero-section {
        padding: 40px 0 !important;
    }
    
    .hero-section h1 {
        font-size: 2rem !important;
    }
    
    .hero-subtitle {
        font-size: 1.1rem !important;
    }
    
    .hero-stats {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .stat-box {
        width: 100% !important;
    }
    
    .hero-badges {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Card grid responsiveness */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr !important;
    }
    
    .card {
        margin-bottom: 1.5rem;
    }
}

/* Timeline responsiveness improvements */
@media (max-width: 768px) {
    .process-timeline::before {
        left: 25px !important;
    }
    
    .timeline-item {
        flex-direction: column !important;
    }
    
    .timeline-marker {
        width: 100% !important;
        margin-bottom: 1rem;
    }
    
    .marker {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.1rem !important;
    }
    
    .timeline-content {
        padding-left: 0 !important;
    }
}

/* FAQ responsiveness */
@media (max-width: 768px) {
    .faq-question {
        font-size: 1.1rem !important;
        padding: 15px !important;
    }
    
    .faq-answer div {
        padding: 0 15px 15px !important;
    }
}

/* Fix for the recovery-cta component */
@media (max-width: 768px) {
    .recovery-cta {
        flex-direction: column !important;
        padding: 30px !important;
    }
    
    .recovery-stats-grid {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .recovery-badges {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px !important;
    }
    
    .recovery-cta-content h3 {
        font-size: 1.5rem !important;
    }
}

/* Enhance form responsiveness */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        padding: 0.6rem 0.8rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Zero-click SEO page specific fixes */
@media (max-width: 768px) {
    .pillars-grid,
    .results-grid,
    .challenge-grid {
        grid-template-columns: 1fr !important;
    }
    
    .pillar-item,
    .result-card,
    .challenge-item {
        margin-bottom: 1.5rem;
    }
    
    .result-stats {
        flex-direction: column;
        gap: 15px;
    }
}

/* Fix-my-seo page specific fixes */
@media (max-width: 768px) {
    .problem-grid,
    .framework-grid,
    .case-studies-grid {
        grid-template-columns: 1fr !important;
    }
    
    .problem-item,
    .framework-item,
    .case-study {
        margin-bottom: 1.5rem;
    }
}

/* Improved navigation menu for mobile */
@media (max-width: 992px) {
    .mobile-nav-toggle {
        display: block !important;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        background: var(--white);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        padding: 80px 20px 20px;
        z-index: 100;
        overflow-y: auto;
        transition: right 0.3s ease;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu ul {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-menu li {
        margin: 10px 0;
        width: 100%;
    }
    
    .nav-menu .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        padding: 10px 0 10px 15px;
        display: none;
    }
    
    .nav-menu .dropdown.active .dropdown-menu {
        display: block;
    }
}

/* Accessibility improvements for focus states */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid rgba(78, 115, 223, 0.4) !important;
    outline-offset: 2px !important;
}

/* Print media styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        color: black;
        background: white;
    }
    
    a {
        text-decoration: underline;
        color: black;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
    }
}
