/* Mobile-specific styles */
@media (max-width: 768px) {
    /* Navigation improvements */
    .navbar {
        height: 60px;
        background-color: var(--background-color);
    }

    .navbar-content {
        padding: 0 20px;
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 100%;
    }

    .nav-left {
        margin-left: auto;
    }

    .nav-center,
    .nav-right {
        display: none;
    }

    /* Burger Menu Styles */
    .burger-menu {
        display: block;
        width: 24px;
        height: 20px;
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        cursor: pointer;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 0;
    }

    .burger-menu span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: var(--text-color);
        transition: all 0.3s ease;
        transform-origin: left center;
    }

    /* Активное состояние бургера */
    .burger-menu.active span:nth-child(1) { 
        transform: rotate(45deg);
        width: 120%;
    }
    .burger-menu.active span:nth-child(2) { 
        opacity: 0;
        transform: translateX(-100%);
    }
    .burger-menu.active span:nth-child(3) { 
        transform: rotate(-45deg);
        width: 120%;
    }

    /* Mobile Menu Styles */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--background-color);
        padding: 80px 40px 20px 20px;
        transition: transform 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-100%);
        visibility: hidden;
    }

    .mobile-menu.active {
        transform: translateX(0);
        visibility: visible;
    }
    
    /* Фиксим проблему с прокруткой на iOS */
    .mobile-menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    .mobile-menu-header {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 30px;
    }

    .mobile-menu-header img {
        height: 40px;
        width: auto;
    }

    .mobile-menu-header h1 {
        font-size: 1.5rem;
        color: var(--text-color);
    }

    .mobile-nav-links {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mobile-nav-links li {
        margin-bottom: 20px;
    }

    .mobile-nav-links a {
        display: block;
        color: var(--text-color);
        font-size: 1.2rem;
        text-decoration: none;
        font-family: var(--font-special);
        letter-spacing: 1px;
        padding: 10px 0;
    }

    .mobile-language-selector {
        margin-top: 30px;
        padding: 20px 0;
        border-top: 1px solid var(--border-color);
    }

    /* Hide desktop elements */
    .nav-center,
    .nav-right {
        display: none;
    }

    .logo h1 {
        display: none;
    }

    .logo img {
        height: 30px;
    }

    /* Hero Section improvements */
    .hero {
        height: 100svh; /* Use small viewport height for mobile */
    }

    #hero-video {
        display: none; /* Hide video on mobile for better performance */
    }

    .hero::before {
        background: linear-gradient(to bottom, 
            rgba(0, 0, 0, 0.8), 
            var(--background-color)
        );
    }

    .hero-content {
        padding: 0 20px;
    }

    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }

    .hero-content p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    /* Mobile background fallback */
    .hero {
        background: url('/assets/images/logobanner.png') center/cover no-repeat;
    }

    /* Projects Section */
    .projects {
        padding: 3rem 20px;
    }

    .projects h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .project-filters {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
        border-radius: 25px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.3s ease;
    }

    .filter-btn:hover,
    .filter-btn.active {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        transform: translateY(-2px);
    }

    .projects-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 1.5rem;
    }

    /* Footer improvements */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .footer-logo {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .footer-disclaimer {
        font-size: 0.8rem;
        padding: 10px;
    }
}

/* Small mobile devices */
@media (max-width: 375px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }

    .logo h1 {
        font-size: 1rem;
    }

    .language-btn {
        padding: 0 8px;
    }
}

/* Prevent scroll issues on mobile */
@supports (-webkit-touch-callout: none) {
    .hero {
        height: -webkit-fill-available;
    }
}

/* Optimize animations for mobile */
@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .fade-in-delay {
        animation: none !important;
    }
}
