/* Responsive Design */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero .container {
        gap: 2rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .about-content,
    .contact-content {
        gap: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--background);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-md);
        padding: 2rem 0;
        gap: 1.5rem;
    }

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

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Hero Section */
    .hero {
        padding: 6rem 0 3rem;
        min-height: auto;
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1.125rem;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    
    .tech-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Services Section */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 2rem;
    }
    
    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .image-placeholder {
        width: 250px;
        height: 250px;
    }
    
    /* Portfolio Section */
    .clients-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .client-logo {
        padding: 1.5rem;
    }
    
    /* Contact Section */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-form {
        padding: 2rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .service-icon {
        width: 3rem;
        height: 3rem;
    }
    
    .service-icon i {
        font-size: 1.5rem;
    }
    
    .about-text h2 {
        font-size: 2rem;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .hero-buttons {
        gap: 0.75rem;
    }
    
    .stats {
        gap: 1rem;
    }
    
    .stat-item h3 {
        font-size: 2rem;
    }
}

/* Large Screens (min-width: 1440px) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Height-based media queries */
@media (max-height: 600px) {
    .hero {
        min-height: auto;
        padding: 6rem 0 3rem;
    }
    
    section {
        padding: 3rem 0;
    }
}

/* Orientation-based media queries */
@media (orientation: landscape) and (max-width: 768px) {
    .hero {
        min-height: auto;
        padding: 5rem 0 2rem;
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Print styles */
@media print {
    .header,
    .hamburger,
    .hero-buttons,
    .contact-form,
    .footer {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .hero {
        padding: 2rem 0;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 24pt;
    }
    
    .section-title {
        font-size: 20pt;
    }
    
    .service-card,
    .contact-info {
        break-inside: avoid;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --text-secondary: #333333;
        --background: #ffffff;
        --primary-color: #0066cc;
        --border-color: #666666;
    }
    
    .btn-primary {
        background: #000000;
        color: #ffffff;
    }
    
    .btn-secondary {
        border-color: #000000;
        color: #000000;
    }
}

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

/* Focus styles for accessibility */
@media (prefers-reduced-motion: no-preference) {
    .btn:focus-visible,
    .nav-link:focus-visible,
    .form-group input:focus-visible,
    .form-group select:focus-visible,
    .form-group textarea:focus-visible {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --background: #0f172a;
        --background-light: #1e293b;
        --background-dark: #020617;
        --border-color: #334155;
        --border-light: #1e293b;
    }
    
    .header {
        background: var(--background-light);
        border-bottom: 1px solid var(--border-color);
    }
    
    .service-card,
    .contact-form {
        background: var(--background-light);
    }
    
    .tech-item {
        background: var(--background-light);
    }
    
    .client-logo {
        background: var(--background-light);
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: var(--background);
        color: var(--text-primary);
        border-color: var(--border-color);
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-color: var(--primary-color);
    }
}