/* Mobile Specific Styles */

/* Prevent text selection */
body {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Allow text selection in inputs */
input, textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* Touch scrolling */
.scrollable {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Disable pull to refresh on some elements */
.no-pull-refresh {
    overscroll-behavior-y: contain;
}

/* Active states */
.touch-active:active {
    opacity: 0.7;
    transform: scale(0.98);
}

/* Safe Area */
.safe-top {
    padding-top: var(--safe-area-top);
}

.safe-bottom {
    padding-bottom: var(--safe-area-bottom);
}

.safe-left {
    padding-left: var(--safe-area-left);
}

.safe-right {
    padding-right: var(--safe-area-right);
}

/* iOS Specific */
@supports (-webkit-touch-callout: none) {
    /* iOS keyboard fix */
    input:focus,
    textarea:focus {
        font-size: 16px; /* Prevents zoom on focus */
    }
}

/* Viewport Height Fix for Mobile Browsers */
.full-height {
    height: 100vh;
    height: -webkit-fill-available;
}

/* Landscape Mode */
@media (orientation: landscape) and (max-height: 500px) {
    .app-header {
        height: calc(48px + var(--safe-area-top));
    }

    .header-content {
        height: 48px;
    }

    .app-tabbar {
        height: calc(56px + var(--safe-area-bottom));
    }

    .tabbar-content {
        height: 56px;
    }
}

/* Small Screens */
@media (max-width: 375px) {
    :root {
        --spacing-md: 12px;
        --spacing-lg: 20px;
    }
}

/* Large Screens / Tablet */
@media (min-width: 768px) {
    .bottom-sheet,
    .action-sheet {
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(100%);
        max-width: 600px;
    }

    .bottom-sheet.visible,
    .action-sheet.visible {
        transform: translateX(-50%) translateY(0);
    }

    .modal {
        max-width: 480px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .app-tabbar {
        display: none;
    }

    /* Show desktop sidebar instead */
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
