/* Tablet Styles */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .about-image {
        order: -1;
    }
    
    .about-image img {
        width: 250px;
        height: 250px;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .lightbox-nav button {
        font-size: 1.5rem;
        padding: 0.8rem;
    }
}

/* Mobile Landscape */
@media screen and (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.1);
        padding: 2rem 0;
        gap: 1rem;
    }

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

    .nav-hamburger {
        display: flex;
    }

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

    .nav-hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }
    
    .about-text h2 {
        font-size: 2rem;
    }
    
    .about-text p {
        font-size: 1rem;
    }
    
    .about-image img {
        width: 200px;
        height: 200px;
    }
    
    .skill-tag {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .filter-buttons {
        gap: 0.5rem;
        margin-bottom: 2rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
    }
    
    .gallery-item img {
        height: 250px;
    }
    
    .contact-info h3 {
        font-size: 1.8rem;
    }
    
    .contact-item {
        font-size: 1rem;
    }
    
    .contact-item i {
        width: 40px;
        height: 40px;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 0.9rem;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    .lightbox-close {
        top: -40px;
        font-size: 2rem;
    }
    
    .lightbox-nav button {
        font-size: 1.2rem;
        padding: 0.6rem;
    }
}

/* Mobile Portrait */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .navbar {
        padding: 0.8rem 0;
    }
    
    .nav-logo h1 {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        top: 60px;
        padding: 1.5rem 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-cta {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .about, .gallery, .contact {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }
    
    .about-content {
        gap: 2rem;
    }
    
    .about-text h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .about-text p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
    
    .about-image img {
        width: 180px;
        height: 180px;
        border: 6px solid white;
    }
    
    .filter-buttons {
        justify-content: center;
        gap: 0.3rem;
    }
    
    .filter-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        border-width: 1px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gallery-item {
        border-radius: 10px;
    }
    
    .gallery-item img {
        height: 220px;
    }
    
    .gallery-overlay h3 {
        font-size: 1.2rem;
    }
    
    .view-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .contact-content {
        gap: 2rem;
    }
    
    .contact-info h3 {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }
    
    .contact-item {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
    
    .contact-item i {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .social-link {
        width: 35px;
        height: 35px;
        line-height: 35px;
        font-size: 0.8rem;
        margin-right: 0.5rem;
    }
    
    .contact-form {
        padding: 1.2rem;
        border-radius: 10px;
    }
    
    .form-group {
        margin-bottom: 1.2rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 0.8rem;
        font-size: 0.95rem;
        border-radius: 8px;
    }
    
    .submit-btn {
        padding: 0.8rem;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    .lightbox-content {
        max-width: 98%;
        max-height: 90%;
    }
    
    .lightbox-close {
        top: -35px;
        font-size: 1.8rem;
    }
    
    .lightbox-nav {
        display: none; /* Hide navigation on very small screens */
    }
    
    .footer {
        padding: 1.5rem 0;
        font-size: 0.9rem;
    }
}

/* Very Small Devices */
@media screen and (max-width: 320px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .about-text h2 {
        font-size: 1.6rem;
    }
    
    .about-image img {
        width: 150px;
        height: 150px;
    }
    
    .filter-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .gallery-item img {
        height: 200px;
    }
    
    .contact-info h3 {
        font-size: 1.4rem;
    }
    
    .contact-form {
        padding: 1rem;
    }
}

/* Landscape orientation adjustments for mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 5rem 0;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-scroll {
        display: none;
    }
    
    .nav-menu {
        top: 60px;
    }
}

/* High DPI displays */
@media screen and (-webkit-min-device-pixel-ratio: 2), 
       screen and (min-resolution: 192dpi) {
    .gallery-item img,
    .about-image img,
    #lightbox-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .gallery-item:hover {
        transform: none;
    }
    
    .gallery-overlay {
        opacity: 0.9;
        background: linear-gradient(45deg, rgba(102, 126, 234, 0.7), rgba(118, 75, 162, 0.7));
    }
    
    .nav-link:hover::after {
        width: 0;
    }
    
    .nav-link.active::after {
        width: 100%;
    }
    
    /* Make touch targets larger */
    .view-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .filter-btn {
        padding: 0.8rem 1.2rem;
        min-height: 44px; /* iOS recommended touch target size */
    }
    
    .social-link {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Reduce 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;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .hero-scroll {
        animation: none;
    }
}