/**
 * Responsive Design System
 * JL Freelancing Digital Hub
 * Mobile-First Approach
 */

/* ============================================
   RESPONSIVE VARIABLES
   ============================================ */

:root {
    --mobile-padding: 1rem;
    --tablet-padding: 2rem;
    --desktop-padding: 3rem;
}

/* ============================================
   MOBILE BASE (< 576px)
   ============================================ */

@media (max-width: 575px) {
    /* Typography */
    .display-text {
        font-size: 2.5rem;
        line-height: 1;
    }
    
    h1, .h1 {
        font-size: 2rem;
        line-height: 1.1;
    }
    
    h2, .h2 {
        font-size: 1.75rem;
    }
    
    .lead {
        font-size: 1.125rem;
    }
    
    /* Spacing */
    .hero-section-premium {
        padding: 3rem 0 2rem;
        min-height: auto;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .intro-section-premium {
        padding: 3rem 0;
    }
    
    .about-section-premium {
        padding: 3rem 0;
    }
    
    /* Buttons */
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero-ctas {
        flex-direction: column;
        width: 100%;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Images */
    .hero-image-container {
        height: 300px;
        margin-top: 2rem;
    }
}

/* ============================================
   MOBILE LANDSCAPE / SMALL TABLET (576px - 767px)
   ============================================ */

@media (min-width: 576px) and (max-width: 767px) {
    .container {
        max-width: 540px;
    }
    
    .hero-section-premium {
        padding: 4rem 0 3rem;
    }
    
    section {
        padding: 4rem 0;
    }
    
    .btn {
        width: auto;
    }
    
    .hero-ctas {
        flex-direction: row;
    }
}

/* ============================================
   TABLET (768px - 991px)
   ============================================ */

@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    /* Typography */
    h1, .h1 {
        font-size: 2.5rem;
    }
    
    h2, .h2 {
        font-size: 2rem;
    }
    
    /* Spacing */
    section {
        padding: 5rem 0;
    }
    
    /* Navigation */
    .navbar-nav {
        gap: 0.5rem;
    }
    
    .nav-link {
        font-size: 0.938rem;
    }
    
    /* Grid adjustments */
    .col-md-6 {
        margin-bottom: 2rem;
    }
}

/* ============================================
   DESKTOP SMALL (992px - 1199px)
   ============================================ */

@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .navbar-nav {
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 0.938rem;
        padding: 0.5rem 0.75rem;
    }
}

/* ============================================
   DESKTOP MEDIUM (1200px - 1399px)
   ============================================ */

@media (min-width: 1200px) and (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }
}

/* ============================================
   DESKTOP LARGE (1400px+)
   ============================================ */

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

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

