/* Mobile-specific styles */

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Desktop (992px-1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
}

/* Tablet Landscape (768px-991px) */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
    }

    /* Adjust tech grid for better tablet display */
    .tech-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

/* Mobile Navigation Styles */
@media (max-width: 767px) {
    .navbar {
        padding: 0.5rem 0;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.5rem;
        gap: 1rem;
        background-color: rgba(var(--bg-primary-rgb), 0.9);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .nav-links a {
        font-size: var(--text-base);
        padding: 0.5rem 1rem;
        border-radius: 4px;
    }

    .nav-links a:active {
        background-color: rgba(var(--accent-rgb), 0.1);
    }

    /* Hero Section */
    .hero-content {
        padding-top: 4rem;
    }

    .skills {
        justify-content: flex-start;
        padding: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 1rem -1rem;
        padding: 0.5rem 1rem;
        scroll-snap-type: x mandatory;
    }

    .skill-tag {
        scroll-snap-align: start;
        white-space: nowrap;
    }

    /* Projects Section */
    .projects-grid {
        gap: 1.5rem;
        margin: 0;
    }

    .project-card {
        margin: 0 1rem;
    }

    .project-content {
        padding: 1rem;
    }

    .project-links {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    /* Contact Section */
    .contact-grid {
        gap: 1rem;
    }

    .contact-card {
        padding: 1.5rem;
    }
}

/* Tablet Portrait (576px-767px) */
@media (max-width: 767px) {
    :root {
        --container-padding: 1rem;
        --section-spacing: 3rem;
    }

    .container {
        max-width: 540px;
    }

    .title {
        font-size: var(--text-2xl);
    }

    .tech-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }
}

/* Mobile Large (480px-575px) */
@media (max-width: 575px) {
    .container {
        width: 100%;
        padding: 0 1rem;
    }

    .hero-content {
        padding-top: 3rem;
    }

    .typed-wrapper {
        font-size: var(--text-base);
        min-height: 3em;
    }

    .project-card {
        margin: 0 0.5rem;
    }

    .project-image {
        max-height: 200px;
    }

    .tech-card i,
    .tech-card .tech-icon {
        font-size: 2rem;
    }
}

/* Mobile Small (< 480px) */
@media (max-width: 479px) {
    :root {
        --text-4xl: clamp(1.8rem, 5vw, 2.5rem);
        --text-3xl: clamp(1.5rem, 4vw, 2rem);
        --text-2xl: clamp(1.25rem, 3vw, 1.75rem);
        --text-xl: clamp(1.125rem, 2.5vw, 1.5rem);
    }

    .skill-tag {
        padding: 0.5rem 0.75rem;
        font-size: var(--text-xs);
    }

    .project-title {
        font-size: var(--text-lg);
    }

    .project-description {
        font-size: var(--text-sm);
    }

    .contact-card i {
        font-size: 1.75rem;
    }

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

/* Touch Device Optimizations */
@media (hover: none) {
    .skill-tag:hover,
    .project-card:hover,
    .contact-card:hover,
    .tech-card:hover {
        transform: none;
    }

    .nav-links a,
    .project-link,
    .contact-card {
        -webkit-tap-highlight-color: transparent;
    }

    .nav-links a:active,
    .project-link:active,
    .contact-card:active {
        background-color: rgba(var(--accent-rgb), 0.1);
    }
}

/* High-DPI Screen Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .project-image {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Enhance touch targets for better mobile accessibility */
@media (max-width: 767px) {
    .nav-links a,
    .project-link,
    .skill-tag,
    .contact-card,
    .tech-card {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .nav-links,
    .project-card,
    .contact-card,
    .tech-card {
        transition: none !important;
    }
}