/**
 * Mobile Optimization Styles
 * Responsive Design & Touch-Optimierung
 */

/* ================================
   Mobile-First Base Styles
   ================================ */

/* Touch-Action für besseres Scrolling */
html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;
}

/* ================================
   Container Responsive
   ================================ */

.container {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 768px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 960px;
        margin: 0 auto;
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1200px;
    }
}

/* ================================
   Touch Targets
   ================================ */

/* Mindestgröße für Touch-Elemente (44x44px min) */
button,
.btn,
a.btn,
input[type="submit"],
input[type="button"],
.clickable,
.nav-link {
    min-height: 44px;
    padding: 0.75rem 1rem;
}

.option-btn {
    min-height: 44px;
}

/* Größere Touch-Targets auf Mobile */
@media (max-width: 767px) {
    button,
    .btn,
    input[type="submit"] {
        min-height: 48px;
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }

    /* Vollbreite Buttons auf Mobile */
    .btn-block-mobile {
        width: 100%;
        display: block;
    }

    /* Spacing zwischen Buttons */
    .btn + .btn {
        margin-top: 0.75rem;
        margin-left: 0;
    }
}

/* ================================
   Touch-Friendly Forms
   ================================ */

input,
textarea,
select {
    font-size: 16px; /* Verhindert iOS-Zoom beim Fokussieren */
    padding: 0.75rem;
    border-radius: 8px;
}

@media (max-width: 767px) {
    input,
    textarea,
    select {
        padding: 1rem;
        font-size: 16px;
    }

    /* Größere Checkboxen/Radio */
    input[type="checkbox"],
    input[type="radio"] {
        width: 24px;
        height: 24px;
    }

    /* Label-Abstände */
    label {
        margin-bottom: 0.75rem;
    }

    /* Form-Gruppen Spacing */
    .form-group {
        margin-bottom: 1.5rem;
    }
}

/* ================================
   Mobile Navigation
   ================================ */

@media (max-width: 767px) {
    .header .container {
        height: 60px;
    }

    .nav {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        flex-direction: column;
        padding: 1.5rem;
        overflow-y: auto;
        z-index: 999;
        gap: 0;
    }

    .nav.active,
    .nav.mobile-open {
        display: flex;
    }

    .nav-link {
        padding: 1rem 0.5rem;
        font-size: 1rem;
        border-bottom: 1px solid var(--color-border, #e0e0e0);
        border-radius: 0;
        text-decoration: none !important;
    }

    .nav-link:hover {
        background: rgba(196, 30, 104, 0.05);
    }

    /* Share Button im Mobile Menu */
    .nav-share-btn {
        margin-top: 1rem;
        justify-content: center;
        border-radius: var(--radius-full, 9999px);
    }

    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 10px;
    }

    .mobile-menu-btn span {
        display: block;
        width: 24px;
        height: 2px;
        background: var(--color-text, #1a1a1a);
        transition: all 0.3s ease;
    }

    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

/* ================================
   Hero Section Mobile
   ================================ */

@media (max-width: 767px) {
    .hero {
        padding-top: 80px;
        padding-bottom: 2rem;
    }

    .hero-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .hero-slogan {
        font-size: 2.5rem;
        text-align: center;
    }

    .hero-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .trust-badges {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

/* ================================
   Wizard/Options Mobile
   ================================ */

@media (max-width: 767px) {
    .options-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .options-grid > .option-btn {
        padding: 1.25rem;
    }

    .wizard-step {
        padding: 1.5rem 1rem;
    }

    .wizard-step h3 {
        font-size: 1.25rem;
    }
}

/* ================================
   Cards & Boxes Mobile
   ================================ */

@media (max-width: 767px) {
    .card,
    .result-card,
    .info-box,
    .reflection-card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .next-step-box {
        padding: 1.25rem;
    }

    .next-step-box .btn {
        width: 100%;
    }
}

/* ================================
   Tables Mobile (Responsive)
   ================================ */

@media (max-width: 767px) {
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 1rem;
        border: 1px solid var(--color-border, #e0e0e0);
        border-radius: 8px;
        overflow: hidden;
    }

    td {
        border: none;
        position: relative;
        padding: 0.75rem 0.75rem 0.75rem 50%;
        text-align: left;
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.75rem;
        width: 45%;
        padding-right: 0.75rem;
        font-weight: 600;
        text-align: left;
    }
}

/* ================================
   Modal/Dialog Mobile
   ================================ */

@media (max-width: 767px) {
    .modal,
    .dialog {
        margin: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }

    .modal-content {
        padding: 1rem;
        min-height: 100vh;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
}

/* ================================
   FAQ/Accordion Mobile
   ================================ */

@media (max-width: 767px) {
    .faq-question {
        padding: 1rem;
        font-size: 1rem;
    }

    .faq-answer {
        padding: 1rem;
    }
}

/* ================================
   Footer Mobile
   ================================ */

@media (max-width: 767px) {
    footer .container {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    footer .links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ================================
   Utility Classes for Mobile
   ================================ */

/* Nur auf Mobile anzeigen */
.mobile-only {
    display: none;
}

@media (max-width: 767px) {
    .mobile-only {
        display: block;
    }
}

/* Auf Mobile verstecken */
@media (max-width: 767px) {
    .desktop-only {
        display: none !important;
    }
}

/* Mobile Text Alignment */
@media (max-width: 767px) {
    .text-center-mobile {
        text-align: center;
    }

    .text-left-mobile {
        text-align: left;
    }
}

/* ================================
   Safe Area (Notch) Support
   ================================ */

/* iPhone X+ Notch Support */
@supports (padding: max(0px)) {
    body {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .header {
        padding-top: env(safe-area-inset-top);
    }

    footer {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    /* Fixed Bottom Elements */
    .fixed-bottom {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* ================================
   Landscape Mode Optimizations
   ================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding-top: 70px;
        padding-bottom: 1rem;
    }

    .hero-slogan {
        font-size: 2rem;
    }

    .wizard-step {
        padding: 1rem;
    }
}

/* ================================
   Print Styles
   ================================ */

@media print {
    .mobile-menu-btn,
    .nav,
    .skip-link,
    button:not(.print-btn),
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .container {
        max-width: none;
        padding: 0;
    }
}
