/* MOBILE TOUCH TARGET FIX - Mindestens 44x44px für alle klickbaren Elemente */

/* Globale Touch Target Größe für Mobile */
@media (max-width: 768px) {
    /* Buttons */
    button,
    .btn,
    [type="button"],
    [type="submit"],
    [type="reset"],
    [role="button"],
    .button {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px 16px !important;
        font-size: 16px !important; /* Verhindert Zoom auf iOS */
    }

    /* Links die wie Buttons aussehen */
    a.btn,
    a.button,
    a[role="button"] {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px 16px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Form Inputs */
    input:not([type="hidden"]),
    select,
    textarea {
        min-height: 44px !important;
        padding: 10px 12px !important;
        font-size: 16px !important; /* Verhindert Zoom auf iOS */
    }

    /* Checkboxes und Radio Buttons */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 24px !important;
        min-height: 24px !important;
        margin: 10px !important; /* Erhöht Touch-Bereich */
    }

    /* Labels für Checkboxes/Radio */
    label:has(input[type="checkbox"]),
    label:has(input[type="radio"]) {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        padding: 10px 0 !important;
    }

    /* Navigation Links */
    nav a,
    .navbar a,
    .navigation a,
    .menu a {
        min-height: 44px !important;
        padding: 12px 16px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Dropdown Items */
    .dropdown-item,
    .dropdown-menu a,
    .dropdown-menu button {
        min-height: 44px !important;
        padding: 12px 20px !important;
    }

    /* Icons die klickbar sind */
    i[onclick],
    i[role="button"],
    .icon-button,
    .clickable-icon {
        min-width: 44px !important;
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
    }

    /* Close Buttons */
    .close,
    .btn-close,
    [aria-label="Close"],
    [aria-label="Schließen"] {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 10px !important;
    }

    /* Tabs */
    .nav-tabs .nav-link,
    .nav-pills .nav-link,
    [role="tab"] {
        min-height: 44px !important;
        padding: 12px 20px !important;
    }

    /* Pagination */
    .pagination .page-link {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 10px 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Social Media Buttons */
    .social-button,
    .share-button,
    [class*="social"] a,
    [class*="share"] a {
        min-width: 44px !important;
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Card Actions */
    .card-header button,
    .card-footer button,
    .card-body .btn {
        min-height: 44px !important;
        width: 100% !important; /* Full width auf Mobile */
    }

    /* Modal Buttons */
    .modal-footer .btn,
    .modal-header .btn-close {
        min-height: 44px !important;
        min-width: 80px !important;
    }

    /* Accordion Headers */
    .accordion-button,
    .accordion-header button {
        min-height: 56px !important; /* Größer für bessere Touch */
        padding: 16px 20px !important;
    }

    /* Toggle Switches */
    .form-check,
    .form-switch {
        min-height: 44px !important;
        padding: 10px 0 !important;
    }

    .form-check-input,
    .form-switch-input {
        width: 44px !important;
        height: 24px !important;
        margin-top: 10px !important;
    }

    /* Tags und Chips */
    .tag,
    .chip,
    .badge {
        min-height: 32px !important;
        padding: 6px 12px !important;
        margin: 4px !important;
    }

    /* Breadcrumbs */
    .breadcrumb-item a {
        min-height: 44px !important;
        padding: 10px 8px !important;
        display: inline-flex !important;
        align-items: center !important;
    }

    /* Progress Steps */
    .step-item,
    .progress-step {
        min-height: 44px !important;
        min-width: 44px !important;
    }

    /* File Upload */
    input[type="file"] {
        min-height: 44px !important;
        padding: 10px !important;
    }

    .file-upload-button,
    .upload-btn {
        min-height: 44px !important;
        padding: 12px 20px !important;
    }

    /* Video/Audio Controls */
    video,
    audio {
        min-height: 44px !important;
    }

    /* Sliders */
    input[type="range"] {
        min-height: 44px !important;
    }

    /* Color Picker */
    input[type="color"] {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    /* Date/Time Inputs */
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"] {
        min-height: 44px !important;
        padding: 10px !important;
        font-size: 16px !important;
    }

    /* Spacing für bessere Touch-Bereiche */
    .btn-group .btn {
        margin: 0 2px !important;
    }

    .btn-toolbar .btn {
        margin: 2px !important;
    }

    /* Listen mit klickbaren Items */
    .list-group-item-action {
        min-height: 48px !important;
        padding: 12px 20px !important;
    }

    /* Avatar/Profile Buttons */
    .avatar,
    .profile-button,
    .user-menu {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    /* Notification Icons */
    .notification-icon,
    .bell-icon,
    .message-icon {
        min-width: 44px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Hamburger Menu */
    .hamburger,
    .menu-toggle,
    .mobile-menu-toggle {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    /* Search Buttons */
    .search-button,
    .search-submit {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    /* Floating Action Buttons */
    .fab,
    .floating-action-button {
        min-width: 56px !important;
        min-height: 56px !important;
    }

    /* Back to Top Button */
    .back-to-top,
    .scroll-to-top {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    /* Chat/Support Buttons */
    .chat-button,
    .support-button {
        min-width: 56px !important;
        min-height: 56px !important;
    }

    /* Cookie Banner Buttons */
    .cookie-accept,
    .cookie-decline,
    .cookie-settings {
        min-height: 44px !important;
        margin: 4px !important;
    }

    /* Zusätzlicher Abstand zwischen Elementen */
    button + button,
    .btn + .btn {
        margin-left: 8px !important;
    }

    /* Verhindere Überlappung */
    * {
        box-sizing: border-box !important;
    }

    /* ===== OYROPA FARB-ERHALTUNG (Navy #1A365D, Gold #D69E2E) ===== */

    /* Primary Buttons - Gold Gradient */
    .btn-primary,
    .cta-button,
    .hero-button,
    button[type="submit"]:not(.btn-secondary) {
        background: linear-gradient(135deg, #D69E2E 0%, #B8860B 100%) !important;
        color: #FFFFFF !important;
        border: none !important;
    }

    /* Secondary Buttons - Navy */
    .btn-secondary,
    .btn-outline {
        background: #1A365D !important;
        color: #FFFFFF !important;
        border: 2px solid #1A365D !important;
    }

    /* Navigation - Navy Background */
    nav,
    .navbar,
    .main-nav,
    header {
        background: #1A365D !important;
    }

    nav a,
    .navbar a,
    .main-nav a {
        color: #FFFFFF !important;
    }

    nav a:hover,
    .navbar a:hover,
    .main-nav a:hover {
        color: #D69E2E !important;
    }

    /* Footer - Navy */
    footer {
        background: #1A365D !important;
        color: #FFFFFF !important;
    }

    footer a {
        color: #FFFFFF !important;
    }

    footer a:hover {
        color: #D69E2E !important;
    }

    /* Links - Gold on Hover */
    a:not(nav a):not(.btn):not(.button) {
        color: #1A365D !important;
    }

    a:not(nav a):not(.btn):not(.button):hover {
        color: #D69E2E !important;
    }

    /* ===== VERSTECKTE ELEMENTE - KORREKTE BEHANDLUNG ===== */

    /* Verstecke Elemente die nicht sichtbar sein sollen */
    [style*="display: none"],
    [style*="display:none"],
    .d-none,
    .hidden,
    [hidden],
    [aria-hidden="true"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Dropdown Menus - nur sichtbar wenn aktiv */
    .dropdown-menu:not(.show),
    .nav-dropdown:not(.active),
    .dropdown-content:not(.show) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
    }

    /* Aktive Dropdowns - Touch-optimiert */
    .dropdown-menu.show,
    .nav-dropdown.active,
    .dropdown-content.show {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .dropdown-menu.show .dropdown-item,
    .nav-dropdown.active a {
        min-height: 48px !important;
        padding: 14px 20px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* ===== SPEZIFISCHE FIXES FÜR IDENTIFIZIERTE PROBLEME ===== */

    /* Navigation Dropdown Items (wenn sichtbar) */
    .nav-dropdown.active a[href*="bewertung"],
    .nav-dropdown.active a[href*="immobilien"],
    .nav-dropdown.active a[href*="mobile"],
    .nav-dropdown.active a[href*="kunst"],
    .nav-dropdown.active a[href*="marktplatz"],
    .nav-dropdown.active a[href*="tuerkei"],
    .nav-dropdown.active a[href*="defend"] {
        min-height: 48px !important;
        padding: 14px 24px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Share Icons - nur wenn sichtbar */
    .share-icon:not([style*="display: none"]),
    [class*="share-"]:not([hidden]),
    .social-share a {
        min-width: 48px !important;
        min-height: 48px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 8px !important;
        margin: 4px !important;
    }

    /* Cookie Banner Buttons - wenn Banner sichtbar */
    .cookie-banner:not([style*="display: none"]) button,
    #cookieBanner:not([hidden]) button {
        min-height: 48px !important;
        min-width: 120px !important;
        padding: 12px 24px !important;
        margin: 8px 4px !important;
    }

    #saveAndCloseCookieSettings,
    #closeCookieSettings {
        min-height: 48px !important;
        min-width: 120px !important;
        padding: 12px 24px !important;
    }

    /* Language Selector */
    .language-selector a,
    [href*="tuerkei"].nav-link {
        min-height: 48px !important;
        padding: 12px 16px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* ===== FOCUS STATES FÜR ACCESSIBILITY ===== */

    /* Sichtbare Focus-Indikatoren */
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid #D69E2E !important;
        outline-offset: 2px !important;
    }

    /* Focus für dunkle Hintergründe */
    nav a:focus,
    .navbar a:focus,
    footer a:focus {
        outline: 3px solid #FFD700 !important;
        outline-offset: 2px !important;
    }

    /* ===== ZUSÄTZLICHE TOUCH-OPTIMIERUNGEN ===== */

    /* Größerer Touch-Bereich für kleine Icons */
    i:not([style*="display: none"]),
    .icon:not([hidden]),
    svg:not([hidden]) {
        padding: 12px !important;
    }

    /* Verhindere versehentliche Clicks */
    button:disabled,
    .btn:disabled,
    [disabled] {
        opacity: 0.6 !important;
        pointer-events: none !important;
    }

    /* Verbesserte Tap-Highlights */
    a,
    button,
    input,
    select,
    textarea {
        -webkit-tap-highlight-color: rgba(214, 158, 46, 0.3) !important; /* Gold */
        -webkit-touch-callout: none !important;
    }

    /* Verhindere Text-Selection bei Buttons */
    button,
    .btn,
    [role="button"] {
        user-select: none !important;
        -webkit-user-select: none !important;
    }

    /* ===== RESPONSIVE TABLES ===== */

    /* Table Action Buttons */
    table button,
    table .btn,
    table a.btn {
        min-height: 40px !important;
        padding: 8px 16px !important;
        margin: 2px !important;
    }

    /* ===== ADMIN-SPEZIFISCHE FIXES ===== */

    /* Admin Navigation */
    .admin-nav a,
    .sidebar-menu a,
    .admin-menu-item {
        min-height: 48px !important;
        padding: 14px 20px !important;
    }

    /* Admin Buttons */
    .admin-button,
    .dashboard-button {
        min-height: 44px !important;
        padding: 12px 20px !important;
    }

    /* ===== PRINT STYLES ===== */
    @media print {
        /* Entferne alle Touch-Target-Fixes für Druck */
        button,
        a,
        input {
            min-height: auto !important;
            min-width: auto !important;
            padding: initial !important;
        }
    }
}