/* Mobile Optimization Enhancements */

/* Remove any blue borders or strokes */
html, body, *, *::before, *::after {
  border-top: none !important;
  outline: none !important;
}

/* Mobile-first touch and interaction improvements */
@media (max-width: 768px) {
  /* Enhanced touch targets */
  .btn, .cta-button, .nav-link, .cookie-btn, .portfolio-btn {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 0.9rem;
    tap-highlight-color: rgba(79, 195, 247, 0.3);
  }
  
  /* Modern hamburger menu button - Force visibility */
  .navbar .nav-toggle,
  .nav-container .nav-toggle {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 32px !important;
    height: 32px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    z-index: 1003 !important;
    transition: all 0.3s ease !important;
    position: fixed !important;
    top: 25px !important;
    right: 1.5rem !important;
    opacity: 1 !important;
    visibility: visible !important;
    outline: none !important;
    overflow: visible !important;
    transform: none !important;
  }
  
  .nav-toggle .bar {
    width: 26px !important;
    height: 2px !important;
    background-color: #000000 !important;
    margin: 0 !important;
    transition: all 0.3s ease !important;
    border-radius: 0 !important;
    transform-origin: center !important;
    display: block !important;
    opacity: 1 !important;
    position: absolute !important;
    left: 3px !important;
  }
  
  .nav-toggle .bar:nth-child(1) {
    top: 10px !important;
  }
  
  .nav-toggle .bar:nth-child(2) {
    top: 15px !important;
  }
  
  .nav-toggle .bar:nth-child(3) {
    top: 20px !important;
  }
  
  .nav-toggle.active .bar:nth-child(1) {
    top: 15px !important;
    transform: rotate(45deg) !important;
    background-color: #000000 !important;
  }
  
  .nav-toggle.active .bar:nth-child(2) {
    opacity: 0 !important;
  }
  
  .nav-toggle.active .bar:nth-child(3) {
    top: 15px !important;
    transform: rotate(-45deg) !important;
    background-color: #000000 !important;
  }
  
  /* Mobile navigation improvements */
  .navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }
  
  .nav-container {
    padding: 0 1rem;
    position: relative;
  }
  
  /* Hide desktop menu on mobile - Force hidden by default */
  .navbar .nav-menu,
  #nav-menu {
    position: fixed !important;
    left: 0 !important;
    top: -100% !important;
    flex-direction: column !important;
    background: #ffffff !important;
    width: 100% !important;
    height: 100vh !important;
    text-align: left !important;
    transition: top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    padding: 5rem 2rem 2rem 2rem !important;
    z-index: 1002 !important;
    overflow-y: auto !important;
    border: none !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.3) !important;
    display: flex !important;
    transform: none !important;
  }
  
  /* Show menu when active */
  .navbar .nav-menu.active,
  #nav-menu.active {
    top: 0 !important;
  }
  
  .nav-list {
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
    list-style: none;
  }
  
  /* Hide desktop language switcher on mobile */
  .desktop-language-switcher {
    display: none !important;
  }
  
  .nav-actions {
    display: none !important;
  }
  
  /* Show mobile language switcher only inside menu on mobile */
  .nav-menu .mobile-language-switcher {
    display: flex !important;
  }
  
  /* Style mobile language switcher inside menu */
  .nav-menu .mobile-language-switcher .lang-toggle-container {
    background: rgba(79, 195, 247, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 20px !important;
    padding: 2px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(79, 195, 247, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    height: 36px !important;
  }
  
  .nav-menu .mobile-language-switcher .lang-toggle-btn {
    background: transparent !important;
    border: none !important;
    border-radius: 16px !important;
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    color: rgba(0, 0, 0, 0.7) !important;
    min-width: 40px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
  }
  
  .nav-menu .mobile-language-switcher .lang-toggle-btn:hover {
    color: rgba(0, 0, 0, 0.9) !important;
    background: rgba(79, 195, 247, 0.2) !important;
  }
  
  .nav-menu .mobile-language-switcher .lang-toggle-btn.active {
    background: rgba(79, 195, 247, 0.8) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(79, 195, 247, 0.3) !important;
  }
  
  .nav-link {
    font-size: 1.4rem;
    font-weight: 400;
    padding: 1rem 0;
    border-radius: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
    width: 100%;
    margin: 0;
    color: #1a202c;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    letter-spacing: -0.025em;
    white-space: nowrap;
  }
  
  .nav-link:hover, .nav-link.active {
    background-color: transparent;
    color: var(--primary-color);
    transform: translateX(8px);
    border-bottom-color: var(--primary-color);
  }
  
  .nav-link:last-child {
    border-bottom: none;
  }
  
  .nav-link::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--primary-color);
    transition: height 0.3s ease;
    border-radius: 2px;
  }
  
  .nav-link:hover::before, .nav-link.active::before {
    height: 100%;
  }
  
  /* Hero section mobile optimization */
  .hero {
    padding: 2rem 0;
    min-height: 85vh;
    padding-top: 100px !important;
  }
  
  .hero-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 2.5rem;
    width: 100% !important;
    padding: 0 1rem !important;
  }
  
  .hero-content {
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  
  .hero-title {
    font-size: 2.2rem !important;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-align: center !important;
    width: 100% !important;
  }
  
  .hero-subtitle {
    font-size: 1rem;
    line-height: 1.6;
    max-width: 95% !important;
    text-align: center !important;
    margin: 0 auto 1.5rem auto !important;
  }
  
  .hero-badge {
    font-size: 0.65rem;
    padding: 5px 10px;
    margin: 0 auto 1rem auto !important;
    z-index: 500 !important;
    position: relative !important;
    margin-top: 0px !important;
    white-space: nowrap !important;
    max-width: 100% !important;
    overflow: visible !important;
  }
  
  .hero-buttons {
    flex-direction: column !important;
    gap: 1.2rem !important;
    width: 100% !important;
    max-width: 300px !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 1.5rem auto !important;
  }
  
  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
    text-align: center !important;
  }
  
  .hero-stats {
    flex-direction: row !important;
    justify-content: center !important;
    gap: 2rem !important;
    width: 100% !important;
    max-width: 350px !important;
    margin: 0 auto !important;
    text-align: center !important;
  }
  
  .stat-number {
    font-size: 1.8rem !important;
  }
  
  .stat-label {
    font-size: 0.8rem;
  }
  
  /* Mobile content optimizations */
  .container {
    padding: 0 1rem;
  }
  
  
  body {
    padding-top: 0 !important;
  }
  
  .services-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.8rem;
    justify-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0.8rem;
  }
  
  .service-card {
    width: 70px !important;
    height: 75px !important;
    padding: 0.5rem 0.3rem !important;
    font-size: 0.7rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    line-height: 1.1 !important;
  }
  
  .service-card i,
  .service-card svg {
    width: 22px !important;
    height: 22px !important;
    margin-bottom: 0.4rem !important;
    flex-shrink: 0 !important;
  }
  
  .service-card span {
    font-size: 0.7rem !important;
    line-height: 1.1 !important;
    max-width: 100% !important;
    text-align: center !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }
  
  .services-grid-large {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
  
  .service-card-large {
    padding: 1.5rem;
    text-align: center;
  }
  
  .process-steps {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
  
  .values-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
  
  /* Mobile typography */
  .section-title {
    font-size: 2.2rem;
  }
  
  .section-subtitle {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  /* Mobile forms */
  .form-row {
    flex-direction: column !important;
    gap: 1rem;
  }
  
  .contact-content {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }
  
  .contact-cards {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
  
  .contact-form {
    padding: 1.5rem;
  }
  
  /* Mobile team section */
  .team-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }
  
  .team-member {
    text-align: center;
    padding: 1.5rem;
  }
  
  .member-avatar {
    margin: 0 auto 1rem auto;
  }
  
  /* Mobile footer */
  .footer-horizontal {
    flex-direction: column !important;
    gap: 2rem !important;
    text-align: center;
  }
  
  .footer-company,
  .footer-navigation,
  .footer-contact {
    flex: none !important;
  }
  
  /* Mobile page headers */
  .page-header {
    padding: calc(70px + 1.5rem) 0 1rem 0;
  }
  
  .page-header h1 {
    font-size: 2.2rem;
    line-height: 1.2;
  }
  
  /* Section spacing */
  section {
    padding: 1.5rem 0;
  }
  
  /* Mobile projects */
  .projects-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
  
  .project-image {
    height: 220px;
  }
  
  /* Mobile cookie banner */
  .cookie-banner {
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  
  .cookie-content {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
  }
  
  .cookie-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .cookie-btn {
    text-align: center;
    padding: 12px 20px;
  }
  
  /* Smooth scrolling improvements */
  html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Performance improvements */
  * {
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Video background mobile optimization */
  .hero-video {
    object-fit: cover;
    object-position: center;
  }
  
  /* Input improvements for mobile */
  input, textarea, select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: border-color 0.2s ease;
  }
  
  input:focus, textarea:focus, select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.1);
  }
}

/* Small mobile devices (320px to 480px) */
@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem !important;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .hero-stats {
    gap: 1rem !important;
  }
  
  .stat-number {
    font-size: 1.5rem !important;
  }
  
  .container {
    padding: 0 0.75rem;
  }
  
  .cookie-banner {
    padding: 0.75rem;
  }
  
  .nav-link {
    width: 90%;
  }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    padding: 1rem 0;
  }
  
  .hero-container {
    gap: 1rem;
  }
  
  .hero-title {
    font-size: 2rem !important;
  }
  
  .hero-stats {
    flex-direction: row !important;
    gap: 1.5rem !important;
  }
}

/* iOS safe area support */
@supports (padding: max(0px)) {
  @media (max-width: 768px) {
    .cookie-banner {
      padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    
    .nav-menu {
      max-height: calc(100vh - 70px - env(safe-area-inset-bottom, 0px));
    }
  }
}