/* ===== RESPONSIVE DESIGN ===== */

/* Large Desktop (1440px and up) */
@media screen and (min-width: 1440px) {
    :root {
        --container-padding: 3%;
    }
    
    .hero-content .container {
        gap: 80px;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop (1024px to 1439px) */
@media screen and (max-width: 1439px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tech-icons {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Landscape (768px to 1023px) */
@media screen and (max-width: 1023px) {
    :root {
        --section-padding: 80px 0;
    }
    
   .nav-links {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(20px); /* Safari support */
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 50px;
    gap: 3rem;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-soft);
}
    
    .nav-links.active {
        transform: translateX(0);
    }
    
    .nav-links a {
        font-size: 1.2rem;
        padding: 15px 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .hero-content .container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .floating-cards {
        height: 300px;
    }
    
    .floating-cards .card {
        padding: 20px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .tech-categories {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Portrait (481px to 767px) */
@media screen and (max-width: 767px) {
    :root {
        --container-padding: 6%;
        --section-padding: 60px 0;
    }
    
    .hero {
        min-height: initial;
    }
    
    .hero-content {
        padding: 100px 0 60px;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .floating-cards {
        height: 250px;
    }
    
    .floating-cards .card {
        padding: 15px;
        font-size: 0.9rem;
    }
    
    .floating-cards .card i {
        font-size: 2rem;
    }
    
    .service-card {
        padding: 30px 25px;
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .tech-icons {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tech-item {
        padding: 25px 20px;
    }
    
    .tech-item i {
        font-size: 2.5rem;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .about-image {
        width: 200px;
        height: 200px;
        font-size: 4rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .contact-form-container {
        padding: 30px 25px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* Mobile Landscape (426px to 480px) */
@media screen and (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .floating-cards {
        height: 200px;
    }
    
    .card-1 {
        top: 10px;
        left: 10px;
    }
    
    .card-2 {
        top: 40px;
        right: 10px;
    }
    
    .card-3 {
        bottom: 10px;
        left: 50%;
    }
    
    .section-header h2 {
        font-size: 2.2rem;
    }
    
    .section-header p {
        font-size: 1.1rem;
    }
}

/* Mobile Portrait (320px to 425px) */
@media screen and (max-width: 425px) {
    :root {
        --container-padding: 8%;
    }
    
    .nav {
        padding: 1rem var(--container-padding);
    }
    
    .logo {
        font-size: 1.5rem;
        gap: 12px;
    }
    
    .logo-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .hero-buttons {
        gap: 15px;
    }
    
    .floating-cards .card {
        padding: 12px;
        font-size: 0.8rem;
        gap: 10px;
    }
    
    .floating-cards .card i {
        font-size: 1.5rem;
    }
    
    .services-grid {
        gap: 25px;
    }
    
    .service-card {
        padding: 25px 20px;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .service-card h3 {
        font-size: 1.3rem;
    }
    
    .tech-item {
        padding: 20px 15px;
    }
    
    .tech-item i {
        font-size: 2rem;
    }
    
    .about-image {
        width: 150px;
        height: 150px;
        font-size: 3rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .contact-item {
        gap: 15px;
    }
    
    .contact-item i {
        font-size: 1.2rem;
        min-width: 25px;
    }
    
    .contact-form-container {
        padding: 25px 20px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
    }
    
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
}

/* Extra Small Mobile (up to 319px) */
@media screen and (max-width: 319px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .floating-cards {
        height: 150px;
    }
    
    .floating-cards .card {
        padding: 10px;
        font-size: 0.7rem;
        gap: 8px;
    }
    
    .floating-cards .card i {
        font-size: 1.2rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .service-card {
        padding: 20px 15px;
    }
    
    .about-image {
        width: 120px;
        height: 120px;
        font-size: 2.5rem;
    }
}

/* ===== ACCESSIBILITY & PERFORMANCE ===== */

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .floating-cards .card {
        animation: none;
    }
    
    .hero-bg-animation {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-blue: #0044aa;
        --secondary-blue: #002266;
        --accent-red: #cc0000;
        --text-gray: #333333;
        --border-light: rgba(0, 0, 0, 0.3);
    }
    
    .service-card,
    .tech-item,
    .contact-form-container {
        border: 2px solid var(--primary-blue);
    }
}

/* Print styles */
@media print {
    .header,
    .hero-bg-animation,
    .floating-cards,
    .back-to-top,
    .menu-toggle {
        display: none !important;
    }
    
    .hero {
        margin-top: 0;
        min-height: initial; /* Fix for Firefox */
        background: white !important;
        color: black !important;
    }
    
    .hero-title,
    .hero-description {
        color: black !important;
    }
    
    .btn {
        border: 2px solid black !important;
        color: black !important;
        background: white !important;
    }
    
    .service-card,
    .tech-item {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .footer {
        background: white !important;
        color: black !important;
    }
}

/* ===== HOVER EFFECTS FOR TOUCH DEVICES ===== */
@media (hover: none) and (pointer: coarse) {
    .service-card:hover,
    .tech-item:hover,
    .btn:hover {
        transform: none;
    }
    
    .service-card:active {
        transform: scale(0.98);
    }
    
    .btn:active {
        transform: scale(0.95);
    }
}