@media (max-width: 991px) {
    /* Header */
    .site-header {
        padding: 0.75rem 0;
    }
    
    .navbar-brand .logo {
        height: 40px;
    }
    
    /* Offcanvas mobile menu */
    .offcanvas {
        width: 85%;
        max-width: 320px;
    }
    
    .mobile-nav {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .mobile-nav li {
        border-bottom: 1px solid var(--light-gray);
    }
    
    .mobile-nav a {
        display: block;
        padding: 1rem 0;
        color: var(--navy);
        text-decoration: none;
        font-weight: 500;
        transition: color 0.3s;
    }
    
    .mobile-nav a:hover {
        color: var(--blue);
    }
    
    /* Mobile CTA at bottom */
    .mobile-bottom-cta {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 1rem;
        background: var(--white);
        border-top: 1px solid var(--light-gray);
        box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
        z-index: 1000;
        transform: translateY(100%);
        transition: transform 0.3s var(--ease-out);
    }
    
    .mobile-bottom-cta.visible {
        transform: translateY(0);
    }
    
    .mobile-bottom-cta .btn {
        width: 100%;
    }
    
    /* Add padding to prevent content being hidden */
    body.has-mobile-cta {
        padding-bottom: 80px;
    }
}

/* ============================================
   RESPONSIVE IMAGES
   ============================================ */

@media (max-width: 767px) {
    img {
        max-width: 100%;
        height: auto;
    }
    
    .hero-image-placeholder {
        height: 300px !important;
    }
}

/* ============================================
   RESPONSIVE GRIDS
   ============================================ */

@media (max-width: 767px) {
    .row.g-4 {
        --bs-gutter-y: 2rem;
    }
    
    .row.g-5 {
        --bs-gutter-y: 2.5rem;
    }
}

/* ============================================
   RESPONSIVE FORMS
   ============================================ */

@media (max-width: 767px) {
    .form-control,
    .form-select {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* ============================================
   CAROUSEL RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .swiper-slide {
        padding: 0 0.5rem;
    }
    
    .swiper-button-next,
    .swiper-button-prev {
        display: none;
    }
    
    .swiper-pagination {
        bottom: -30px;
    }
}

/* ============================================
   HEADER RESPONSIVE FIXES
   ============================================ */

@media (max-width: 991px) {
    .dropdown-menu {
        border: none;
        box-shadow: none;
        padding: 0;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
    }
}

/* ============================================
   FOOTER RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .footer-main .row > div {
        margin-bottom: 2rem;
    }
    
    .footer-links,
    .footer-contact {
        font-size: 0.938rem;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* ============================================
   TRUST BAR RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .trust-items {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .trust-item {
        text-align: center;
    }
}

/* ============================================
   SCROLL INDICATOR
   ============================================ */

@media (max-width: 991px) {
    .scroll-indicator {
        display: none;
    }
}

/* ============================================
   PERFORMANCE: REDUCE ANIMATIONS ON MOBILE
   ============================================ */

@media (max-width: 767px) {
    /* Simpler animations */
    [data-reveal] {
        transition-duration: 0.4s;
    }
    
    /* Disable parallax */
    [data-parallax] {
        transform: none !important;
    }
    
    /* Disable custom cursor */
    .custom-cursor {
        display: none !important;
    }
    
    /* Disable magnetic buttons */
    .btn-magnetic {
        transform: none !important;
    }
}

/* ============================================
   LANDSCAPE MODE MOBILE
   ============================================ */

@media (max-width: 991px) and (orientation: landscape) {
    .hero-section-premium {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .hero-image-container {
        height: 250px;
    }
}

/* ============================================
   HIGH RESOLUTION DISPLAYS
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for retina displays */
    .logo {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .site-header,
    .site-footer,
    .whatsapp-button,
    .mobile-bottom-cta,
    .scroll-progress,
    .custom-cursor {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
}

/* ============================================
   HORIZONTAL OVERFLOW GUARD
   ============================================ */
html,
body {
    max-width: 100%;
    overflow-x: clip;
}

body {
    position: relative;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

.container,
.container-fluid,
.row,
section,
.site-header,
.site-footer,
.offcanvas,
.swiper,
.swiper-wrapper {
    max-width: 100%;
}

.btn,
.nav-link,
.mobile-nav a,
.footer-contact a,
.service-link,
.link-arrow {
    overflow-wrap: anywhere;
    white-space: normal;
}

@supports not (overflow-x: clip) {
    html,
    body {
        overflow-x: hidden;
    }
}

@media (max-width: 767px) {
    html,
    body {
        width: 100%;
    }

    .container,
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .row {
        margin-left: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
        margin-right: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
    }

    .hero-section-premium,
    .hero-section,
    .intro-section-premium,
    .about-section-premium,
    .cta-visual-section {
        overflow: hidden;
    }

    .hero-headline,
    .hero-title,
    .section-title,
    .service-title,
    .expertise-title,
    h1,
    h2,
    h3 {
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .hero-ctas,
    .hero-buttons,
    .cta-actions,
    .trust-items,
    .footer-bottom-links,
    .social-links {
        max-width: 100%;
        flex-wrap: wrap;
    }

    .btn,
    .btn-lg,
    .btn-premium {
        max-width: 100%;
        min-width: 0;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .swiper,
    .swiper-wrapper,
    .swiper-slide {
        max-width: 100%;
    }

    .swiper-slide {
        box-sizing: border-box;
        padding-left: 0;
        padding-right: 0;
    }

    .swiper-technologies .swiper-slide {
        width: auto !important;
        max-width: calc(100vw - 2rem);
    }

    .swiper-technologies .tech-item {
        max-width: calc(100vw - 2rem);
        white-space: normal;
        text-align: center;
    }

    .service-card,
    .expertise-card,
    .portfolio-card,
    .blog-card,
    .testimonial-card,
    .process-card,
    .value-card,
    .card {
        max-width: 100%;
    }

    .service-image,
    .project-image,
    .portfolio-image img,
    .blog-image img,
    .hero-image,
    .page-hero-visual img,
    .cta-visual-image {
        width: 100%;
        max-width: 100%;
    }

    .home-services-section .home-service-media,
    .services-page-grid .service-image-wrap,
    .expertise-visual-card,
    .expertise-hero-visual {
        max-width: 100%;
    }

    .offcanvas {
        max-width: min(320px, 92vw);
    }

    .whatsapp-button {
        right: 1rem;
        bottom: 1rem;
        max-width: calc(100vw - 2rem);
    }
}

@media (max-width: 575px) {
    .hero-visual,
    .hero-image-container,
    .hero-image,
    .about-visual-strip,
    .process-showcase,
    .story-visual-card,
    .page-hero-visual {
        max-width: 100%;
    }

    .hero-bg-element {
        display: none !important;
    }

    .section-header,
    .hero-content,
    .hero-subtitle,
    .hero-description {
        max-width: 100%;
    }
}
/* ============================================
   TEXT ALIGNMENT SYSTEM
   ============================================ */
.section-header,
.hero-section .text-center,
.hero-section .mx-auto,
.bg-navy .container.text-center,
section .container.text-center,
.text-center {
    text-align: center;
}

.section-header .section-subtitle,
.section-header p,
.hero-section .hero-subtitle,
.hero-section .hero-title,
.bg-navy .lead,
.cta-visual-section .lead {
    margin-left: auto;
    margin-right: auto;
}

.service-content,
.portfolio-content,
.blog-content,
.content-text,
.accordion-body,
.contact-info,
.footer-main,
.footer-description,
.footer-links,
.footer-contact {
    text-align: left;
}

.service-card .service-title,
.service-card .service-description,
.service-card .service-link,
.portfolio-card p,
.blog-card p,
.blog-card h3,
.blog-card h4,
.content-text p,
.content-text li {
    text-align: left;
}

.expertise-card,
.expertise-carousel-card,
.service-carousel-card,
.testimonial-carousel-card,
.team-card,
.solution-card,
.value-card,
.process-card {
    text-align: center;
}

.expertise-card .service-link,
.service-carousel-card .service-link,
.blog-link,
.service-link,
.link-arrow {
    justify-content: flex-start;
    text-align: left;
}

.text-center .service-link,
.text-center .blog-link,
.text-center .link-arrow,
.expertise-card .service-link,
.service-carousel-card .service-link {
    justify-content: center;
    text-align: center;
}

.footer-contact li,
.testimonial-author,
.contact-info .d-flex {
    align-items: flex-start;
}

.footer-contact a,
.mobile-contact p,
.contact-info a,
.contact-info p {
    line-height: 1.55;
}

@media (min-width: 992px) {
    .hero-section-premium .hero-content,
    .cta-visual-section .row > div:first-child {
        text-align: left;
    }

    .hero-section-premium .hero-description,
    .hero-section-premium .hero-ctas,
    .cta-visual-section .lead {
        margin-left: 0;
        margin-right: 0;
    }

    .hero-section-premium .hero-ctas,
    .cta-visual-section .d-flex {
        justify-content: flex-start;
    }
}

@media (max-width: 991px) {
    .hero-section-premium .hero-content,
    .hero-section-premium .hero-description,
    .hero-section-premium .hero-ctas,
    .cta-visual-section,
    .cta-visual-section .row > div,
    .cta-visual-section .lead {
        text-align: center;
    }

    .hero-section-premium .hero-description,
    .cta-visual-section .lead {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-section-premium .hero-ctas,
    .cta-visual-section .d-flex {
        justify-content: center;
    }

    .navbar .btn,
    .mobile-nav a,
    .mobile-contact p {
        text-align: left;
    }
}

@media (max-width: 767px) {
    body,
    p,
    li,
    .lead,
    .content-text,
    .service-description,
    .expertise-description,
    .project-excerpt,
    .blog-excerpt,
    .testimonial-content {
        text-align: left;
    }

    .hero-section,
    .hero-section .container,
    .hero-section .text-center,
    .hero-section .hero-title,
    .hero-section .hero-subtitle,
    .section-header,
    .section-header p,
    .section-header .section-title,
    .section-header .section-subtitle,
    .text-center,
    section .container.text-center,
    .bg-navy .container.text-center,
    .team-card,
    .solution-card,
    .value-card,
    .process-card,
    .trust-item,
    .expertise-card,
    .expertise-carousel-card,
    .service-carousel-card,
    .testimonial-carousel-card {
        text-align: center;
    }

    .service-content,
    .portfolio-content,
    .blog-content,
    .content-text,
    .accordion-body,
    .footer-main,
    .footer-main .row > div,
    .footer-description,
    .footer-links,
    .footer-contact,
    .contact-info {
        text-align: left;
    }

    .footer-contact li,
    .contact-info .d-flex {
        justify-content: flex-start;
        text-align: left;
    }

    .footer-legal,
    .copyright,
    .social-links {
        justify-content: center;
        text-align: center;
    }

    .service-link,
    .blog-link,
    .link-arrow {
        justify-content: flex-start;
        width: fit-content;
        max-width: 100%;
    }

    .text-center .service-link,
    .text-center .blog-link,
    .text-center .link-arrow,
    .expertise-card .service-link,
    .service-carousel-card .service-link {
        justify-content: center;
        margin-left: auto;
        margin-right: auto;
    }

    .btn,
    .btn-lg,
    .btn-premium {
        text-align: center;
    }
}

/* ============================================
   EDGE BREATHING ROOM
   ============================================ */
@media (max-width: 991px) {
    .container,
    .container-fluid {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

@media (max-width: 575px) {
    .container,
    .container-fluid {
        padding-left: 1.35rem;
        padding-right: 1.35rem;
    }

    .row {
        --bs-gutter-x: 1.5rem;
    }

    .hero-content,
    .section-header,
    .service-content,
    .portfolio-content,
    .blog-content,
    .content-text,
    .accordion-body,
    .footer-main,
    .contact-info,
    .mobile-contact,
    .cta-visual-section .row > div {
        padding-left: 0.1rem;
        padding-right: 0.1rem;
    }
}
