/* ===================================
   Responsive Design System
   =================================== */

/* Large Desktop (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: var(--text-7xl);
    }
    
    .section-title {
        font-size: var(--text-5xl);
    }
}

/* Desktop (1200px to 1399px) */
@media (max-width: 1399px) {
    .hero-content {
        gap: var(--space-12);
    }
    
    .hero-title {
        font-size: var(--text-5xl);
    }
}

/* Large Tablet (992px to 1199px) */
@media (max-width: 1199px) {
    .container {
        padding: 0 var(--space-6);
    }
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-10);
    }
    
    .hero-title {
        font-size: var(--text-4xl);
    }
    
    .hero-stats {
        gap: var(--space-6);
    }
    
    .about-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-12);
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet (768px to 991px) */
@media (max-width: 991px) {
    .container {
        padding: 0 var(--space-4);
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--gray-900);
        backdrop-filter: blur(20px);
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        flex-direction: column;
        justify-content: center;
        gap: var(--space-6);
        transition: right var(--transition-normal);
        z-index: var(--z-modal);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Hero Section */
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-12);
    }
    
    .hero-title {
        font-size: var(--text-4xl);
    }
    
    .hero-description {
        max-width: 100%;
    }
    
    .hero-stats {
        justify-content: center;
        gap: var(--space-8);
    }
    
    .hero-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .hero-image {
        width: 250px;
        height: 250px;
    }
    
    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }
    
    .about-text {
        text-align: center;
    }
    
    /* Experience Section */
    .experience-grid {
        gap: var(--space-6);
    }
    
    .experience-card {
        padding: var(--space-6);
    }
    
    /* Projects Section */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .project-card.featured {
        grid-column: span 1;
    }
    
    /* Skills Section */
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
    
    /* Contact Section */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }
    
    .contact-info {
        text-align: center;
    }
    
    .contact-item {
        justify-content: center;
    }
}

/* Mobile Large (576px to 767px) */
@media (max-width: 767px) {
    .container {
        padding: 0 var(--space-3);
    }
    
    /* Typography */
    .hero-title {
        font-size: var(--text-3xl);
        line-height: 1.2;
    }
    
    .section-title {
        font-size: var(--text-3xl);
    }
    
    .hero-description {
        font-size: var(--text-base);
    }
    
    /* Hero Section */
    .hero-section {
        padding: var(--space-16) 0;
        min-height: 90vh;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .stat-item {
        text-align: center;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero-image {
        width: 200px;
        height: 200px;
    }
    
    .tech-stack {
        position: static;
        justify-content: center;
        margin-top: var(--space-6);
        flex-wrap: wrap;
    }
    
    /* Sections */
    .about-section,
    .experience-section,
    .projects-section,
    .skills-section,
    .contact-section {
        padding: var(--space-16) 0;
    }
    
    .section-header {
        margin-bottom: var(--space-12);
    }
    
    /* Experience Cards */
    .experience-card {
        padding: var(--space-5);
    }
    
    .card-header {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
    }
    
    .company-logo {
        align-self: center;
    }
    
    /* Project Cards */
    .project-card {
        margin-bottom: var(--space-6);
    }
    
    .project-image {
        height: 180px;
    }
    
    .project-content {
        padding: var(--space-4);
    }
    
    .project-links {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    /* Skills */
    .skills-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .skill-item {
        padding: var(--space-4);
    }
    
    /* Contact */
    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: var(--space-3);
    }
    
    .contact-icon {
        align-self: center;
    }
    
    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: var(--space-6);
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .footer-social {
        justify-content: center;
    }
}

/* Mobile Small (up to 575px) */
@media (max-width: 575px) {
    .container {
        padding: 0 var(--space-2);
    }
    
    /* Navigation */
    .nav-menu {
        width: 100%;
        right: -100%;
    }
    
    .nav-container {
        padding: var(--space-3);
    }
    
    /* Typography */
    .hero-title {
        font-size: var(--text-2xl);
    }
    
    .section-title {
        font-size: var(--text-2xl);
    }
    
    .hero-badge {
        font-size: var(--text-xs);
        padding: var(--space-1) var(--space-3);
    }
    
    /* Hero Section */
    .hero-section {
        padding: var(--space-12) 0;
        min-height: 80vh;
    }
    
    .hero-image {
        width: 150px;
        height: 150px;
    }
    
    .hero-image-bg {
        top: 15px;
        left: 15px;
        right: -15px;
        bottom: -15px;
    }
    
    /* Sections */
    .about-section,
    .experience-section,
    .projects-section,
    .skills-section,
    .contact-section {
        padding: var(--space-12) 0;
    }
    
    .section-header {
        margin-bottom: var(--space-8);
    }
    
    /* Cards */
    .experience-card,
    .project-card,
    .skill-item {
        padding: var(--space-4);
    }
    
    .project-image {
        height: 150px;
    }
    
    .project-content {
        padding: var(--space-3);
    }
    
    /* Buttons */
    .btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-xs);
    }
    
    .btn-large {
        padding: var(--space-3) var(--space-6);
        font-size: var(--text-sm);
    }
    
    /* Tech Stack */
    .tech-item {
        width: 40px;
        height: 40px;
    }
    
    .tech-item img {
        width: 25px;
        height: 25px;
    }
    
    /* Contact */
    .contact-icon {
        width: 40px;
        height: 40px;
        font-size: var(--text-lg);
    }
    
    .social-link {
        width: 40px;
        height: 40px;
        font-size: var(--text-lg);
    }
    
    /* Footer */
    .footer {
        padding: var(--space-8) 0 var(--space-4);
    }
    
    .footer-content {
        gap: var(--space-4);
    }
    
    .footer-links {
        gap: var(--space-4);
    }
    
    .footer-social a {
        width: 35px;
        height: 35px;
    }
}

