/* Mobile styles for Iskrex homepage */

/* Global fixes for mobile devices */
body {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
    width: 100%;
}

html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Fix for long words potentially causing horizontal scrolling */
p, h1, h2, h3, h4, h5, h6, a, span {
    overflow-wrap: break-word;
    word-wrap: break-word;
    -ms-word-break: break-all;
    word-break: break-word;
    -ms-hyphens: auto;
    -moz-hyphens: auto;
    -webkit-hyphens: auto;
    hyphens: auto;
    max-width: 100%;
}

@media (max-width: 768px) {
    /* Force the body to fit within viewport */
    body {
        width: 100vw;
        overflow-x: hidden;
    }
    
    /* Hero section adjustments */
    .hero {
        padding: 80px 0 40px;
        overflow: hidden;
        width: 100%;
        min-height: 100vh;
        height: auto;
        display: block;
    }
    
    .hero-content {
        padding: 0 10px;
        width: 100%;
        box-sizing: border-box;
        padding-top: 60px;
    }
    
    .hero h1 {
        font-size: 2rem;
        margin-bottom: 15px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .hero-tagline {
        font-size: 1.2rem;
        margin-bottom: 15px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 20px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Skills section adjustments */
    .skills-overview {
        padding: 5px 0 15px;
        margin-top: 0;
    }
    
    .skills-overview h2 {
        margin-top: 0;
        margin-bottom: 10px;
        clear: both;
    }
    
    .skills-grid {
        gap: 15px;
        margin-top: 20px;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .skill-card {
        padding: 15px;
        min-height: auto;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: auto;
    }
    
    .skill-card h3 {
        font-size: 1.1rem;
        margin-bottom: 5px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .skill-card p {
        font-size: 0.9rem;
        margin-bottom: 10px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .btn-small {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    /* Featured work section adjustments */
    .featured-work {
        padding: 40px 0;
    }
    
    .carousel-track {
        height: auto !important;
        min-height: 627px !important;
    }
    
    .carousel-slide {
        height: auto !important;
    }
    
    .image-pair {
        flex-direction: column !important;
        height: auto !important;
    }
    
    .carousel-image-container {
        height: 439px !important;
        min-height: 439px !important;
        max-height: 439px !important;
        margin: 5px 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        overflow: hidden !important;
    }
    
    .carousel-slide img {
        height: 100% !important;
        width: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
    }

    /* Fix for overlapping text in hero section */
    .cta-buttons {
        margin-bottom: 0;
        display: flex;
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }
    
    /* Fix for buttons on mobile */
    .cta-buttons .btn,
    .cta-buttons .btn-outline {
        margin: 0;
        width: calc(50% - 5px);
        text-align: center;
        box-sizing: border-box;
    }
    
    /* Fix potential alignment issues */
    .container {
        width: 90%;
        padding: 0 10px;
        box-sizing: border-box;
        margin-left: auto;
        margin-right: auto;
    }
    
    h2 {
        word-wrap: break-word;
        overflow-wrap: break-word;
        font-size: 1.8rem;
        margin-top: 5px;
    }

    /* Reduce bottom margin of last hero description */
    .hero-description:last-of-type {
        margin-bottom: 10px;
    }
}

/* Extra small devices (phones) */
@media (max-width: 480px) {
    /* Force container to fit viewport */
    .container {
        width: 94%;
        padding: 0 3%;
        box-sizing: border-box;
    }
    
    /* Further reduce heading sizes */
    .hero h1 {
        font-size: 1.6rem;
        margin-bottom: 10px;
        display: block !important;
        visibility: visible !important;
        margin-top: 30px;
    }
    
    .hero-tagline {
        font-size: 1rem;
        display: block !important;
        visibility: visible !important;
    }
    
    /* Improve readability of hero text */
    .hero-description {
        font-size: 0.85rem;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    /* Ensure buttons stack properly and are fully clickable */
    .cta-buttons {
        flex-direction: column;
        width: 100%;
        margin-bottom: 30px;
    }
    
    .cta-buttons .btn,
    .cta-buttons .btn-outline {
        font-size: 0.9rem;
        padding: 8px 15px;
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
        display: block;
    }
    
    .carousel-track {
        min-height: 500px !important;
    }
    
    .carousel-controls {
        bottom: 70px;
    }
    
    .carousel-indicators {
        bottom: 10px;
    }
    
    /* Make skills grid more compact */
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    /* Fix spacing for skill cards */
    .skill-card {
        margin-bottom: 8px;
        height: auto !important;
        padding: 12px 10px;
    }
    
    .skill-card h3 {
        font-size: 1rem;
    }
    
    .skill-card p {
        font-size: 0.8rem;
    }
    
    /* Fix for extreme small screens */
    main {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    /* Adjust heading size for readability */
    h2 {
        font-size: 1.4rem;
    }

    /* Fix spacing between hero and skills section */
    main section.skills-overview {
        margin-top: 40px;
        padding-top: 20px;
    }
}

/* Ultra small devices */
@media (max-width: 350px) {
    html {
        font-size: 14px;
    }
    
    .hero h1 {
        font-size: 1.4rem !important;
        margin-top: 50px !important;
    }
    
    .hero-tagline {
        font-size: 0.9rem !important;
    }
    
    /* Fix spacing between hero and expertise section */
    .hero {
        padding-bottom: 0; /* Completely remove bottom padding */
        height: auto;
        min-height: auto;
    }
    
    .skills-overview {
        margin-top: 0 !important; /* Completely remove top margin */
    }
    
    /* Further reduce button text size for very small screens */
    .cta-buttons .btn,
    .cta-buttons .btn-outline {
        font-size: 0.75rem !important;
        padding: 8px 3px !important;
        letter-spacing: 0 !important;
        white-space: normal !important;
        height: auto !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Add more compact spacing */
    .cta-buttons {
        margin-bottom: 0 !important; /* Completely remove bottom margin */
    }
    
    .skills-overview h2 {
        margin-top: 0 !important; /* Completely remove top margin */
    }
    
    .hero-description:last-of-type {
        margin-bottom: 2px !important; /* Minimal margin */
    }
}

/* Specific rules for real mobile devices */
.real-mobile-device {
    /* Force text to be properly sized and prevent overflow */
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

.real-mobile-device .hero h1 {
    font-size: 1.6rem !important;
    line-height: 1.2 !important;
    letter-spacing: -0.02em !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-top: 40px !important;
}

.real-mobile-device .hero-tagline {
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.real-mobile-device .hero-description {
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
}

.real-mobile-device .container {
    width: 92% !important;
    padding: 0 4% !important;
    overflow-x: hidden !important;
    max-width: none !important;
}

/* Fix skill grid layout */
.real-mobile-device .skills-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
}

/* Fix skill card icon display */
.real-mobile-device .skill-card {
    padding: 55px 10px 12px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    min-height: 0 !important;
    height: auto !important;
    text-align: center !important;
}

/* Fix for skill card content elements */
.real-mobile-device .skill-card h3 {
    font-size: 1rem !important;
    margin-bottom: 5px !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.real-mobile-device .skill-card p {
    font-size: 0.85rem !important;
    margin-bottom: 8px !important;
}

.real-mobile-device .skill-card .btn-small {
    margin-top: auto !important;
    font-size: 0.8rem !important;
    padding: 5px 10px !important;
}

.real-mobile-device .cta-buttons {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin-bottom: 10px !important;
}

.real-mobile-device .cta-buttons .btn,
.real-mobile-device .cta-buttons .btn-outline {
    width: 100% !important;
    margin: 5px 0 !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

/* Fix footer social icon display */
.real-mobile-device .social-links {
    text-align: center !important;
    margin: 15px 0 !important;
}

.real-mobile-device .social-links a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    margin: 0 5px !important;
    border-radius: 50% !important;
    position: relative !important;
}

.real-mobile-device .social-links a img {
    position: absolute !important;
    width: 20px !important;
    height: 20px !important;
}

@media (max-width: 480px) {
    .real-mobile-device .skills-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .real-mobile-device .carousel-track {
        height: 230px !important;
    }
    
    .real-mobile-device .hero h1 {
        font-size: 1.5rem !important;
    }
    
    /* Further reduce skill card on very small screens */
    .real-mobile-device .skill-card {
        padding: 45px 8px 10px 8px !important;
    }
}

@media (max-width: 380px) {
    .real-mobile-device .hero h1 {
        font-size: 1.4rem !important;
    }
    
    .real-mobile-device .carousel-track {
        height: 200px !important;
    }
    
    .real-mobile-device .skills-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Real mobile device specific fixes */
.real-mobile-device .carousel-track {
    height: auto !important;
    min-height: 627px !important;
    padding: 5px !important;
}

/* Ensure proper positioning of the carousel container */
.real-mobile-device .simple-carousel {
    position: relative !important;
    margin-bottom: 10px !important;
    width: 100% !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
    touch-action: pan-y !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
    cursor: grab !important;
}

.real-mobile-device .simple-carousel:active {
    cursor: grabbing !important;
}

/* Fix for touch focus outlines */
.real-mobile-device .carousel-controls button:focus {
    outline: none !important;
}

/* Add some visual feedback for touch interaction */
.real-mobile-device .carousel-slide {
    transition: transform 0.5s ease, opacity 0.5s ease !important;
}

.real-mobile-device .carousel-slide {
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.real-mobile-device .image-pair {
    flex-direction: column !important;
    height: auto !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

/* Improved image container for very wide images like the dragon */
.real-mobile-device .carousel-image-container {
    height: 439px !important;
    min-height: 439px !important;
    max-height: 439px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Enhanced image display to show wide images fully */
.real-mobile-device .carousel-slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    margin: 0 auto !important;
    display: block !important;
    transform: none !important;
}

/* Ensure carousel track has enough space */
.real-mobile-device .carousel-track {
    height: auto !important;
    min-height: 627px !important;
    padding: 5px !important;
}

/* Ensure the carousel container doesn't restrict image display */
.real-mobile-device .simple-carousel {
    position: relative !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    overflow: visible !important;
    border-radius: 8px !important;
    padding: 0 !important;
}

/* Widen the slide to fit full image */
.real-mobile-device .carousel-slide {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
}

/* Update media queries for different screen sizes */
@media (max-width: 480px) {
    .real-mobile-device .carousel-image-container {
        height: 401px !important;
        min-height: 401px !important;
        max-height: 401px !important;
    }
    
    .real-mobile-device .carousel-slide img {
        height: 100% !important;
        width: 100% !important;
        object-fit: cover !important;
    }
}

@media (max-width: 380px) {
    .real-mobile-device .carousel-image-container {
        height: 376px !important;
        min-height: 376px !important;
        max-height: 376px !important;
    }
    
    .real-mobile-device .carousel-slide img {
        height: 100% !important;
        width: 100% !important;
        object-fit: cover !important;
    }
}

/* Fix: Reduce hero section height to prevent overlap */
.real-mobile-device .hero {
    height: auto !important;
    min-height: auto !important;
    padding-bottom: 2px !important;
}

/* Fix spacing between hero and skills section */
.real-mobile-device section.skills-overview {
    margin-top: 0 !important;
    padding-top: 0 !important;
    clear: both !important;
}

/* Fix: Ensure proper spacing for the expertise title */
.real-mobile-device .skills-overview h2 {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    padding-top: 0 !important;
    clear: both !important;
}

.real-mobile-device .cta-buttons {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin-bottom: 0 !important;
}

.real-mobile-device .hero-description:last-of-type {
    margin-bottom: 5px !important;
}

/* Full HD Desktop displays fix */
@media screen and (min-width: 1900px) and (max-width: 2000px) {
    .hero {
        padding-top: 6rem !important; /* Ensure there's enough space for the title */
        margin-top: 0 !important; /* Reset margin to prevent pushing content down */
        min-height: 90vh !important; /* Ensure the hero section is tall enough */
        height: auto !important; /* Allow natural content flow */
    }
    
    .hero-content {
        padding-top: 3rem !important; /* Add padding to ensure content is visible */
        min-height: 70vh !important; /* Minimum height for content */
    }
    
    .hero h1, .hero-tagline {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Enhanced fix specifically for 1920x1080 resolution (Full HD) */
@media screen and (width: 1920px) and (height: 1080px),
       screen and (width: 1920px),
       screen and (min-width: 1900px) and (max-width: 1930px) {
    .hero {
        padding-top: 2rem !important;
        margin-top: 0 !important;
        height: auto !important;
        min-height: 90vh !important;
        display: block !important;
    }
    
    .hero-content {
        padding-top: 2rem !important;
        margin-top: 0 !important;
        min-height: 75vh !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
    
    .hero h1 {
        margin-top: 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-size: 3rem !important;
    }
    
    .hero-tagline {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-size: 1.5rem !important;
    }
    
    .hero-description {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
} 