/* ========================================
   Responsive Design - Mobile First Approach
   ======================================== */

/* ========================================
   Tablet Styles (max-width: 1024px)
   ======================================== */

@media screen and (max-width: 1024px) {
    /* Container */
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    /* Hero Section */
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-image {
        display: none;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .image-wrapper {
        margin: 0 auto var(--spacing-lg);
    }
    
    /* Skills Grid */
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    /* Projects Grid */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    /* Timeline */
    .timeline::before {
        left: 30px;
    }
    
    .timeline-marker {
        left: 30px;
    }
    
    .timeline-content {
        width: calc(100% - 80px);
        margin-left: 60px !important;
    }
    
    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Mobile Styles (max-width: 768px)
   ======================================== */

@media screen and (max-width: 768px) {
    /* Typography */
    :root {
        --font-size-h1: 2.5rem;
        --font-size-h2: 2rem;
        --font-size-h3: 1.5rem;
    }
    
    /* Section Spacing */
    section {
        padding: var(--spacing-lg) 0;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background: var(--color-black);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: var(--spacing-lg);
        transition: left 0.3s ease;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-link {
        font-size: 1.2rem;
        padding: var(--spacing-sm);
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    /* Hero Section */
    .hero {
        min-height: 100vh;
        padding-top: 60px;
    }
    
    .hero-name {
        font-size: 2.5rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    /* About Section */
    .about-info {
        grid-template-columns: 1fr;
    }
    
    .image-placeholder {
        width: 250px;
        height: 250px;
    }
    
    /* Skills */
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    /* Projects */
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    /* Timeline */
    .timeline::before {
        left: 20px;
    }
    
    .timeline-marker {
        left: 20px;
        width: 16px;
        height: 16px;
    }
    
    .timeline-content {
        width: calc(100% - 50px);
        margin-left: 40px !important;
        padding: var(--spacing-sm);
    }
    
    .timeline-tags {
        display: none;
    }
    
    /* Contact Form */
    .contact-form {
        padding: var(--spacing-md);
    }
    
    /* Footer */
    .footer-content {
        font-size: var(--font-size-small);
    }
    
    /* Back to Top */
    .back-to-top {
        width: 40px;
        height: 40px;
        right: 20px;
        bottom: 20px;
    }
}

/* ========================================
   Small Mobile Styles (max-width: 480px)
   ======================================== */

@media screen and (max-width: 480px) {
    /* Typography */
    :root {
        --font-size-h1: 2rem;
        --font-size-h2: 1.5rem;
        --font-size-h3: 1.25rem;
        --spacing-xl: 3rem;
        --spacing-lg: 2rem;
    }
    
    /* Container */
    .container {
        padding: 0 15px;
    }
    
    /* Hero */
    .hero-name {
        font-size: 2rem;
    }
    
    .hero-title {
        font-size: 1.25rem;
    }
    
    .hero-greeting {
        font-size: 1rem;
    }
    
    /* Section Titles */
    .section-title {
        font-size: 1.75rem;
    }
    
    /* About */
    .image-placeholder {
        width: 200px;
        height: 200px;
        font-size: 4rem;
    }
    
    /* Skills */
    .skill-category {
        padding: var(--spacing-sm);
    }
    
    .category-header h3 {
        font-size: 1.1rem;
    }
    
    /* Projects */
    .project-card {
        margin-bottom: var(--spacing-md);
    }
    
    .project-image {
        height: 150px;
    }
    
    .project-placeholder {
        font-size: 2.5rem;
    }
    
    /* Timeline */
    .timeline-content {
        font-size: var(--font-size-small);
    }
    
    .timeline-title {
        font-size: 1.1rem;
    }
    
    /* Contact */
    .contact-item {
        flex-direction: column;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* Form */
    .form-group {
        margin-bottom: var(--spacing-sm);
    }
}

/* ========================================
   Large Desktop Styles (min-width: 1440px)
   ======================================== */

@media screen and (min-width: 1440px) {
    .container {
        max-width: 1320px;
    }
    
    /* Projects Grid */
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Skills Grid */
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   Extra Large Desktop (min-width: 1920px)
   ======================================== */

@media screen and (min-width: 1920px) {
    :root {
        --font-size-base: 18px;
    }
    
    .container {
        max-width: 1440px;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    /* Hide non-essential elements */
    .navbar,
    .hero-buttons,
    .scroll-indicator,
    .back-to-top,
    .social-links,
    .contact-form,
    .project-overlay {
        display: none !important;
    }
    
    /* Reset colors for print */
    body {
        background: white;
        color: black;
    }
    
    .section-title,
    .accent {
        color: black;
    }
    
    /* Ensure sections don't break */
    section {
        page-break-inside: avoid;
    }
    
    /* Adjust spacing */
    section {
        padding: 20px 0;
    }
}

/* ========================================
   Orientation Styles
   ======================================== */

@media screen and (orientation: landscape) and (max-height: 600px) {
    .hero {
        min-height: auto;
        padding: var(--spacing-lg) 0;
    }
    
    .hero-content {
        padding: var(--spacing-md) 0;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* ========================================
   High Resolution Displays
   ======================================== */

@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
    /* Sharper borders and shadows */
    .btn,
    .project-card,
    .timeline-content,
    .contact-form {
        border-width: 0.5px;
    }
}

/* ========================================
   Touch Device Optimizations
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-link,
    .btn,
    .social-link,
    .project-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .project-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.6);
    }
    
    /* Adjust form inputs for touch */
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: var(--spacing-sm);
    }
}
