/* Samsung A06 and Small Android Devices Optimization */

/* Ensure proper rendering on Samsung devices */
@media screen and (max-width: 400px) {
    /* Prevent text size adjustment on orientation change */
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* Optimize touch targets for small screens */
    button, a, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Ensure header doesn't cause layout shift */
    header {
        will-change: transform;
        backface-visibility: hidden;
        display: block !important;
    }
    
    /* Optimize scrolling performance */
    .nav-links ul {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    /* Prevent zoom on input focus */
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* Optimize images for mobile */
    img {
        image-rendering: crisp-edges;
    }
}

/* Samsung A06 specific (360px width) */
@media screen and (max-width: 360px) {
    /* Ensure content doesn't overflow */
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Optimize header spacing */
    .top-header-container,
    .navbar {
        max-width: 100%;
    }
    
    /* Better touch targets for hamburger */
    .hamburger {
        -webkit-tap-highlight-color: rgba(255, 215, 0, 0.2);
        touch-action: manipulation;
    }
    
    /* Ensure logo doesn't get too small */
    .logo img {
        min-height: 32px;
    }
    
    /* Optimize mobile menu for small screens */
    .nav-links ul.show {
        width: 80%;
        max-width: 280px;
    }
    
    /* Better spacing for contact info */
    .contact-info a {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 140px;
    }
    
    /* Optimize social links */
    .social-links-top {
        flex-wrap: nowrap;
    }
}

/* Landscape mode optimization for small devices */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .top-header {
        padding: 3px 0;
    }
    
    header {
        height: 48px !important;
    }
    
    .logo img {
        height: 32px;
    }
    
    .hamburger {
        min-width: 32px;
        min-height: 32px;
        padding: 4px;
    }
    
    .nav-links ul {
        padding: 15px 10px;
        gap: 10px;
    }
    
    .nav-links a {
        padding: 8px 0;
        min-height: 40px;
    }
}

/* Fix for Samsung Internet Browser */
@supports (-webkit-appearance: none) {
    .hamburger,
    .mobile-menu-btn {
        -webkit-appearance: none;
    }
}

/* Smooth scrolling for Samsung devices */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
    
    .nav-links ul {
        scroll-behavior: smooth;
    }
}

/* Prevent horizontal scroll issues */
@media screen and (max-width: 400px) {
    * {
        max-width: 100%;
    }
    
    img, video, iframe {
        max-width: 100%;
        height: auto;
    }
    
    /* Ensure containers don't overflow */
    .container,
    .navbar,
    .top-header-container {
        max-width: 100%;
        overflow-x: hidden;
    }
}