/* Mobile-First Optimizations */

/* WICHTIG: Mobile Menu Button muss sichtbar sein */
.mobile-menu-toggle {
  display: none !important; /* Versteckt auf Desktop */
  width: 40px !important;
  height: 40px !important;
  background: #1976d2 !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  position: relative !important;
  z-index: 1001 !important;
  transition: transform 0.3s ease !important;
}

.mobile-menu-dropdown {
  display: none !important;
}

/* MOBILE HAMBURGER MENU - Versteckt Navigation und zeigt Hamburger Button */
@media (max-width: 768px) {
  /* ZEIGE Hamburger Button auf Mobile */
  .mobile-menu-toggle {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    background: #1976d2 !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    width: 40px !important;
    height: 40px !important;
    position: relative !important;
    z-index: 1001 !important;
    transition: transform 0.3s ease !important;
    /* FORCE VISIBILITY */
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    height: 60px !important;
    padding: 8px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    backdrop-filter: blur(10px) !important;
  }
  
  /* Logo und Titel bleiben sichtbar */
  .navbar-logo {
    height: 35px !important;
    width: 35px !important;
    flex-shrink: 0 !important;
  }
  
  .navbar-title {
    font-size: 0.9em !important;
    margin: 0 8px !important;
    white-space: nowrap !important;
    flex-grow: 1 !important;
  }
  
  /* VERSTECKE die normale Navigation auf Mobile */
  .navbar-nav {
    display: none !important;
  }
  
  /* VERSTECKE desktop language switcher auf Mobile */
  .navbar-controls .lang-switcher {
    display: none !important;
  }
  
  /* Hamburger Icon Lines - DEUTLICH SICHTBAR */
  .mobile-menu-toggle::before,
  .mobile-menu-toggle::after,
  .mobile-menu-toggle span {
    content: '' !important;
    display: block !important;
    width: 20px !important;
    height: 3px !important; /* Dicker gemacht */
    background: white !important;
    margin: 3px 0 !important; /* Mehr Abstand */
    transition: all 0.3s ease !important;
    border-radius: 1px !important;
  }
  
  .mobile-menu-toggle span {
    margin: 0 !important;
  }
  
  /* Mobile Dropdown Menu */
  .mobile-menu-dropdown {
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    border-bottom: 2px solid #1976d2 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    display: none !important;
    z-index: 999 !important;
    max-height: 300px !important;
    overflow-y: auto !important;
  }
  
  /* Show dropdown when active */
  .mobile-menu-dropdown.active {
    display: block !important;
  }
  
  /* Mobile menu items */
  .mobile-menu-dropdown a {
    display: block !important;
    padding: 16px 20px !important;
    color: #333 !important;
    text-decoration: none !important;
    font-size: 1em !important;
    border-bottom: 1px solid #eee !important;
    transition: background 0.2s ease !important;
  }
  
  .mobile-menu-dropdown a:hover,
  .mobile-menu-dropdown a:active {
    background: #f5f5f5 !important;
    color: #1976d2 !important;
  }
  
  .mobile-menu-dropdown a:last-child {
    border-bottom: none !important;
  }
  
  /* Language switcher in mobile menu */
  .mobile-lang-switcher {
    display: flex !important;
    gap: 8px !important;
    padding: 12px 20px !important;
    border-top: 1px solid #eee !important;
    background: #f9f9f9 !important;
  }
  
  .mobile-lang-switcher .lang-switch {
    padding: 8px 12px !important;
    font-size: 0.9em !important;
    min-height: 36px !important;
    min-width: 36px !important;
  }
}

/* Allgemeine mobile Verbesserungen */
* {
  -webkit-tap-highlight-color: rgba(255, 193, 7, 0.3);
  -webkit-touch-callout: none;
}