/* Extra Small Mobile (up to 375px) */
@media (max-width: 375px) {
    .hero-title {
        font-size: var(--text-xl);
    }
    
    .section-title {
        font-size: var(--text-xl);
    }
    
    .hero-image {
        width: 120px;
        height: 120px;
    }
    
    .hero-image-bg {
        top: 10px;
        left: 10px;
        right: -10px;
        bottom: -10px;
    }
    
    .tech-item {
        width: 35px;
        height: 35px;
    }
    
    .tech-item img {
        width: 20px;
        height: 20px;
    }
    
    .btn {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-xs);
    }
    
    .project-image {
        height: 120px;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        padding: var(--space-8) 0;
    }
    
    .hero-content {
        gap: var(--space-6);
    }
    
    .hero-image {
        width: 120px;
        height: 120px;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: var(--space-6);
    }
    
    .hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

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

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-animation {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .skill-bar {
        transition: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        /* Colors are already optimized for dark mode */
    }
}

/* Print Styles */
@media print {
    .navbar,
    .nav-menu,
    .page-loader,
    .scroll-indicator,
    .hero-actions,
    .project-overlay,
    .social-links,
    .footer {
        display: none !important;
    }
    
    .hero-section {
        min-height: auto;
        padding: var(--space-4) 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: left;
    }
    
    .hero-image {
        width: 100px;
        height: 100px;
        float: right;
        margin: 0 0 var(--space-4) var(--space-4);
    }
    
    .section-header {
        text-align: left;
    }
    
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .projects-grid,
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: black !important;
    }
    
    .gradient-text {
        background: none !important;
        -webkit-text-fill-color: black !important;
        color: black !important;
    }
}

/* Focus Styles for Accessibility */
@media (prefers-reduced-motion: no-preference) {
    .btn:focus,
    .nav-link:focus,
    .social-link:focus {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }
}

/* Hover Effects (only on devices that support hover) */
@media (hover: hover) {
    .btn:hover,
    .nav-link:hover,
    .social-link:hover,
    .project-card:hover,
    .experience-card:hover,
    .skill-item:hover {
        transform: translateY(-2px);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .social-link,
    .project-card,
    .experience-card,
    .skill-item {
        min-height: 44px; /* Minimum touch target size */
    }
    
    .tech-item {
        min-width: 44px;
        min-height: 44px;
    }
    
    .nav-toggle {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Container Queries (for future support) */
@supports (container-type: inline-size) {
    .project-card {
        container-type: inline-size;
    }
    
    @container (max-width: 400px) {
        .project-content h3 {
            font-size: var(--text-lg);
        }
        
        .project-content p {
            font-size: var(--text-sm);
        }
    }
}