/* ===== Responsive Design ===== */
/* Enhanced Mobile-First Responsive Design */

/* Base Mobile Styles */
* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

input, textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* Hamburger Menu Styles */
.nav-toggle {
    display: none; /* Hidden by default, shown on mobile */
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1001;
}

/* Show hamburger menu on mobile */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex !important;
        background: rgba(44, 90, 160, 0.1);
        border-radius: 8px;
        margin-left: auto;
    }
    
    .nav-toggle:hover {
        background: rgba(44, 90, 160, 0.2);
    }
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #2c5aa0;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

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

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

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

/* Mobile-optimized touch targets */
.mobile-device .btn,
.mobile-device .nav-link,
.mobile-device .contact-btn {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Touch device optimizations */
.touch-device .service-card:hover,
.touch-device .work-item:hover {
    transform: none;
}

.touch-device .service-card:active,
.touch-device .work-item:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Large Tablets and Small Desktops */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .nav-menu {
        gap: 20px;
    }
    
    .slide-content h2 {
        font-size: 40px;
    }
    
    .slide-content p {
        font-size: 18px;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 25px;
    }
}

/* Mobile Navigation Fix */
@media (max-width: 768px) {
    /* Show hamburger menu */
    .nav-toggle {
        display: flex !important;
    }
    
    /* Hide desktop menu */
    .main-nav .nav-menu {
        display: none !important;
    }
    
    /* Show mobile menu when active */
    .main-nav .nav-menu.active {
        display: flex !important;
    }
}