body {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Bessere Touch-Targets */
button, input, textarea, select, a {
  touch-action: manipulation;
}

/* Optimierte Eingabefelder für iOS */
input, textarea, select {
  border-radius: 8px; /* iOS-freundlicher Border-Radius */
  appearance: none;
  -webkit-appearance: none;
}

input[type="date"], input[type="time"], input[type="datetime-local"] {
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  font-size: 16px;
}

/* Verhindert horizontal Scroll */
.main-content, .content-wrapper, .form-section {
  overflow-x: hidden;
}

/* Mobile Navigation Verbesserungen */
@media (max-width: 768px) {
  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 60px; /* Kompakte Navbar-Höhe */
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .navbar-logo {
    height: 35px !important;
    width: 35px !important;
  }
  
  .navbar-title {
    font-size: 0.9em !important;
    margin: 0 8px !important;
    white-space: nowrap;
  }
  
  .navbar-nav {
    display: flex;
    gap: 4px !important;
    margin: 0 !important;
  }
  
  .navbar-nav a {
    padding: 6px 8px !important;
    font-size: 0.75em !important;
    border-radius: 6px;
    white-space: nowrap;
  }
  
  .navbar-controls {
    display: flex;
    align-items: center;
  }
  
  .lang-switcher {
    display: flex;
    gap: 2px;
  }
  
  .lang-switch {
    padding: 4px 6px !important;
    font-size: 0.7em !important;
    min-height: 28px !important;
    min-width: 28px !important;
  }
  
  /* Main Content angepasst an kompakte Navbar */
  .main-content {
    margin-top: 65px !important; /* 5px mehr als Navbar-Höhe */
    padding: 16px 12px !important;
  }
  
  /* Sticky Header Effekt */
  .navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.1), transparent);
  }
  
  /* FAQ Items mobil optimiert - kleiner */
  .faq-item {
    padding: 10px 8px;
    margin-bottom: 6px;
  }
  
  .faq-item h4 {
    font-size: 0.9em;
    line-height: 1.2;
    margin-bottom: 6px;
  }
  
  .faq-item p {
    font-size: 0.8em;
    line-height: 1.3;
  }
  
  .faq-item img {
    max-width: 80px !important;
    height: auto;
    border-radius: 6px;
  }
  
  /* Kontakt-Sektion optimiert - kleiner */
  .contact-item {
    padding: 8px !important;
    margin-bottom: 6px !important;
    font-size: 0.8em !important;
  }
  
  .contact-item h4 {
    font-size: 0.9em !important;
    margin-bottom: 4px !important;
  }
  
  .contact-item p {
    font-size: 0.75em !important;
    line-height: 1.2 !important;
    margin: 1px 0 !important;
  }
  
  /* Titel und Überschriften kompakter */
  .title-section h1 {
    font-size: 1.8em !important;
    line-height: 1.2 !important;
    margin-bottom: 8px !important;
  }
  
  .title-section .subtitle {
    font-size: 0.9em !important;
    margin-bottom: 16px !important;
  }
  
  /* Section Cards VIEL kompakter für bessere mobile Nutzung */
  .section-card {
    padding: 10px 8px !important;
    margin: 6px 0 !important;
    font-size: 0.8em !important;
    line-height: 1.3 !important;
  }
  
  .section-card h3 {
    font-size: 0.95em !important;
    margin-bottom: 6px !important;
  }
  
  .section-card h4 {
    font-size: 0.9em !important;
    margin: 8px 0 4px 0 !important;
  }
  
  .section-card p {
    font-size: 0.75em !important;
    margin-bottom: 6px !important;
  }
}

