/* ===================================
   COMPREHENSIVE MOBILE RESPONSIVE STYLES
   Enhanced for all screen sizes
   =================================== */

/* ===== TABLET (1024px and below) ===== */
@media (max-width: 1024px) {
    :root {
        --spacing-xl: 4rem;
        --spacing-lg: 3rem;
    }

    .container {
        padding: 0 2rem;
    }

    .about-content,
    .contact-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }
}

/* ===== MOBILE (768px and below) ===== */
@media (max-width: 768px) {
    :root {
        --spacing-xl: 3rem;
        --spacing-lg: 2rem;
        --spacing-md: 1.5rem;
    }

    /* Container */
    .container {
        padding: 0 1.5rem;
    }

    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        box-shadow: var(--shadow-xl);
        transition: right var(--transition-normal);
        gap: 2rem;
        z-index: 1000;
    }

    .nav-menu.active {
        right: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* Hero Section */
    .hero {
        min-height: 70vh;
        padding: 8rem 0 4rem;
    }

    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.6;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }

    /* Section Titles */
    .section-title h2 {
        font-size: 2rem;
    }

    .section-title p {
        font-size: 1rem;
    }

    /* About Section */
    .about-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    /* Projects Grid */
    .projects-grid,
    .services-grid,
    .testimonials-slider {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card {
        margin-bottom: 1rem;
    }

    .project-image {
        height: 250px;
    }

    .project-content {
        padding: 1.5rem;
    }

    .project-features {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .feature-tag {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    /* Service Cards */
    .service-card {
        padding: 1.5rem;
    }

    .service-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .service-title {
        font-size: 1.25rem;
    }

    /* Testimonials */
    .testimonial-card {
        padding: 1.5rem;
    }

    .testimonial-text {
        font-size: 0.95rem;
    }

    /* Contact Form */
    .contact-form {
        padding: 1.5rem;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .contact-info {
        padding: 1.5rem;
    }

    .contact-item {
        padding: 1rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .social-links {
        justify-content: center;
    }

    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    /* Buttons */
    .btn {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    /* Logo */
    .logo {
        font-size: 1.125rem;
    }

    .logo-image {
        height: 35px;
        width: auto;
    }

    /* Reduce motion graphics on mobile */
    .geometric-shapes,
    .animated-grid,
    .diagonal-lines {
        opacity: 0.3;
    }

    .floating-icons {
        display: none;
    }

    .pulsing-dots {
        opacity: 0.5;
    }

    /* Video background */
    .video-background .video-placeholder {
        filter: brightness(0.8);
    }
}

/* ===== SMALL MOBILE (480px and below) ===== */
@media (max-width: 480px) {
    :root {
        --spacing-xl: 2rem;
        --spacing-lg: 1.5rem;
        --spacing-md: 1rem;
    }

    /* Container */
    .container {
        padding: 0 1rem;
    }

    /* Section Padding */
    .section {
        padding: var(--spacing-lg) 0;
    }

    /* Hero */
    .hero {
        min-height: 60vh;
        padding: 6rem 0 3rem;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    /* Section Titles */
    .section-title {
        margin-bottom: 2rem;
    }

    .section-title h2 {
        font-size: 1.75rem;
    }

    .section-title p {
        font-size: 0.9rem;
    }

    /* Buttons */
    .btn {
        padding: 0.875rem 1.75rem;
        font-size: 0.95rem;
    }

    /* Project Cards */
    .project-image {
        height: 200px;
    }

    .project-content {
        padding: 1.25rem;
    }

    .project-title {
        font-size: 1.25rem;
    }

    .project-description {
        font-size: 0.875rem;
    }

    /* Service Cards */
    .service-card {
        padding: 1.25rem;
    }

    .service-icon {
        font-size: 2rem;
    }

    .service-title {
        font-size: 1.125rem;
    }

    .service-description {
        font-size: 0.875rem;
    }

    /* Testimonials */
    .testimonial-card {
        padding: 1.25rem;
    }

    .testimonial-text {
        font-size: 0.875rem;
    }

    .author-avatar {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }

    /* Contact */
    .contact-form,
    .contact-info {
        padding: 1.25rem;
    }

    .contact-icon {
        font-size: 1.5rem;
        width: 45px;
        height: 45px;
    }

    /* Stats */
    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.875rem;
    }

    /* Logo */
    .logo {
        font-size: 1rem;
    }

    .logo span {
        display: none;
    }

    .logo-image {
        height: 32px;
        width: auto;
    }

    /* Navigation Menu */
    .nav-menu {
        width: 80%;
    }

    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
    }

    .footer-section h3 {
        font-size: 1.125rem;
    }

    .footer-bottom {
        font-size: 0.8rem;
        padding-top: 1rem;
    }

    /* Disable heavy animations on small screens */
    .geometric-shapes,
    .parallax-layer,
    .blob-container {
        display: none;
    }

    .animated-grid,
    .pulsing-dots,
    .diagonal-lines {
        opacity: 0.2;
    }

    /* Simplify hover effects */
    .hover-lift:hover {
        transform: translateY(-5px) scale(1.01);
    }

    .project-card:hover {
        transform: translateY(-5px);
    }
}

/* ===== EXTRA SMALL (360px and below) ===== */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }

    .project-image {
        height: 180px;
    }

    .container {
        padding: 0 0.75rem;
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 5rem 0 2rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .section {
        padding: 2rem 0;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {

    /* Increase touch targets */
    .btn,
    .nav-link,
    .social-link,
    .project-link {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .project-card:hover,
    .service-card:hover,
    .testimonial-card:hover {
        transform: none;
    }

    /* Disable magnetic cursor effect */
    .magnetic {
        pointer-events: auto !important;
    }

    /* Simplify animations */
    .hover-lift:hover {
        transform: none;
    }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    /* Optimize for retina displays */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ===== PRINT STYLES ===== */
@media print {

    .header,
    .menu-toggle,
    .loading,
    .scroll-top-btn,
    .geometric-shapes,
    .floating-icons,
    .pulsing-dots,
    .animated-grid,
    .diagonal-lines,
    .blob-container,
    .parallax-layer {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .section {
        page-break-inside: avoid;
    }
}

/* ===== COMPREHENSIVE MOBILE POLISH (OVERRIDES) ===== */
@media (max-width: 992px) {

    /* About Split Overlay Stack */
    .about-content {
        grid-template-columns: 1fr !important;
    }

    .about-text {
        padding: 3rem 1.5rem !important;
    }

    .about::before {
        width: 100% !important;
        background: rgba(0, 0, 0, 0.7) !important;
    }

    .about::after {
        display: none !important;
    }

    /* Footer Single Row Stack */
    .footer-content {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
        text-align: center !important;
    }

    .footer-section {
        text-align: center !important;
    }

    .footer-links {
        align-items: center !important;
    }

    .social-links {
        justify-content: center !important;
    }
}

@media (max-width: 768px) {

    /* Top Bar Stack */
    .top-bar-content {
        flex-direction: column !important;
        gap: 10px !important;
        padding: 10px 0 !important;
        height: auto !important;
    }

    .top-contact {
        flex-direction: column !important;
        gap: 5px !important;
        text-align: center !important;
    }

    .top-social {
        justify-content: center !important;
        width: 100% !important;
        gap: 15px !important;
    }

    /* Services/Projects Grid Adjustments */
    .services-grid,
    .projects-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Hero Text Size */
    .hero-title {
        font-size: 1.8rem !important;
    }

    .hero-subtitle {
        font-size: 0.9rem !important;
    }

    /* Force Hero Full Height */
    .hero {
        min-height: 100vh !important;
        min-height: 100dvh !important;
    }

    /* Adjust spacing */
    .section {
        padding: 4rem 0 !important;
    }
}

/* ===== NAVBAR & VIDEO FIXES ===== */
@media (max-width: 768px) {

    /* Video Switching */
    .desktop-video {
        display: none !important;
    }

    .mobile-video {
        display: block !important;
        height: 100vh;
        height: 100dvh;
    }

    .video-background-container {
        height: 100vh;
        height: 100dvh;
    }

    /* Navbar Mobile Fix */
    .menu-toggle {
        display: block;
        cursor: pointer;
        z-index: 1001;
    }

    .menu-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px;
        background: var(--primary-color);
        transition: 0.3s;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2rem 0;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        transition: 0.3s ease-in-out;
        z-index: 999;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        font-size: 1.5rem;
        margin: 1.5rem 0;
        color: var(--primary-dark);
    }
}

/* Desktop defaults */
.mobile-video {
    display: none;
}

.menu-toggle {
    display: none;
}

/* Hide on desktop */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
}