/* ============================================
   AIC-10-Mobile: Aufmass Mobile Styles
   ============================================ */

/* Touch-Targets: Apple HIG minimum 44x44px */
.is-mobile .btn {
    min-height: 44px;
    padding: 0.5rem 1rem;
}

.is-mobile .form-control,
.is-mobile .form-select {
    min-height: 44px;
    font-size: 16px !important; /* Prevents iOS auto-zoom */
}

.is-mobile input,
.is-mobile select,
.is-mobile textarea {
    font-size: 16px !important;
}

/* No hover effects on touch devices */
@media (hover: none) {
    .card:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    .btn:hover {
        filter: none !important;
    }
}

/* Bottom Nav spacing — prevent content hidden behind nav */
.is-mobile .aufmass-content {
    padding-bottom: 72px; /* 56px nav + 16px padding */
}

/* Safe area for notch devices */
.aufmass-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Dynamic viewport height (iOS Safari URL bar fix) */
.aufmass-fullheight {
    height: 100dvh;
}

/* Fullwidth list items on mobile */
.is-mobile .aufmass-session-list .col-md-6,
.is-mobile .aufmass-session-list .col-lg-4 {
    flex: 0 0 100%;
    max-width: 100%;
}

/* Larger tap targets for list items */
.is-mobile .aufmass-list-item {
    min-height: 56px;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
}

/* Hide breadcrumb on mobile */
.is-mobile .aufmass-breadcrumb {
    display: none;
}

/* Mobile header: compact */
.is-mobile .aufmass-header {
    padding: 0.5rem 0;
}

.is-mobile .aufmass-header h2 {
    font-size: 1.25rem;
}

/* Tab bar for RaumErfassung on mobile */
.is-mobile .aufmass-tabs {
    display: flex;
    border-bottom: 2px solid var(--bs-border-color);
    gap: 0;
}

.is-mobile .aufmass-tabs .aufmass-tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    color: var(--bs-secondary-color);
}

.is-mobile .aufmass-tabs .aufmass-tab.active {
    color: var(--bs-primary);
    border-bottom-color: var(--bs-primary);
}

/* Bottom Sheet */
.bottom-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.bottom-sheet-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bs-body-bg, #1a1a2e);
    border-radius: 1rem 1rem 0 0;
    z-index: 1050;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    max-height: 90dvh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-sheet.show {
    transform: translateY(0);
}

.bottom-sheet.half {
    max-height: 50dvh;
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--bs-secondary-bg);
    border-radius: 2px;
    margin: 0.75rem auto;
}

.bottom-sheet-header {
    padding: 0 1rem 0.75rem;
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.bottom-sheet-body {
    padding: 1rem;
}

/* Bottom Navigation Bar */
.aufmass-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bs-body-bg, #0d0d1a);
    border-top: 1px solid var(--bs-border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.aufmass-bottom-nav .nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: var(--bs-secondary-color);
    text-decoration: none;
    font-size: 0.7rem;
    gap: 0.15rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.aufmass-bottom-nav .nav-tab i {
    font-size: 1.25rem;
}

.aufmass-bottom-nav .nav-tab.active {
    color: var(--bs-primary);
}

/* Decimal input helper */
.aufmass-decimal-input {
    font-variant-numeric: tabular-nums;
}

/* Statistik compact on mobile */
.is-mobile .aufmass-stats-compact {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: var(--bs-tertiary-bg);
    border-radius: 0.5rem;
    font-size: 0.85rem;
}

.is-mobile .aufmass-stats-compact .stat-item {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

/* Sketch editor mobile toolbar */
.is-mobile .sketch-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem;
}

.is-mobile .sketch-toolbar .btn {
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
}
