/* Enhanced Mobile Carousel Navigation Fix */

@media (max-width: 768px) {
    /* Projects section mobile optimization */
    .projects {
        padding: 60px 0 !important;
    }
    
    .projects .container {
        padding: 0 20px !important;
        max-width: 100% !important;
    }
    
    /* Carousel container */
    .projects-container {
        position: relative !important;
        width: 100% !important;
        overflow: visible !important;
        margin-top: 30px !important;
    }
      /* Navigation buttons positioning and styling */
    .carousel-nav {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 25px !important;
        position: relative !important;
        z-index: 999999 !important;
        padding: 0 20px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .carousel-button {
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
        background: rgba(26, 26, 46, 0.98) !important;
        border: 3px solid #00f3ff !important;
        color: #00f3ff !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        font-size: 20px !important;
        z-index: 999999 !important;
        position: relative !important;
        backdrop-filter: blur(15px) !important;
        box-shadow: 
            0 6px 20px rgba(0, 0, 0, 0.5),
            0 0 30px rgba(0, 243, 255, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
        user-select: none !important;
        -webkit-user-select: none !important;
        -webkit-touch-callout: none !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    
    .carousel-button:hover,
    .carousel-button:focus {
        background: rgba(0, 243, 255, 0.2) !important;
        border-color: #ffffff !important;
        color: #ffffff !important;
        transform: scale(1.1) !important;
        box-shadow: 
            0 6px 20px rgba(0, 0, 0, 0.4),
            0 0 25px rgba(0, 243, 255, 0.4) !important;
    }
    
    .carousel-button:active {
        transform: scale(0.95) !important;
        background: rgba(0, 243, 255, 0.4) !important;
    }
    
    /* Ensure buttons are always visible */
    .carousel-prev {
        left: 0 !important;
        position: relative !important;
    }
    
    .carousel-next {
        right: 0 !important;
        position: relative !important;
    }
    
    /* Projects carousel styling */
    .projects-carousel {
        display: flex !important;
        width: 100% !important;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        will-change: transform !important;
        overflow: visible !important;
    }
    
    /* Projects page layout */
    .projects-page {
        flex: 0 0 100% !important;
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 25px !important;
        padding: 0 10px !important;
    }
    
    /* Project cards mobile layout */
    .project-card {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        transform: translateZ(0) !important;
        background: rgba(26, 26, 46, 0.8) !important;
        border: 1px solid rgba(0, 243, 255, 0.2) !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    }
    
    /* Project screenshot mobile */
    .project-screenshot {
        height: 200px !important;
        overflow: hidden !important;
        position: relative !important;
    }
    
    .project-screenshot img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    /* Project content mobile */
    .project-content {
        padding: 20px !important;
    }
    
    .project-title-text {
        font-size: 18px !important;
        line-height: 1.3 !important;
    }
    
    .project-description {
        font-size: 14px !important;
        line-height: 1.5 !important;
        margin: 12px 0 !important;
    }
    
    /* Technology tags mobile */
    .project-technologies {
        flex-wrap: wrap !important;
        gap: 8px !important;
        margin: 15px 0 !important;
    }
    
    .project-tech-tag {
        font-size: 11px !important;
        padding: 4px 8px !important;
    }
    
    /* Footer mobile */
    .project-card-footer {
        padding: 15px 20px !important;
        flex-direction: column !important;
        gap: 15px !important;
        align-items: stretch !important;
    }
    
    /* Languages mobile */
    .primary-languages {
        flex-wrap: wrap !important;
        gap: 10px !important;
        justify-content: center !important;
    }
    
    .primary-language {
        font-size: 12px !important;
    }
    
    /* View project button mobile */
    .view-project-btn {
        width: 100% !important;
        text-align: center !important;
        padding: 12px !important;
        font-size: 14px !important;
        border-radius: 6px !important;
    }
    
    /* Carousel dots */
    .carousel-dots {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin-top: 30px !important;
        gap: 12px !important;
        padding: 0 20px !important;
    }
    
    .carousel-dot {
        width: 12px !important;
        height: 12px !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, 0.3) !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        border: 1px solid rgba(0, 243, 255, 0.2) !important;
    }
    
    .carousel-dot.active {
        background: #00f3ff !important;
        border-color: #00f3ff !important;
        transform: scale(1.3) !important;
        box-shadow: 0 0 10px rgba(0, 243, 255, 0.5) !important;
    }
    
    /* Touch feedback */
    .carousel-button:active,
    .carousel-dot:active {
        opacity: 0.8 !important;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .projects .container {
        padding: 0 15px !important;
    }
    
    .carousel-button {
        width: 45px !important;
        height: 45px !important;
        font-size: 16px !important;
    }
    
    .projects-page {
        gap: 20px !important;
        padding: 0 5px !important;
    }
    
    .project-content {
        padding: 15px !important;
    }
    
    .project-title-text {
        font-size: 16px !important;
    }
    
    .project-description {
        font-size: 13px !important;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .carousel-button {
        width: 40px !important;
        height: 40px !important;
        font-size: 14px !important;
    }
    
    .projects .container {
        padding: 0 10px !important;
    }
    
    .project-screenshot {
        height: 180px !important;
    }
    
    .project-content {
        padding: 12px !important;
    }
}

/* Ensure carousel works in landscape mode */
@media (max-width: 768px) and (orientation: landscape) {
    .projects-page {
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
    }
    
    .project-card {
        font-size: 0.9em !important;
    }
    
    .project-screenshot {
        height: 150px !important;
    }
}

/* Android-specific fixes */
@media (max-width: 480px) {
    /* Force carousel buttons to be visible on Android */
    .carousel-nav {
        position: fixed !important;
        top: 50% !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 999999 !important;
        pointer-events: none !important;
        transform: translateY(-50%) !important;
        background: transparent !important;
        margin: 0 !important;
        padding: 0 10px !important;
    }
    
    .carousel-button {
        pointer-events: all !important;
        width: 70px !important;
        height: 70px !important;
        font-size: 24px !important;
        background: rgba(0, 0, 0, 0.9) !important;
        border: 4px solid #00f3ff !important;
        box-shadow: 
            0 0 0 2px rgba(0, 0, 0, 0.8),
            0 8px 25px rgba(0, 0, 0, 0.6),
            0 0 40px rgba(0, 243, 255, 0.5) !important;
    }
    
    .carousel-prev {
        position: absolute !important;
        left: 10px !important;
    }
    
    .carousel-next {
        position: absolute !important;
        right: 10px !important;
    }
    
    /* Ensure projects container doesn't interfere */
    .projects-container {
        position: relative !important;
        z-index: 1 !important;
    }
    
    .projects-carousel {
        padding: 0 20px !important;
    }
}
