/* ========================================
   MOBILE-RESPONSIVE ENHANCEMENTS
   For SimpleUP AI Website
   ======================================== */

/* ===================
   BASE RESPONSIVE STYLES
   =================== */

/* Ensure all images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Box sizing for all elements */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}

/* ===================
   NAVIGATION - MOBILE
   =================== */

@media (max-width: 768px) {
    /* Header adjustments */
    .header {
        padding: 1rem 0;
    }

    .header .container {
        padding: 0 1rem;
    }

    .header .grid {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Logo sizing */
    .header img {
        max-width: 200px;
        height: auto;
    }

    /* Hamburger button */
    .hamburger {
        display: block;
        background: #ff5900;
        color: white;
        border: none;
        padding: 10px 15px;
        font-size: 24px;
        cursor: pointer;
        border-radius: 4px;
        min-width: 44px;
        min-height: 44px;
        z-index: 1001;
    }

    .hamburger:hover {
        background: #d94d00;
    }

    /* Mobile navigation menu */
    .nav-menu {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        z-index: 1000;
        padding: 1rem 0;
    }

    .nav-menu.active {
        display: block;
    }

    .nav-menu li {
        border-bottom: 1px solid #eee;
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-link {
        display: block;
        padding: 15px 20px;
        color: #333;
        text-decoration: none;
        font-size: 16px;
        min-height: 44px;
    }

    .nav-link:hover {
        background: #f8f9fa;
        color: #ff5900;
    }

    /* Submenu mobile styles */
    .submenu {
        position: static;
        display: none;
        box-shadow: none;
        background: #f8f9fa;
        padding: 0;
    }

    .submenu.active {
        display: block;
    }

    .submenu li {
        border-bottom: 1px solid #ddd;
    }

    .submenu a {
        padding: 12px 20px 12px 40px;
        font-size: 15px;
    }

    .has-submenu > .nav-link {
        position: relative;
    }

    .caret {
        position: absolute;
        right: 20px;
        transition: transform 0.3s ease;
    }

    .has-submenu.active .caret {
        transform: rotate(180deg);
    }
}

/* ===================
   GRID SYSTEM - MOBILE
   =================== */

@media (max-width: 768px) {
    .grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .grid-column,
    .grid-column--50,
    .grid-column--33,
    .grid-column--25 {
        width: 100% !important;
        max-width: 100%;
    }
}

/* ===================
   TYPOGRAPHY - MOBILE
   =================== */

@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }

    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 0.875rem;
    }

    h3 {
        font-size: 1.25rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }

    h4 {
        font-size: 1.1rem;
        line-height: 1.3;
    }

    p, body {
        font-size: 16px;
        line-height: 1.6;
    }

    .section-heading {
        font-size: 1.5rem;
        text-align: center;
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    .section-heading {
        font-size: 1.35rem;
    }
}

/* ===================
   HERO SECTION - MOBILE
   =================== */

@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }

    .hero-section .container {
        padding: 0 1rem;
    }

    .hero-section .grid {
        grid-template-columns: 1fr;
    }

    .hero-section h1 {
        text-align: center;
    }

    .hero-section p {
        text-align: center;
        margin-bottom: 1.5rem;
    }

    /* Video container order */
    .hero-section .grid-column:first-child {
        order: 1;
    }

    .hero-section .grid-column:last-child {
        order: 2;
        margin-top: 1.5rem;
    }

    /* Video responsive */
    .video-container {
        position: relative;
        padding-bottom: 56.25%;
        height: 0;
        overflow: hidden;
        border-radius: 8px;
    }

    .video-container iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* ===================
   BUTTONS & CTAs - MOBILE
   =================== */

@media (max-width: 768px) {
    .cta-button,
    button[type="submit"],
    .button {
        display: block;
        width: 100%;
        max-width: 100%;
        min-height: 48px;
        padding: 14px 24px;
        font-size: 16px;
        text-align: center;
        margin: 1rem auto;
        cursor: pointer;
        border-radius: 5px;
        text-decoration: none;
    }

    .cta-button {
        background: #ff5900;
        color: white;
        border: none;
    }

    .cta-button:hover {
        background: #d94d00;
    }

    /* Touch target sizing */
    a, button, input[type="submit"] {
        min-height: 44px;
    }
}

/* ===================
   CONTAINERS & SPACING
   =================== */

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
        max-width: 100%;
        margin: 0 auto;
    }

    .ak-section {
        padding: 2rem 0;
    }

    section {
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    .ak-section {
        padding: 1.5rem 0;
    }
}

/* ===================
   TRUST BAR / STATS - MOBILE
   =================== */

@media (max-width: 768px) {
    .trust-bar .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat {
        text-align: center;
        padding: 1rem;
        margin-bottom: 0.5rem;
    }

    .stat-value {
        font-size: 2.5rem;
        color: #ff5900;
        font-weight: bold;
        margin-bottom: 0.5rem;
    }

    .stat p {
        font-size: 1rem;
        margin: 0;
    }
}

/* ===================
   BENEFITS SECTION - MOBILE
   =================== */