/* Tablets */
@media (max-width: 768px) {
    /* Header Responsive */
    .header-top {
        flex-direction: column;
        gap: 10px;
        padding: 15px 0;
    }
    
    .contact-info {
        gap: 15px;
    }
    
    .header-main {
        flex-direction: column;
        gap: 20px;
        padding: 20px 0;
    }
    
    .logo {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .logo-text h1 {
        font-size: 20px;
    }
    
    .logo-text p {
        font-size: 12px;
    }
    
    /* Navigation Mobile */
    .nav-toggle {
        display: flex !important;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        gap: 0;
        padding: 20px;
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all 0.3s ease;
    }
    
    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        padding: 15px 0;
        width: 100%;
        justify-content: space-between;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #f8f9fa;
        margin-top: 10px;
        border-radius: 5px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .dropdown.active .dropdown-menu {
        max-height: 300px;
    }
    
    /* Hero Responsive */
    .hero {
        height: 70vh;
        margin-top: 160px;
    }
    
    .slide-content h2 {
        font-size: 32px;
    }
    
    .slide-content p {
        font-size: 16px;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 14px;
    }
    
    .hero-controls {
        padding: 0 20px;
    }
    
    .hero-controls button {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    /* Floating Elements Responsive */
    .floating-social {
        right: 15px;
    }
    
    .social-toggle {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .social-icon {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .floating-contact {
        bottom: 15px;
        left: 15px;
    }
    
    .contact-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .contact-btn span {
        display: none;
    }
    
    /* Services Responsive */
    .services-overview {
        padding: 60px 0;
    }
    
    .section-header h2 {
        font-size: 28px;
    }
    
    .section-header p {
        font-size: 16px;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .service-card {
        padding: 30px 20px;
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
        font-size: 26px;
    }
    
    .service-card h3 {
        font-size: 20px;
    }
    
    .service-card p {
        font-size: 14px;
    }

    /* Latest Works Responsive */
    .latest-works {
        padding: 60px 0;
    }

    .works-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 25px;
        margin-bottom: 40px;
    }

    .work-image {
        height: 200px;
    }

    .work-overlay h3 {
        font-size: 18px;
    }

    /* Contact Responsive */
    .contact-section {
        padding: 60px 0;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-info {
        gap: 20px;
    }

    .contact-card {
        padding: 25px;
    }

    .contact-icon {
        width: 60px;
        height: 60px;
        font-size: 20px;
    }

    .contact-form {
        padding: 30px;
    }

    /* Footer Responsive */
    .footer {
        padding: 40px 0 15px;
    }

    .footer-content {
        gap: 30px;
        margin-bottom: 30px;
    }

    .footer-section h4 {
        font-size: 18px;
    }

    .footer-logo h3 {
        font-size: 20px;
    }

    .back-to-top {
        bottom: 70px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    /* Header Mobile */
    .header-top {
        padding: 10px 0;
    }
    
    .contact-info {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .contact-item {
        font-size: 12px;
    }
    
    .social-links {
        gap: 10px;
    }
    
    .social-links a {
        font-size: 14px;
    }
    
    .header-main {
        padding: 15px 0;
    }
    
    .logo img {
        height: 50px;
    }
    
    .logo-text h1 {
        font-size: 18px;
    }
    
    .logo-text p {
        font-size: 11px;
    }
    
    /* Hero Mobile */
    .hero {
        height: 60vh;
        margin-top: 140px;
    }
    
    .slide-content {
        padding: 0 15px;
    }
    
    .slide-content h2 {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .slide-content p {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .hero-controls {
        padding: 0 15px;
    }
    
    .hero-controls button {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .hero-indicators {
        bottom: 20px;
    }
    
    .indicator {
        width: 10px;
        height: 10px;
    }
    
    /* Floating Elements Mobile */
    .floating-social {
        right: 10px;
    }
    
    .social-toggle {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .social-icons {
        bottom: 55px;
    }
    
    .social-icon {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .floating-contact {
        bottom: 10px;
        left: 10px;
        gap: 8px;
    }
    
    .contact-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 45px;
        justify-content: center;
    }
    
    /* Services Mobile */
    .services-overview {
        padding: 40px 0;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .section-header h2 {
        font-size: 24px;
    }
    
    .section-header p {
        font-size: 14px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .service-card {
        padding: 25px 15px;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    .service-card h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .service-card p {
        font-size: 13px;
        margin-bottom: 15px;
    }

    /* Latest Works Mobile */
    .latest-works {
        padding: 40px 0;
    }

    .works-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 30px;
    }

    .work-image {
        height: 180px;
    }

    .work-overlay {
        padding: 20px 15px 15px;
    }

    .work-overlay h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .rating {
        gap: 3px;
    }

    .rating i {
        font-size: 12px;
    }

    .rating span {
        font-size: 12px;
        margin-left: 8px;
    }

    /* Contact Mobile */
    .contact-section {
        padding: 40px 0;
    }

    .contact-content {
        gap: 30px;
    }

    .contact-card {
        padding: 20px 15px;
    }

    .contact-icon {
        width: 50px;
        height: 50px;
        font-size: 18px;
        margin-bottom: 15px;
    }

    .contact-card h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .contact-card p {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .whatsapp-link {
        padding: 8px 15px;
        font-size: 14px;
    }

    .contact-form {
        padding: 25px 20px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 15px;
        font-size: 14px;
    }

    .contact-form .btn {
        padding: 12px;
        font-size: 14px;
    }

    /* Footer Mobile */
    .footer {
        padding: 30px 0 15px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-bottom: 25px;
        text-align: center;
    }

    .footer-section h4 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .footer-logo h3 {
        font-size: 18px;
        margin: 10px 0 8px;
    }

    .footer-logo p {
        font-size: 12px;
    }

    .footer-logo img {
        height: 40px;
    }

    .footer-contact p {
        font-size: 14px;
        justify-content: center;
    }

    .footer-social {
        justify-content: center;
        margin-top: 15px;
    }

    .footer-social a {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .footer-bottom {
        font-size: 12px;
        padding-top: 15px;
    }

    .back-to-top {
        bottom: 60px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    /* Service Sections Mobile */
    .service-section {
        padding: 40px 0;
    }

    .service-features {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .feature-item {
        padding: 25px 20px;
    }

    .feature-item i {
        font-size: 36px;
        margin-bottom: 15px;
    }

    .feature-item h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .feature-item p {
        font-size: 14px;
    }

    /* Gallery Mobile */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 30px;
    }

    .gallery-item img {
        height: 200px;
    }

    /* About Mobile */
    .about-text h3 {
        font-size: 20px;
        margin: 25px 0 12px;
    }

    .about-text p {
        font-size: 14px;
        line-height: 1.6;
    }

    /* Quote Form Mobile */
    .quote-form {
        padding: 25px 20px;
        margin-top: 30px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }

    .quote-form .form-group {
        margin-bottom: 20px;
    }

    .quote-form input,
    .quote-form select,
    .quote-form textarea {
        padding: 12px 15px;
        font-size: 14px;
    }

    .quote-form .btn {
        padding: 12px;
        font-size: 14px;
    }
}

/* Extra Small Devices */
@media (max-width: 320px) {
    .slide-content h2 {
        font-size: 20px;
    }
    
    .slide-content p {
        font-size: 12px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .section-header h2 {
        font-size: 20px;
    }
    
    .service-card h3 {
        font-size: 16px;
    }
    
    .service-card p {
        font-size: 12px;
    }
}

/* Navigation Toggle Animation */
.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

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

/* Advanced Mobile Optimizations */

/* iOS Safari specific fixes */
@supports (-webkit-appearance: none) {
    .mobile-device input,
    .mobile-device textarea {
        -webkit-appearance: none;
        border-radius: 8px;
    }
    
    .mobile-device .btn {
        -webkit-appearance: none;
        border-radius: 8px;
    }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    /* Reduce animations for better performance */
    * {
        animation-duration: 0.2s !important;
        transition-duration: 0.2s !important;
    }
    
    /* Optimize scroll behavior */
    html {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Better text rendering on mobile */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeSpeed;
    }
    
    /* Improve touch scrolling */
    .services-grid,
    .works-grid,
    .gallery-grid {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile-specific image optimizations */
    img {
        max-width: 100%;
        height: auto;
        object-fit: cover;
        will-change: transform;
    }
    
    /* Optimize forms for mobile */
    input, textarea, select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 15px;
        border-radius: 8px;
        border: 2px solid #e0e0e0;
        width: 100%;
        box-sizing: border-box;
    }
    
    input:focus, textarea:focus, select:focus {
        border-color: #2c5aa0;
        outline: none;
        box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
    }
    
    /* Better button touch targets */
    .btn, button, .contact-btn {
        min-height: 48px;
        padding: 12px 24px;
        font-size: 16px;
        border-radius: 8px;
        cursor: pointer;
        touch-action: manipulation;
    }
    
    /* Mobile gallery improvements */
    .gallery-item,
    .work-item {
        margin-bottom: 20px;
        border-radius: 12px;
        overflow: hidden;
    }
    
    /* Mobile-optimized cards */
    .service-card,
    .contact-card {
        border-radius: 12px;
        padding: 25px 20px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
    
    /* Floating elements adjustments */
    .floating-social,
    .floating-contact {
        z-index: 1000;
    }
    
    .floating-social {
        right: 15px;
        bottom: 120px;
    }
    
    .floating-contact {
        left: 15px;
        bottom: 20px;
    }
    
    /* Better modal behavior on mobile */
    .modal,
    .popup {
        padding: 20px 15px;
    }
    
    .modal-content {
        max-width: 95%;
        margin: 10% auto;
        border-radius: 12px;
    }
}

/* Landscape orientation optimizations */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .hero {
        height: 90vh;
    }
    
    .slide-content h2 {
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .slide-content p {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .hero-controls {
        bottom: 15px;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark mode support for mobile */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .nav-menu {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .nav-link {
        color: #ffffff;
    }
    
    .dropdown-menu {
        background: #2a2a2a;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0s !important;
        transition-duration: 0s !important;
        scroll-behavior: auto !important;
    }
}

/* Print styles for mobile */
@media print {
    .floating-social,
    .floating-contact,
    .nav-toggle,
    .hero-controls {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
        padding: 0 !important;
    }
}

/* Smooth Scrolling for Mobile */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 160px;
    }
}

/* Loading Screen Responsive */
@media (max-width: 480px) {
    .loader p {
        font-size: 14px;
    }
    
    .loader-circle {
        width: 40px;
        height: 40px;
        margin-bottom: 15px;
    }
}

/* Print Styles */
@media print {
    .floating-social,
    .floating-contact,
    .hero-controls,
    .hero-indicators,
    #loading-screen {
        display: none !important;
    }
    
    .header {
        position: static;
        box-shadow: none;
    }
    
    .hero {
        margin-top: 0;
        height: auto;
        min-height: 300px;
    }
    
    body {
        background: white;
    }
}
