/* Code Hub Soft - Responsive Styles */

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    :root {
        --border-radius: 0.375rem;
        --border-radius-lg: 0.75rem;
    }

    /* Global responsive adjustments */
    body {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }

    /* Navigation */
    .navbar-brand {
        font-size: 1.25rem;
    }

    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }

    .navbar-collapse {
        background: white;
        padding: 1rem;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-lg);
        margin-top: 1rem;
    }

    /* Hero Section */
    .hero-section {
        padding: 3rem 0;
        text-align: center;
        min-height: auto;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.5rem;
        padding: 0.75rem 1rem;
    }

    /* Stats Section */
    .stats-section {
        padding: 2rem 0;
    }

    .stat-item {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 1rem;
    }

    /* Services Section */
    .services-section {
        padding: 3rem 0;
    }

    .service-card {
        margin-bottom: 1.5rem;
        padding: 1.5rem;
    }

    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .service-title {
        font-size: 1.1rem;
    }

    /* Trust Bar */
    .trust-bar {
        padding: 1.5rem 0;
    }

    .trust-logos {
        flex-direction: column;
        gap: 1rem;
    }

    .trust-logo {
        height: 30px;
    }

    /* Reviews Marquee */
    .reviews-marquee {
        padding: 2rem 0;
    }

    .marquee-item {
        width: 280px;
        margin-right: 1rem;
        padding: 1rem;
    }

    /* About Section */
    .about-section {
        padding: 3rem 0;
    }

    .about-content h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .about-stats {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .about-stat-number {
        font-size: 1.5rem;
    }

    /* CTA Section */
    .cta-section {
        padding: 3rem 0;
    }

    .cta-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .cta-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
        text-align: center;
    }

    .footer h5 {
        margin-bottom: 1rem;
    }

    .footer-links {
        margin-bottom: 1.5rem;
    }

    .footer-bottom {
        padding-top: 1rem;
        margin-top: 1rem;
    }

    /* Floating buttons */
    .whatsapp-float,
    .scroll-top {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .whatsapp-float {
        bottom: 15px;
        right: 15px;
    }

    .scroll-top {
        bottom: 75px;
        right: 15px;
    }
}

/* Small Devices (tablets, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .service-card {
        margin-bottom: 2rem;
    }

    .trust-logos {
        flex-wrap: wrap;
        justify-content: center;
    }

    .about-stats {
        justify-content: center;
    }

    .cta-title {
        font-size: 2.25rem;
    }

    .marquee-item {
        width: 320px;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .stat-number {
        font-size: 2.75rem;
    }

    .service-card {
        margin-bottom: 2.5rem;
    }

    .about-content h2 {
        font-size: 2.25rem;
    }

    .cta-title {
        font-size: 2.5rem;
    }

    .marquee-item {
        width: 350px;
    }

    .footer .row > div {
        margin-bottom: 2rem;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .stat-number {
        font-size: 3.25rem;
    }

    .service-card {
        padding: 2.5rem;
    }

    .about-content h2 {
        font-size: 2.75rem;
    }

    .cta-title {
        font-size: 2.75rem;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .hero-title {
        font-size: 4rem;
    }

    .stat-number {
        font-size: 3.5rem;
    }

    .service-card {
        padding: 3rem;
    }

    .about-content h2 {
        font-size: 3rem;
    }

    .cta-title {
        font-size: 3rem;
    }
}

/* Ultra-wide screens (1440px and up) */
@media (min-width: 1440px) {
    .container {
        max-width: 1320px;
    }

    .hero-title {
        font-size: 4.5rem;
    }

    .stat-number {
        font-size: 4rem;
    }
}

/* 4K and ultra-wide screens (1920px and up) */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }

    .hero-title {
        font-size: 5rem;
    }

    .stat-number {
        font-size: 4.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }
}

/* Print styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    .navbar,
    .footer,
    .whatsapp-float,
    .scroll-top,
    .cta-section,
    .hero-buttons,
    .portfolio-filters,
    .newsletter-section,
    .contact-form-container {
        display: none !important;
    }

    .service-card,
    .about-section,
    .reviews-marquee {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .stat-item,
    .service-card,
    .about-stat {
        break-inside: avoid;
    }

    h1,
    h2,
    h3 {
        page-break-after: avoid;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    p,
    h4,
    h5,
    h6 {
        orphans: 3;
        widows: 3;
    }

    @page {
        margin: 0.5in;
        size: A4;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000000;
        --accent-color: #0000ff;
        --success-color: #008000;
        --warning-color: #ffa500;
        --danger-color: #ff0000;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
        --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.5);
        --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.5);
        --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.5);
    }

    .btn-primary {
        background: #000000;
        border: 2px solid #000000;
    }

    .btn-primary:hover {
        background: #ffffff;
        color: #000000;
    }

    .service-card,
    .testimonial-card,
    .pricing-card {
        border: 2px solid #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .marquee-container {
        animation: none !important;
    }

    .counter-number {
        transition: none !important;
    }
}

/* Dark mode responsive adjustments */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .navbar-collapse {
        background: #2d3748;
        border: 1px solid #4a5568;
    }

    .service-card,
    .testimonial-card,
    .pricing-card {
        background: #2d3748;
        border-color: #4a5568;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .service-card:hover,
    .portfolio-card:hover,
    .blog-card:hover,
    .pricing-card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    .whatsapp-float,
    .scroll-top {
        width: 60px;
        height: 60px;
    }

    .trust-logo:hover {
        filter: grayscale(100%);
        opacity: 0.7;
    }
}

/* Landscape orientation on mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        padding: 2rem 0;
        min-height: auto;
    }

    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .hero-buttons .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .navbar {
        padding-top: env(safe-area-inset-top);
    }

    .whatsapp-float,
    .scroll-top {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .hero-section {
        padding-top: calc(5rem + env(safe-area-inset-top));
    }
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
    .navbar {
        backdrop-filter: blur(10px);
        background: rgba(255, 255, 255, 0.95);
    }

    .service-card,
    .testimonial-card {
        backdrop-filter: none;
    }
}

/* Edge specific fixes */
@supports (-ms-ime-align: auto) {
    .hero-section::before {
        background-attachment: fixed;
    }

    .marquee-container {
        will-change: transform;
    }
}