/* Mobile-specific fixes for Settings page */

/* Fix extreme height issue on mobile devices */
@media screen and (max-width: 768px) {
    /* Main container height constraints */
    .ldr-settings-container {
        max-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Fix main content height on mobile */
    .ldr-main-content {
        height: auto !important;
        max-height: calc(100vh - 60px); /* Account for mobile nav bar */
        overflow-y: auto;
    }

    /* Settings page specific */
    #settings {
        height: auto !important;
        max-height: 100%;
    }

    /* Card content should scroll */
    .ldr-card {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }

    /* Form should not expand infinitely */
    .ldr-settings-form {
        max-height: none;
        overflow: visible;
    }

    /* Textarea height limits */
    .ldr-settings-textarea {
        min-height: 100px !important;
        max-height: 200px !important;
    }

    /* JSON expanded controls height limit */
    .ldr-json-expanded-controls {
        max-height: 400px;
        overflow-y: auto;
    }

    /* Section spacing */
    .ldr-settings-section {
        margin-bottom: 20px;
    }

    /* Reduce padding on mobile */
    .ldr-settings-item {
        padding: 10px;
    }

    /* Better touch targets */
    .ldr-settings-input,
    .ldr-settings-select,
    .ldr-settings-textarea {
        min-height: 44px;
        font-size: 16px; /* Prevent iOS zoom */
    }

    /* Fix body overflow */
    body {
        overflow-x: hidden;
        overflow-y: auto;
        height: 100vh;
        position: relative;
    }

    /* Ensure page doesn't expand beyond viewport */
    .ldr-page {
        min-height: auto !important;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
}

/* Specific fix for very small devices */
@media screen and (max-width: 480px) {
    .ldr-settings-container {
        padding: 10px;
    }

    .ldr-card {
        margin: 10px 0;
        padding: 10px;
    }

    .ldr-settings-description {
        font-size: 14px;
    }
}
