/* Mobile Fixes for Dreamcode Index */

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific styles */
    .navbar {
        -webkit-backdrop-filter: blur(10px);
    }

    .nav-links.mobile-active {
        -webkit-backdrop-filter: blur(20px);
    }
}

/* Prevent iOS zoom on form inputs */
input, textarea, select {
    font-size: 16px !important;
}

/* Mobile Menu Fixes */
@media (max-width: 768px) {
    /* Fix navbar on mobile */
    .navbar {
        padding: 10px 15px;
        z-index: 10000;
    }

    .nav-container {
        padding: 0;
    }

    .nav-logo img {
        max-height: 40px;
    }

    /* Mobile menu styles when open */
    .nav-links.mobile-active {
        display: flex !important;
        position: fixed !important;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        flex-direction: column;
        background: rgba(10, 14, 27, 0.98);
        backdrop-filter: blur(20px);
        padding: 20px;
        gap: 15px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        animation: slideDown 0.3s ease-out;
        z-index: 9999;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav-links.mobile-active .nav-link {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        border-radius: 8px;
        transition: background 0.3s ease;
    }

    .nav-links.mobile-active .nav-link:hover {
        background: rgba(29, 100, 255, 0.1);
    }

    .nav-links.mobile-active .cta-button {
        margin-top: 10px;
        width: 100%;
    }

    /* Mobile menu toggle button */
    .mobile-menu-toggle {
        z-index: 10001;
        padding: 5px;
    }

    .mobile-menu-toggle span {
        width: 28px;
        height: 3px;
        background: var(--primary-color);
        display: block;
        transition: all 0.3s ease;
        border-radius: 2px;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-10px);
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* Hero section mobile fixes */
    .hero {
        padding: 120px 15px 60px;
        min-height: calc(100vh - 60px);
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
        padding: 0;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 15px;
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 10px;
        margin-bottom: 30px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        padding: 0 10px;
    }

    .hero-buttons .btn,
    .hero-buttons .liquid-button {
        width: 100%;
        max-width: 300px;
        padding: 14px 24px;
        font-size: 0.95rem;
    }

    /* Hide complex visual elements on mobile */
    .hero-visual,
    .floating-cards {
        display: none;
    }

    /* Theme switcher mobile position */
    .theme-switcher {
        position: fixed;
        bottom: 20px;
        right: 20px;
        top: auto;
        left: auto;
        transform: none;
        flex-direction: column;
        gap: 10px;
        padding: 12px;
        max-width: calc(100vw - 40px);
        font-size: 0.75rem;
        background: rgba(10, 14, 27, 0.95);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 1000;
    }

    .switcher-section {
        flex-wrap: wrap;
        gap: 5px;
    }

    .theme-btn, .anim-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }

    .switcher-section label {
        width: 100%;
        margin-bottom: 5px;
        font-size: 0.75rem;
    }

    /* Background elements mobile optimization */
    .animated-bg {
        opacity: 0.3;
    }

    .gradient-orb {
        width: 200px;
        height: 200px;
    }

    .morph-blob {
        width: 250px;
        height: 250px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    /* Section spacing on mobile */
    section {
        padding: 60px 15px;
    }

    .container {
        padding: 0;
        max-width: 100%;
    }

    /* Typography adjustments */
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .section-desc {
        font-size: 0.95rem;
        padding: 0 10px;
    }

    /* Service cards mobile */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
    }

    .service-card {
        padding: 30px 20px;
    }

    /* Portfolio grid mobile */
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
    }

    /* Stats grid mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .stat-item {
        padding: 20px;
    }

    /* Transformation grid mobile */
    .transformation-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* About section mobile */
    .about-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    /* Contact form mobile */
    .contact-form {
        padding: 30px 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    /* Footer mobile */
    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .footer-section {
        width: 100%;
    }

    .footer-links {
        justify-content: center;
    }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    .animated-bg,
    .geometric-bg {
        width: 100vw;
        overflow: hidden;
    }

    /* Button hover states for mobile */
    @media (hover: none) {
        .btn:hover,
        .liquid-button:hover {
            transform: none;
        }

        .nav-link:hover {
            color: var(--primary-color);
        }
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

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

    .section-title {
        font-size: 1.5rem;
    }

    .theme-switcher {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100vw - 20px);
        padding: 10px;
    }

    .theme-btn, .anim-btn {
        padding: 5px 8px;
        font-size: 0.65rem;
    }
}

/* Tablet portrait */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero {
        padding: 100px 30px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Landscape orientation fixes */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 20px 40px;
    }

    .theme-switcher {
        bottom: 10px;
        padding: 8px;
    }

    .theme-btn, .anim-btn {
        padding: 4px 8px;
        font-size: 0.65rem;
    }
}