/* Verbesserte Touch-Interaktionen */
@media (max-width: 600px) {
  /* Alle klickbaren Elemente mindestens 44px hoch */
  button, .btn, .lang-switch, .navbar-nav a {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Größere Touch-Ziele für wichtige Buttons */
  .button-group button {
    min-height: 56px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
  }
  
  /* Optimierte Formulareingaben */
  input, textarea {
    min-height: 48px;
    font-size: 16px; /* Verhindert Zoom bei iOS */
    border-radius: 8px;
    padding: 12px 16px;
  }
  
  .input-icon-group input {
    padding-left: 48px !important;
  }
  
  .input-icon-group .icon {
    left: 14px !important;
    font-size: 18px !important;
  }
  
  /* Bessere Abstände für Touch */
  .address-row {
    gap: 16px;
  }
  
  .button-group {
    gap: 16px;
    margin-top: 24px;
  }
  
  /* Scrolling Verbesserungen */
  .main-content {
    -webkit-overflow-scrolling: touch;
  }
  
  /* FAQ optimiert für mobile Geräte */
  .faq-list {
    padding: 0 8px;
  }
  
  .section-card.narrow {
    max-width: 100%;
    margin: 0 auto;
    padding: 16px;
  }
  
  /* Telefonnummern besser erkennbar */
  a[href^="tel:"] {
    color: #1976d2;
    font-weight: 600;
    text-decoration: none;
    background: rgba(25, 118, 210, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
    margin: 4px 0;
    border: 1px solid rgba(25, 118, 210, 0.3);
  }
  
  a[href^="tel:"]:hover, a[href^="tel:"]:active {
    background: rgba(25, 118, 210, 0.2);
    transform: scale(1.02);
  }
  
  /* E-Mail Links */
  a[href^="mailto:"] {
    color: #0097a7;
    font-weight: 600;
    text-decoration: none;
    background: rgba(0, 151, 167, 0.1);
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-block;
    margin: 2px 0;
    border: 1px solid rgba(0, 151, 167, 0.3);
    font-size: 0.85em;
    word-break: break-all; /* Besserer Umbruch bei langen E-Mails */
  }
  
  a[href^="mailto:"]:hover, a[href^="mailto:"]:active {
    background: rgba(0, 151, 167, 0.2);
    transform: scale(1.02);
  }
  
  /* Bessere Textumbrüche für Kontakt-Infos */
  .contact-item strong {
    display: block;
    margin-bottom: 4px;
  }
  
  /* Kompakte Telefonnummern */
  a[href^="tel:"] {
    color: #1976d2;
    font-weight: 600;
    text-decoration: none;
    background: rgba(25, 118, 210, 0.1);
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-block;
    margin: 2px 0;
    border: 1px solid rgba(25, 118, 210, 0.3);
    font-size: 0.85em;
  }
  
  /* Formulare kompakter */
  #taxiForm {
    padding: 16px 12px !important;
    margin: 12px 0 !important;
  }
  
  .form-section h3 {
    font-size: 1.1em !important;
    margin-bottom: 12px !important;
  }
  
  .address-row {
    gap: 8px !important;
  }
  
  .input-icon-group {
    margin-bottom: 12px !important;
  }
  
  /* Feature Cards kompakter - ÜBERSCHREIBT style.css komplett */
  .feature-card {
    background: #fff !important;
    border-radius: 6px !important;
    padding: 8px !important;
    margin: 3px !important;
    min-width: 120px !important;
    max-width: 140px !important;
    width: calc(50% - 6px) !important;
    min-height: 85px !important;
    display: inline-block !important;
    vertical-align: top !important;
    box-sizing: border-box !important;
    text-align: center !important;
    font-size: 0.75em !important;
    border: 1px solid #e0e0e0 !important;
    flex: none !important; /* Überschreibt flex: 1 1 210px */
  }
  
  .feature-card .fc-title, .feature-card strong {
    display: block !important;
    font-size: 0.8em !important;
    line-height: 1.1 !important;
    margin-bottom: 4px !important;
    color: #1976d2 !important;
  }
  
  .feature-card .fc-text, .feature-card p {
    font-size: 0.7em !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    color: #666 !important;
  }
  
  .feature-card .fc-icon {
    font-size: 1.3em !important;
    margin-bottom: 4px !important;
    display: block !important;
  }
  
  /* Grid Container MUSS die Basis-CSS überschreiben */
  .vp-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    justify-content: space-between !important;
    margin: 8px 0 !important;
    width: 100% !important;
    /* Überschreibt alle anderen Grid-Definitionen */
  }
}

/* Sehr kleine Bildschirme (iPhone SE, etc.) */
@media (max-width: 375px) {
  .navbar {
    height: 55px !important;
    padding: 6px 8px !important;
    flex-wrap: nowrap !important; /* Verhindert Umbruch */
    overflow: hidden;
  }
  
  .navbar-logo {
    height: 30px !important;
    width: 30px !important;
    flex-shrink: 0; /* Logo schrumpft nicht */
  }
  
  .navbar-title {
    font-size: 0.8em !important;
    margin: 0 6px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
  }
  
  .navbar-nav {
    display: flex;
    gap: 2px !important;
    overflow: hidden;
    flex-shrink: 1;
  }
  
  .navbar-nav a {
    padding: 4px 6px !important;
    font-size: 0.7em !important;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .lang-switch {
    padding: 3px 5px !important;
    font-size: 0.65em !important;
    min-height: 24px !important;
    min-width: 24px !important;
    flex-shrink: 0; /* Language switcher schrumpft nicht */
  }
  
  .main-content {
    margin-top: 60px !important;
    padding: 12px 8px !important;
  }
  
  #taxiForm {
    margin: 0 -4px !important;
    padding: 12px 8px !important;
  }
  
  .title-section h1 {
    font-size: 1.5em !important;
    margin-bottom: 6px !important;
  }
  
  .title-section .subtitle {
    font-size: 0.8em !important;
    margin-bottom: 12px !important;
  }
  
  .button-group button {
    font-size: 0.9em !important;
    padding: 12px 16px !important;
    min-height: 44px !important;
  }
  
  .contact-item {
    padding: 10px !important;
    font-size: 0.8em !important;
  }
  
  .contact-item h4 {
    font-size: 0.9em !important;
  }
  
  .contact-item p {
    font-size: 0.75em !important;
  }
  
  .faq-item {
    padding: 12px 8px !important;
  }
  
  .faq-item h4 {
    font-size: 0.9em !important;
  }
  
  .faq-item p {
    font-size: 0.8em !important;
  }
  
  .section-card {
    padding: 12px 8px !important;
    font-size: 0.8em !important;
  }
  
  .section-card h3 {
    font-size: 1em !important;
  }
  
  .section-card h4 {
    font-size: 0.9em !important;
  }
  
  .section-card p {
    font-size: 0.75em !important;
  }
  
  /* Noch kompaktere Links */
  a[href^="tel:"], a[href^="mailto:"] {
    padding: 4px 8px !important;
    font-size: 0.75em !important;
    margin: 1px 0 !important;
  }
}

