/* ============================================
   RESPONSIVE DESIGN
   Mobile-first approach with breakpoints:
   - xs: 0-575px (mobile portrait)
   - sm: 576-767px (mobile landscape)
   - md: 768-991px (tablet)
   - lg: 992-1199px (desktop)
   - xl: 1200px+ (large desktop)
   ============================================ */

/* Mobile First - Base styles (320px+) */
/* These are already set in the main style.css */

/* Extra Small Devices (Portrait Phones, less than 576px) */
@media (max-width: 575.98px) {

    /* Hero Section */
    #section-hero h1 {
        font-size: 48px !important;
        line-height: 1.2 !important;
    }

    #section-hero .subtitle {
        font-size: 16px !important;
    }

    /* Reduce profile image size on mobile */
    #section-about .profile-image img {
        max-width: 200px !important;
        height: auto !important;
    }

    /* Typography adjustments */
    h2 {
        font-size: 32px !important;
    }

    h3 {
        font-size: 24px !important;
    }

    h5 {
        font-size: 16px !important;
    }

    /* Sections padding */
    section {
        padding: 60px 0 !important;
    }

    /* Glass cards spacing */
    .glass-card {
        margin-bottom: 20px !important;
    }

    /* Skills section - single column */
    #section-skills .row>div {
        margin-bottom: 30px;
    }

    /* Buttons */
    .btn-main,
    .btn {
        padding: 12px 24px !important;
        font-size: 14px !important;
    }

    /* Navigation */
    #mainmenu {
        font-size: 14px;
    }

    /* Project cards in carousel */
    .bloglist .post-text h3 {
        font-size: 20px !important;
    }

    .bloglist .post-text h5 {
        font-size: 14px !important;
    }

    /* Container padding */
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Resume section timeline */
    .exp-box {
        padding: 20px !important;
        margin-bottom: 20px !important;
    }

    /* Reduce vertical spacing between timeline items */
    .de_timeline .d-date {
        margin-bottom: 15px !important;
    }

    /* Hide logo on mobile to prevent overlap */
    #logo {
        display: none !important;
    }
}

/* Small Devices (Landscape Phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    #section-hero h1 {
        font-size: 56px !important;
    }

    h2 {
        font-size: 36px !important;
    }

    section {
        padding: 80px 0 !important;
    }
}

/* Medium Devices (Tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    #section-hero h1 {
        font-size: 72px !important;
    }

    h2 {
        font-size: 42px !important;
    }

    section {
        padding: 100px 0 !important;
    }

    /* Two projects per row on tablet */
    #carousel-blog-2-cols .owl-stage-outer {
        overflow: visible;
    }

    /* Hide logo on tablet to prevent overlap */
    #logo {
        display: none !important;
    }
}

/* Large Devices (Desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    #section-hero h1 {
        font-size: 96px !important;
    }

    section {
        padding: 120px 0 !important;
    }
}

/* Extra Large Devices (Large Desktops, 1200px and up) */
@media (min-width: 1200px) {

    /* Optimal spacing for large screens */
    section {
        padding: 140px 0 !important;
    }

    .container {
        max-width: 1320px;
    }
}

/* Ultra-wide Screens (1600px and up) */
@media (min-width: 1600px) {
    .container {
        max-width: 1500px;
    }

    #section-hero h1 {
        font-size: 120px !important;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    section {
        padding: 40px 0 !important;
    }

    #section-hero h1 {
        font-size: 48px !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Increase tap targets for touch devices */
    .btn,
    .btn-main {
        min-height: 44px;
        min-width: 44px;
    }

    #mainmenu a {
        padding: 12px 15px;
    }

    /* Disable hover effects on touch devices */
    .glass-card:hover {
        transform: none !important;
    }
}

/* ============================================
   MOBILE SCROLL PERFORMANCE
   Disable jarallax parallax & skrollr on mobile.
   Use simple static backgrounds instead of
   JS-repositioned elements for smooth scrolling.
   ============================================ */
@media (max-width: 991px) {

    /* --- Jarallax fallback ---
       jarallax-img elements are hidden (JS won't reposition them).
       Sections get a static CSS background from their data-bgimage. */
    .jarallax > .jarallax-img {
        display: none !important;
    }

    /* Hero uses <img class="jarallax-img"> instead of data-bgimage,
       so we need a specific rule for that section */
    #section-hero.jarallax {
        background: url('../images/background/landscape.jpg') center/cover no-repeat;
    }

    #section-about.jarallax {
        background: url('../images/background/stars.jpg') center/cover no-repeat;
    }

    #section-blog.jarallax {
        background: url('../images/background/north.jpg') center/cover no-repeat;
    }

    /* Sections using data-bgimage (set via JS) — ensure cover */
    .jarallax[data-bgimage] {
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
    }

    /* --- Disable skrollr scroll-driven transforms ---
       Elements with data-bottom-top / data-top-bottom get
       translateX/Y animations on scroll via skrollr. Kill them. */
    [data-bottom-top],
    [data-top-bottom] {
        transform: none !important;
        -webkit-transform: none !important;
    }

    /* --- GPU compositing for smooth native scroll --- */
    section {
        will-change: auto;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    /* Reduce WOW.js animation complexity on mobile */
    .wow {
        animation-duration: 0.4s !important;
    }

    /* Disable the fade-top / fade-bottom pseudo-element
       gradient overlays if they use heavy compositing */
    .fade-top::before,
    .fade-bottom::after {
        opacity: 0.5;
    }
}

/* Print styles */
@media print {

    header,
    footer,
    #mainmenu {
        display: none !important;
    }

    section {
        page-break-inside: avoid;
    }

    .jarallax {
        background-attachment: scroll !important;
    }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .jarallax {
        background-attachment: scroll !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .glass-card {
        border: 2px solid var(--neon-green) !important;
    }

    .text-light {
        color: #ffffff !important;
    }
}