/* Responsive Design */

/* Blog Section Responsive */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .blog-card-title {
        font-size: 1rem;
    }

    .blog-card-content {
        padding: 1rem;
    }

    .blog-section {
        padding: 4rem 0;
    }
}

/* Large screens (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }

    .hero-title {
        font-size: 4rem;
    }

    .section-title {
        font-size: 3rem;
    }
}

/* Medium screens (768px to 1199px) */
@media (max-width: 1199px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero-content {
        gap: 3rem;
    }

    .features-content {
        gap: 3rem;
    }

    .contact-content {
        gap: 3rem;
    }
}

/* Tablet screens (768px to 991px) */
@media (max-width: 991px) {
    .section-title {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-image {
        order: -1;
    }

    .hero-graphic {
        width: 250px;
        height: 250px;
    }

    .features-content {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .about-text {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile landscape and small tablets (576px to 767px) */
@media (max-width: 767px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 100%;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-large);
        padding: 2rem 0;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero {
        min-height: 80vh;
        padding: 8rem 0 4rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-buttons {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .hero-graphic {
        width: 200px;
        height: 200px;
    }

    .element {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .section-header {
        margin-bottom: 3rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .about,
    .services,
    .features,
    .testimonials,
    .contact {
        padding: 4rem 0;
    }

    .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-number {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: 2rem;
    }

    .performance-metrics {
        grid-template-columns: 1fr;
    }

    .security-features,
    .support-info {
        grid-template-columns: 1fr;
    }

    .testimonial-slide {
        padding: 2rem;
    }

    .testimonial-text p {
        font-size: 1rem;
    }

    .testimonial-author {
        flex-direction: column;
        text-align: center;
    }

    .contact-form {
        padding: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-bottom-links {
        justify-content: center;
    }
}

/* Small mobile (up to 575px) */
@media (max-width: 575px) {
    .container {
        padding: 0 1rem;
    }

    .navbar {
        padding: 0.75rem 0;
    }

    .hero {
        min-height: 70vh;
        padding: 6rem 0 3rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-description {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }

    .hero-buttons {
        gap: 0.75rem;
    }

    .hero-graphic {
        width: 180px;
        height: 180px;
    }

    .element {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.9rem;
    }

    .about,
    .services,
    .features,
    .testimonials,
    .contact {
        padding: 3rem 0;
    }

    .about-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-item {
        padding: 1.5rem;
    }

    .service-card {
        padding: 1.5rem;
    }

    .service-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }

    .service-title {
        font-size: 1.25rem;
    }

    .feature-item {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
    }

    .feature-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    .features-showcase {
        height: auto;
        min-height: 300px;
    }

    .feature-display {
        position: relative;
        padding: 1.5rem;
    }

    .testimonial-slide {
        padding: 1.5rem;
    }

    .testimonial-navigation {
        gap: 1rem;
    }

    .nav-btn {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.875rem;
    }

    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .contact-form {
        padding: 1.5rem;
    }

    .form {
        gap: 1.25rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-content {
        gap: 2rem;
        margin-bottom: 2rem;
    }

    .footer-section h4 {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }

    .footer-description {
        font-size: 0.9rem;
    }

    .social-links {
        justify-content: center;
    }

    .footer-links {
        gap: 0.5rem;
    }

    .footer-bottom-links {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .back-to-top {
        width: 2.5rem;
        height: 2.5rem;
        bottom: 1rem;
        right: 1rem;
        font-size: 0.875rem;
    }
}

/* Extra small devices (up to 375px) */
@media (max-width: 375px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-description {
        font-size: 0.85rem;
    }

    .hero-graphic {
        width: 150px;
        height: 150px;
    }

    .element {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .section-title {
        font-size: 1.375rem;
    }

    .service-card,
    .contact-form {
        padding: 1.25rem;
    }

    .testimonial-slide {
        padding: 1.25rem;
    }

    .contact-form {
        padding: 1.25rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-graphic {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }

    .logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print styles */
@media print {
    .header,
    .nav-toggle,
    .hero-scroll,
    .back-to-top,
    .loading-screen {
        display: none !important;
    }

    .hero {
        min-height: auto;
        page-break-after: always;
    }

    .section-title,
    .hero-title {
        color: #000 !important;
    }

    .btn {
        border: 2px solid #000 !important;
        color: #000 !important;
        background: transparent !important;
    }

    .service-card,
    .feature-item,
    .contact-form {
        break-inside: avoid;
    }
}

/* Reduced motion preferences */
@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;
    }

    .floating-elements .element {
        animation: none;
    }

    .scroll-indicator {
        animation: none;
    }

    .loading-dot {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #111827;
        --background-light: #1f2937;
        --background-dark: #0f172a;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        --border-color: #374151;
    }

    .header {
        background: rgba(17, 24, 39, 0.95);
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu {
        background-color: var(--background);
    }

    .service-card,
    .feature-item,
    .contact-form,
    .testimonial-slide,
    .feature-display {
        background: var(--background-light);
        border-color: var(--border-color);
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        background: var(--background);
        border-color: var(--border-color);
        color: var(--text-primary);
    }

    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-color: var(--primary-color);
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .hero {
        min-height: 100vh;
        padding: 4rem 0 2rem;
    }

    .hero-content {
        gap: 2rem;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .hero-description {
        margin-bottom: 1.5rem;
    }

    .hero-graphic {
        width: 180px;
        height: 180px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .service-card,
    .feature-item {
        min-height: 44px;
    }

    .nav-toggle {
        min-width: 44px;
        min-height: 44px;
    }

    .back-to-top {
        min-width: 44px;
        min-height: 44px;
    }

    .social-link {
        min-width: 44px;
        min-height: 44px;
    }

    .dot,
    .nav-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Focus styles for accessibility */
@media (prefers-reduced-motion: no-preference) {
    *:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }

    .btn:focus,
    .nav-link:focus {
        outline-offset: 4px;
    }
}

/* Container query support (future-proofing) */
@supports (container-type: inline-size) {
    .services-grid {
        container-type: inline-size;
    }

    @container (max-width: 600px) {
        .service-card {
            padding: 1.5rem;
        }

        .service-title {
            font-size: 1.25rem;
        }
    }
}