/* Mobile-specific styles for better mobile experience */

/* Carousel image adjustments for mobile */
@media (max-width: 768px) {
    .client-logo {
        padding: 0 10px; /* Maintain horizontal spacing */
        position: relative;
        cursor: default; /* Remove pointer cursor */
        -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
        touch-action: pan-y; /* Only allow vertical touch scrolling */
        pointer-events: none; /* Disable pointer events by default */
    }
    
    /* Enable pointer events for container but prevent navigation */
    .client-logo .logo-container {
        pointer-events: auto;
    }
    
    /* Make sure images don't interfere with clicks */
    .client-logo img {
        pointer-events: none;
    }
    
    .logo-container {
        position: relative;
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    
    .logo-container img {
        width: 100%;
        height: auto;
        max-height: 80px; /* Reduced height for mobile */
        object-fit: contain;
        aspect-ratio: 16/9; /* 16:9 aspect ratio */
        transition: filter 0.3s ease;
    }
    
    .client-overlay {
        position: relative;
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 8px;
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease;
        pointer-events: none;
        z-index: 10;
        border-radius: 0 0 8px 8px;
        margin-top: 0;
        transform: translateY(-10px);
    }
    
    /* Active state for mobile overlay */
    .client-overlay.mobile-active {
        max-height: 100px; /* Adjust based on your content */
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
        margin-top: 5px;
    }
    
    /* Active slide styling */
    .client-logo img {
        transition: filter 0.3s ease;
    }
    
    .client-logo img:not(.grayscale) {
        filter: grayscale(0) !important;
    }
    
    .client-overlay h3 {
        font-size: 0.9rem;
        margin-bottom: 2px;
        color: #fff;
    }
    
    .client-overlay p {
        font-size: 0.7rem;
        margin: 0;
        color: #ddd;
    }
}


/* Base mobile styles */
@media (max-width: 768px) {
    /* Service card layout */
    .service-card {
        flex-direction: column;
        padding: 1.5rem 1rem;
    }

    .service-content {
        width: 100%;
        padding-right: 0;
        margin-bottom: 2rem;
    }

    .service-visual {
        width: 100%;
        height: 60vh;
        min-height: 400px;
        margin-top: 1.5rem;
    }

    /* 3D Model Container */
    .model-container {
        height: 100%;
        border-radius: 12px;
        overflow: hidden;
    }

    /* Model info card */
    .model-info-card {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: calc(100% - 2rem);
    }

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

    /* Touch-friendly buttons */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    /* Adjust typography for mobile */
    h2 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    p {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* Mobile menu styles */
    #mobile-menu {
        width: 85%;
        max-width: 320px;
    }

    /* Service list items */
    .service-features li {
        margin-bottom: 0.75rem;
        font-size: 0.95rem;
    }

    /* Visual elements spacing */
    .visual-element {
        margin: 1.5rem 0;
    }

    /* Ensure 3D cube is properly sized */
    .model-viewer {
        width: 100%;
        height: 100%;
    }

    /* Adjust info panel */
    .info-panel {
        padding: 1rem;
        margin: 1rem 0;
    }

    /* Slider controls */
    .slider-controls {
        bottom: 1.5rem;
    }

    .control-dot {
        width: 8px;
        height: 8px;
    }

    .control-dot.active {
        width: 24px;
    }
}

/* Larger mobile devices */
@media (min-width: 481px) and (max-width: 768px) {
    .service-visual {
        height: 70vh;
    }
}

/* Smaller mobile devices */
@media (max-width: 480px) {
    .service-visual {
        height: 50vh;
        min-height: 350px;
    }
    
    .model-info-card {
        padding: 0.75rem;
    }
    
    .model-info h4 {
        font-size: 0.9rem;
    }
    
    .model-stats span {
        font-size: 0.8rem;
    }
}

/* Mobile Menu Styles */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: #0f172a;
    z-index: 50;
    transition: all 0.3s ease-in-out;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

#mobile-menu.active {
    right: 0;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

#mobile-menu .container {
    padding: 2rem 1.5rem;
}

#close-menu {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

#close-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

#mobile-menu nav {
    margin-top: 3rem;
}

#mobile-menu a {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    color: #e2e8f0;
    text-decoration: none;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

#mobile-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(4px);
}

#mobile-menu i[data-feather] {
    margin-right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    color: #FFBF00;
}

/* Active state for current page */
#mobile-menu a[aria-current="page"] {
    background: rgba(255, 191, 0, 0.1);
    color: #FFBF00;
    font-weight: 500;
}

#mobile-menu a[aria-current="page"]:hover {
    background: rgba(255, 191, 0, 0.15);
}

/* Animation for menu items */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#mobile-menu a {
    opacity: 0;
    animation: slideInRight 0.3s ease-out forwards;
}

#mobile-menu a:nth-child(1) { animation-delay: 0.1s; }
#mobile-menu a:nth-child(2) { animation-delay: 0.15s; }
#mobile-menu a:nth-child(3) { animation-delay: 0.2s; }
#mobile-menu a:nth-child(4) { animation-delay: 0.25s; }

/* Adjustments for small mobile devices */
@media (max-width: 400px) {
    .mobile-menu {
        width: 90%;
    }
    
    .mobile-nav-link {
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .nav-icon {
        width: 32px;
        height: 32px;
        margin-right: 10px;
    }
}
