/**
 * VoidTech CMS - Mobile Responsive CSS
 * Automatically loaded on all frontend pages to ensure mobile compatibility
 * Uses !important to override inline styles when necessary
 */

/* Base mobile viewport settings */
@media (max-width: 768px) {
    /* Ensure body doesn't overflow */
    body {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    /* Prevent horizontal scroll */
    html {
        overflow-x: hidden !important;
    }

    /* Hero sections - Make responsive */
    .hero,
    section.hero,
    div.hero {
        padding: 2rem 1rem !important;
        min-height: auto !important;
        height: auto !important;
    }

    .hero h1 {
        font-size: 1.75rem !important;
        line-height: 2rem !important;
        margin-bottom: 1rem !important;
    }

    .hero h2 {
        font-size: 1.5rem !important;
        line-height: 1.75rem !important;
    }

    .hero p {
        font-size: 1rem !important;
        line-height: 1.5rem !important;
        margin-bottom: 1rem !important;
    }

    .hero .btn,
    .hero a.btn,
    .hero button {
        width: 100% !important;
        margin: 0.5rem 0 !important;
        padding: 0.75rem 1rem !important;
    }

    /* Grid containers - Stack on mobile */
    .grid-container,
    .grid,
    div[class*="grid"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100% !important;
        padding: 1rem !important;
    }

    .grid-container > *,
    .grid > * {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    /* Page content - Responsive padding and spacing */
    .page-content,
    .content,
    main {
        padding: 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
    }

    /* Images - Responsive */
    img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Tables - Horizontal scroll */
    table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-width: 100% !important;
    }

    /* Cards - Full width on mobile */
    .card,
    div[class*="card"] {
        width: 100% !important;
        margin: 0.5rem 0 !important;
        padding: 1rem !important;
    }

    /* Flexbox - Stack on mobile */
    .flex,
    div[class*="flex"] {
        flex-direction: column !important;
    }

    .flex > *,
    div[class*="flex"] > * {
        width: 100% !important;
        margin: 0.5rem 0 !important;
    }

    /* Buttons - Full width on mobile */
    .btn,
    a.btn,
    button:not(.hamburger):not([class*="theme"]) {
        width: 100% !important;
        text-align: center !important;
        padding: 0.75rem 1rem !important;
        margin: 0.5rem 0 !important;
    }

    /* Forms - Responsive inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
    }

    /* Navigation - Mobile friendly */
    nav ul {
        flex-direction: column !important;
        width: 100% !important;
    }

    nav li {
        width: 100% !important;
        margin: 0.25rem 0 !important;
    }

    nav a {
        display: block !important;
        padding: 0.75rem 1rem !important;
    }

    /* Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }

    /* Show mobile-only elements */
    .mobile-only {
        display: block !important;
    }

    /* Text sizing - Responsive typography */
    h1 {
        font-size: 2rem !important;
        line-height: 2.25rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
        line-height: 2rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
        line-height: 1.75rem !important;
    }

    h4, h5, h6 {
        font-size: 1.125rem !important;
        line-height: 1.5rem !important;
    }

    p {
        font-size: 1rem !important;
        line-height: 1.5rem !important;
        margin-bottom: 1rem !important;
    }

    /* Spacing utilities */
    section {
        padding: 2rem 1rem !important;
    }

    /* Max width containers */
    .max-w-7xl,
    .max-w-6xl,
    .max-w-5xl,
    .max-w-4xl {
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Tablet breakpoint */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    .grid-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Desktop - Remove mobile overrides */
@media (min-width: 1025px) {
    .mobile-only {
        display: none !important;
    }

    .desktop-only {
        display: block !important;
    }
}
