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

/* ==========================================
   Tablet Devices (max-width: 1024px)
   ========================================== */
@media screen and (max-width: 1024px) {
    :root {
        --section-padding: 80px;
    }

    /* Navigation */
    .nav-menu {
        gap: 25px;
    }

    .nav-link {
        font-size: 0.95rem;
    }

    /* Hero Section */
    .hero-title {
        font-size: clamp(2.5rem, 7vw, 5rem);
    }

    .hero-subtitle {
        font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    }

    /* Portfolio Grid */
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 25px;
    }

    /* Contact Section */
    .contact-content {
        gap: 40px;
    }
}

/* ==========================================
   Mobile Devices (max-width: 768px)
   ========================================== */
@media screen and (max-width: 768px) {
    :root {
        --section-padding: 60px;
        --container-padding: 15px;
    }

    /* Navigation */
    .navbar {
        padding: 15px 0;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 100%;
        max-width: 300px;
        height: calc(100vh - 70px);
        background: rgba(15, 15, 30, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 40px 20px;
        gap: 30px;
        transition: right 0.4s ease;
        border-left: 1px solid rgba(139, 92, 246, 0.2);
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    }

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

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

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

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

    /* Hero Section */
    .hero-section {
        min-height: 100vh;
        padding-top: 70px;
    }

    .hero-title {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }

    .hero-subtitle {
        font-size: clamp(1rem, 2vw, 1.3rem);
    }

    .hero-description {
        font-size: 1rem;
    }

    .scroll-indicator {
        bottom: 30px;
    }

    .scroll-indicator p {
        font-size: 0.8rem;
    }

    /* Section Headers */
    .section-title {
        font-size: clamp(2rem, 4vw, 3rem);
    }

    .section-subtitle {
        font-size: 1rem;
    }

    /* Portfolio Section */
    .portfolio-section {
        padding: 50px var(--container-padding);
    }

    .section-header {
        margin-bottom: 40px;
    }

    .category-filter {
        gap: 10px;
        margin-bottom: 40px;
    }

    .filter-btn {
        padding: 10px 18px;
        font-size: 0.85rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .portfolio-image {
        aspect-ratio: 4/5;
    }

    .portfolio-overlay h3 {
        font-size: 1.5rem;
    }

    /* About Section */
    .about-section {
        padding: 50px var(--container-padding);
    }

    .about-text {
        font-size: 1rem;
        margin: 30px auto;
    }

    .skills {
        margin-top: 40px;
    }

    .skills h3 {
        font-size: 1.5rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .skill-item {
        padding: 15px;
        font-size: 0.95rem;
    }

    /* Contact Section */
    .contact-section {
        padding: 50px var(--container-padding);
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-top: 40px;
    }

    .form-group input,
    .form-group textarea {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .submit-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .info-item h3 {
        font-size: 1.2rem;
    }

    .info-item p {
        font-size: 1rem;
    }

    .social-links {
        gap: 15px;
    }

    .social-link {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    /* Footer */
    .footer {
        padding: 30px var(--container-padding);
    }

    .footer p {
        font-size: 0.85rem;
    }

    /* Lightbox */
    .lightbox-close {
        top: 20px;
        right: 20px;
        font-size: 40px;
    }

    .lightbox-caption {
        bottom: 30px;
        font-size: 1rem;
    }
}

/* ==========================================
   Small Mobile Devices (max-width: 480px)
   ========================================== */
@media screen and (max-width: 480px) {
    :root {
        --section-padding: 40px;
    }

    /* Hero Section */
    .hero-title {
        font-size: clamp(1.8rem, 5vw, 2.5rem);
    }

    .hero-subtitle {
        font-size: clamp(0.9rem, 1.8vw, 1.1rem);
        margin-bottom: 10px;
    }

    .hero-description {
        font-size: 0.9rem;
    }

    /* Section Titles */
    .section-title {
        font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    }

    .section-subtitle {
        font-size: 0.9rem;
    }

    /* Category Filter */
    .category-filter {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 0.8rem;
    }

    /* Portfolio Grid */
    .portfolio-grid {
        gap: 15px;
    }

    .portfolio-overlay h3 {
        font-size: 1.3rem;
        padding: 20px;
    }

    /* About Text */
    .about-text {
        font-size: 0.95rem;
    }

    /* Contact Form */
    .form-group input,
    .form-group textarea {
        padding: 10px 12px;
    }

    .submit-btn {
        padding: 10px 25px;
        font-size: 0.95rem;
    }
}

/* ==========================================
   Landscape Mobile Devices
   ========================================== */
@media screen and (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 100px var(--container-padding) 80px;
    }

    .scroll-indicator {
        display: none;
    }

    #canvas-container {
        height: 100%;
        opacity: 0.5;
    }
}

/* ==========================================
   Large Desktop (min-width: 1920px)
   ========================================== */
@media screen and (min-width: 1920px) {
    :root {
        --section-padding: 120px;
    }

    .nav-container,
    .portfolio-grid,
    .about-container,
    .contact-container {
        max-width: 1600px;
    }

    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    }
}

/* ==========================================
   Touch Device Optimizations
   ========================================== */
@media (hover: none) and (pointer: coarse) {
    /* Make touch targets larger */
    .nav-link,
    .filter-btn,
    .submit-btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Remove hover effects on touch devices */
    .portfolio-image:hover img {
        transform: none;
    }

    .portfolio-overlay {
        opacity: 0;
    }

    /* Show overlay on tap */
    .portfolio-item.tapped .portfolio-overlay {
        opacity: 1;
    }

    /* Simplify 3D effects on mobile for performance */
    #canvas-container {
        opacity: 0.3;
    }
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
    .navbar,
    .hamburger,
    .scroll-indicator,
    #canvas-container,
    .category-filter,
    #loading-screen,
    .lightbox {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .hero-section,
    .portfolio-section,
    .about-section,
    .contact-section {
        page-break-inside: avoid;
    }
}

/* ==========================================
   High Contrast Mode
   ========================================== */
@media (prefers-contrast: high) {
    :root {
        --primary-purple: #a78bfa;
        --text-primary: #ffffff;
    }

    .filter-btn,
    .skill-item,
    .social-link {
        border-width: 2px;
    }
}

/* ==========================================
   Dark Mode Adjustments (for systems preferring light mode)
   ========================================== */
@media (prefers-color-scheme: light) {
    /* This site is designed for dark mode,
       but we can add subtle adjustments if needed */
    body {
        /* Keep dark theme as default */
    }
}