/* Landscape Orientierung auf Phones */
@media (max-width: 768px) and (orientation: landscape) {
  .navbar {
    height: 45px !important;
    padding: 4px 8px !important;
  }
  
  .navbar-logo {
    height: 28px !important;
    width: 28px !important;
  }
  
  .navbar-title {
    font-size: 0.8em !important;
    margin: 0 6px !important;
  }
  
  .navbar-nav {
    gap: 3px !important;
  }
  
  .navbar-nav a {
    padding: 4px 6px !important;
    font-size: 0.7em !important;
  }
  
  .lang-switch {
    padding: 3px 5px !important;
    font-size: 0.65em !important;
    min-height: 24px !important;
    min-width: 24px !important;
  }
  
  .main-content {
    margin-top: 50px !important;
    padding: 12px !important;
  }
  
  .title-section {
    margin-bottom: 12px !important;
  }
  
  .title-section h1 {
    font-size: 1.4em !important;
  }
  
  .title-section .subtitle {
    font-size: 0.8em !important;
  }
}

/* iOS Safari spezifische Fixes */
@supports (-webkit-touch-callout: none) {
  input, textarea {
    font-size: 16px; /* Verhindert Zoom */
  }
  
  .navbar {
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  .main-content {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }
}

/* Android Chrome spezifische Fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  select {
    background-image: none;
  }
}

/* Hover-Effekte auf Touch-Geräten deaktivieren */
@media (hover: none) {
  .feature-card:hover,
  .review-card:hover,
  .contact-card:hover,
  .faq-item:hover {
    transform: none !important;
    box-shadow: inherit !important;
    border-color: inherit !important;
  }
  
  button:hover,
  .btn:hover {
    transform: none !important;
    box-shadow: inherit !important;
    background: inherit !important;
  }
  
  .navbar-nav a:hover {
    background: inherit !important;
    color: inherit !important;
    transform: none !important;
  }
  
  .map-section:hover {
    transform: none !important;
    box-shadow: inherit !important;
  }
  
  a[href^="tel:"]:hover,
  a[href^="mailto:"]:hover {
    transform: none !important;
    background: inherit !important;
  }
  
  /* Stattdessen Touch-Feedback über :active */
  .feature-card:active,
  button:active,
  .btn:active {
    transform: scale(0.98) !important;
    transition: transform 0.1s ease !important;
  }
}

/* Focus-Verbesserungen für Accessibility */
@media (max-width: 768px) {
  button:focus,
  input:focus,
  textarea:focus,
  select:focus {
    outline: 3px solid #ffc107;
    outline-offset: 2px;
  }
  
  .navbar-nav a:focus {
    outline: 2px solid #ffc107;
    outline-offset: 1px;
  }
  
  a[href^="tel:"]:focus,
  a[href^="mailto:"]:focus {
    outline: 2px solid #ffc107;
    outline-offset: 2px;
  }
}

/* Performance Optimierungen für mobile Geräte */
@media (max-width: 768px) {
  /* Reduzierte Animationen für bessere Performance */
  *, *::before, *::after {
    animation-duration: 0.3s !important;
    transition-duration: 0.3s !important;
  }
  
  /* Vereinfachte Schatten für bessere Performance */
  .feature-card,
  .contact-card,
  .faq-item,
  #taxiForm {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
  }
}