@media (max-width: 768px) {
    .benefits-section .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .benefit {
        text-align: center;
        padding: 1rem;
    }

    .benefit img {
        max-width: 180px;
        height: auto;
        margin: 0 auto 1rem;
        display: block;
    }

    .benefit h3 {
        margin-bottom: 0.75rem;
    }

    .benefit p {
        font-size: 15px;
        line-height: 1.5;
    }
}

/* ===================
   INDUSTRY SECTIONS - MOBILE
   =================== */

@media (max-width: 768px) {
    .industry {
        margin-bottom: 2rem;
        text-align: center;
    }

    .industry img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        margin-bottom: 1rem;
    }

    .industry h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .industry p {
        font-size: 15px;
        line-height: 1.5;
    }
}

/* ===================
   FORMS - MOBILE
   =================== */

@media (max-width: 768px) {
    form {
        padding: 1rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    select,
    textarea {
        width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 15px;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        -webkit-appearance: none;
        appearance: none;
    }

    textarea {
        min-height: 120px;
        resize: vertical;
    }

    label {
        display: block;
        margin-bottom: 5px;
        font-weight: 600;
        font-size: 15px;
    }

    input[type="submit"],
    button[type="submit"] {
        width: 100%;
        min-height: 48px;
        font-size: 16px;
        padding: 14px;
        margin-top: 10px;
    }

    /* Select dropdown arrow */
    select {
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23333" d="M6 9L1 4h10z"/></svg>');
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 35px;
    }
}

/* ===================
   FOOTER - MOBILE ENHANCED
   =================== */

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    footer {
        padding: 2rem 0 1rem;
    }

    .footer-container {
        padding: 0 1rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .footer-column {
        text-align: center;
        padding: 1rem 0;
    }

    .footer-column--brand .footer-heading {
        font-size: 1.3rem;
    }

    .footer-heading {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .footer-description {
        font-size: 15px;
        line-height: 1.5;
    }

    .footer-phone {
        font-size: 1.2rem;
        display: inline-block;
        padding: 10px 20px;
        margin-top: 10px;
    }

    .footer-links {
        text-align: center;
    }

    .footer-links li {
        margin-bottom: 0.75rem;
    }

    .footer-links a {
        display: inline-block;
        padding: 8px 0;
        font-size: 15px;
        min-height: 44px;
        line-height: 28px;
    }

    .footer-socials {
        gap: 1.5rem;
        margin-top: 1rem;
    }

    .footer-socials img {
        width: 32px;
        height: 32px;
    }

    .footer-company-info,
    .footer-copyright {
        font-size: 14px;
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .footer-column--brand .footer-heading {
        font-size: 1.2rem;
    }

    .footer-phone {
        font-size: 1.1rem;
    }
}

/* ===================
   INTEGRATION LOGOS - MOBILE
   =================== */

@media (max-width: 1024px) {
    .integration-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .integration-grid img {
        max-width: 120px;
        max-height: 60px;
    }
}

@media (max-width: 768px) {
    .integration-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .integration-grid .ak-image-box {
        padding: 0.75rem;
    }

    .integration-grid img {
        max-width: 100px;
        max-height: 50px;
    }
}

@media (max-width: 480px) {
    .integration-grid {
        grid-template-columns: 1fr;
    }

    .integration-grid img {
        max-width: 150px;
        max-height: 70px;
    }
}

/* ===================
   TABLES - MOBILE
   =================== */

@media (max-width: 768px) {
    table {
        width: 100%;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table th,
    table td {
        padding: 10px;
        font-size: 14px;
    }
}

/* ===================
   SCROLL TO TOP BUTTON
   =================== */

@media (max-width: 768px) {
    #toTop {
        width: 48px;
        height: 48px;
        line-height: 48px;
        font-size: 20px;
        bottom: 20px;
        right: 20px;
    }
}

/* ===================
   ACCESSIBILITY - MOBILE
   =================== */

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #ff5900;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Focus styles for keyboard navigation */
@media (max-width: 768px) {
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid #ff5900;
        outline-offset: 2px;
    }
}

/* ===================
   PERFORMANCE - LAZY LOADING
   =================== */

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ===================
   UTILITIES - MOBILE
   =================== */

/* Hide on mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Show only on mobile */
.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .show-mobile {
        display: block;
    }
}

/* Text alignment utilities */
@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center;
    }

    .text-left-mobile {
        text-align: left;
    }
}

/* Spacing utilities */
@media (max-width: 768px) {
    .mt-mobile-1 { margin-top: 1rem; }
    .mt-mobile-2 { margin-top: 2rem; }
    .mb-mobile-1 { margin-bottom: 1rem; }
    .mb-mobile-2 { margin-bottom: 2rem; }
    .p-mobile-1 { padding: 1rem; }
    .p-mobile-2 { padding: 2rem; }
}

/* ===================
   LANDSCAPE ORIENTATION
   =================== */

@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 1.5rem 0;
    }

    .nav-menu {
        max-height: 50vh;
    }
}

/* ===================
   HIGH DPI SCREENS
   =================== */

@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2),
       (max-width: 768px) and (min-resolution: 192dpi) {
    /* Ensure images look sharp on retina displays */
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}
