/* Minimal UI Improvements - Mobile Vertical Layout */

/* Mobile-specific vertical layout */
@media (max-width: 768px) {
    /* Better spacing on mobile */
    body {
        -webkit-text-size-adjust: 100%;
        overflow-x: hidden;
        font-size: 16px;
    }
    
    /* Container padding on mobile */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Reduce HR margins */
    hr {
        margin: 8px 0 !important;
    }
    
    /* Reduce default Bootstrap margins */
    .mb-3 {
        margin-bottom: 0.5rem !important;
    }
    
    .mt-3 {
        margin-top: 0.5rem !important;
    }
    
    .mt-10, .mb-10 {
        margin-top: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* VERTICAL LAYOUT FOR TITLE AND VIEW BUTTONS */
    
    /* The flex container that holds view buttons and title */
    .d-flex.align-items-center.justify-content-between {
        flex-direction: column !important;
        align-items: center !important;
        gap: 15px; /* Increased for better separation */
        margin-bottom: 10px !important;
    }
    
    /* View buttons container */
    ._1016-view-buttons {
        order: 2; /* Put buttons below title */
        width: 100%;
        display: flex !important;
        justify-content: center;
        gap: 15px; /* Space between buttons */
        margin-bottom: 5px;
    }
    
    /* Car name/title */
    #_1610-car-name {
        order: 1; /* Put title on top */
        text-align: center;
        font-size: 1.3rem; /* Slightly smaller for better balance */
        margin-bottom: 0 !important;
        letter-spacing: 0.5px;
    }
    
    /* Style view buttons */
    ._1016-view-btn {
        padding: 8px 16px !important;
        min-width: 110px !important;
        font-size: 13px !important;
        background-color: transparent !important;
        border: 1px solid #666 !important;
        color: #fff !important;
        margin: 0 !important; /* Remove old margin */
    }
    
    ._1016-view-btn.active {
        background-color: #fff !important;
        color: #333 !important;
        border-color: #fff !important;
    }
    
    /* MATERIAL SELECTION - Better balanced grid */
    
    /* The materials sidebar becomes full width on mobile */
    #version-cont {
        width: 100%;
        margin-top: 15px;
        padding: 0 10px;
    }
    
    /* Force Bootstrap columns to stack on mobile */
    .col-md-10,
    .col-md-2,
    .col-xl-9,
    .col-xl-3 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    /* Materials list - convert to 2x2 grid */
    #version-cont ._list-style-none {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        padding: 0;
    }
    
    /* Each material item */
    #version-cont li {
        margin: 0 !important;
        display: flex;
        justify-content: center;
    }
    
    /* Material buttons */
    #version-cont ._btn {
        width: 100% !important;
        padding: 10px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        background: transparent !important;
        border: 2px solid transparent !important;
    }
    
    #version-cont ._btn:hover,
    #version-cont ._btn:focus {
        border-color: #FE3333 !important;
    }
    
    /* Material images */
    #version-cont img._outline {
        width: 100px !important;
        height: 75px !important;
        object-fit: cover;
        margin: 5px 0 !important;
        border: 2px solid #666;
        border-radius: 4px;
    }
    
    /* Selected material */
    #version-cont img._outline.active,
    #version-cont img._outline:hover {
        border-color: #FE3333;
    }
    
    /* Material labels */
    #version-cont ._text-small {
        font-size: 0.8rem !important;
        display: block;
        text-align: center;
        margin-top: 5px !important;
        margin-bottom: 0 !important;
        color: #fff;
        font-weight: 500;
    }
    
    /* Car canvas container */
    #_1016-car-editor-container {
        margin: 15px 0;
    }
    
    /* Tighten up the main row spacing */
    .row {
        --bs-gutter-y: 0.5rem;
    }
    
    /* Specific adjustment for car editor row */
    #version-p-sub {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    
    /* Parts carousel container */
    #_1016-visualizer-parts-wrapper {
        margin: 15px 0;
    }
    
    /* Order summary section */
    .row.mt-5 {
        margin-top: 1.5rem !important;
    }
    
    /* Submit button container */
    .col-xl-3.text-right {
        text-align: center !important;
        margin-top: 15px;
    }
    
    /* Submit button */
    ._btn {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }
    
    /* Forms on mobile */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Better tap targets for form elements */
    input, select, textarea, button {
        min-height: 44px;
    }
    
    /* Table improvements */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Modal improvements */
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-content {
        border-radius: 10px;
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
}

/* Additional mobile fixes for smaller screens */
@media (max-width: 480px) {
    /* Even smaller title on very small screens */
    #_1610-car-name {
        font-size: 1.1rem;
    }
    
    /* Smaller view buttons */
    ._1016-view-btn {
        min-width: 95px !important;
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
    
    /* Smaller material images */
    #version-cont img._outline {
        width: 80px !important;
        height: 60px !important;
    }
    
    /* Smaller material text */
    #version-cont ._text-small {
        font-size: 0.7rem !important;
    }
    
    /* Adjust grid gap for small screens */
    #version-cont ._list-style-none {
        gap: 10px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Better focus states - only for form elements */
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #FE3333;
    outline-offset: 2px;
}

/* Typography improvements */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
}

p {
    line-height: 1.6;
}

/* Accessibility - Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Utility classes */
@media (max-width: 768px) {
    .mobile-hidden { display: none !important; }
}

@media (min-width: 769px) {
    .mobile-only { display: none !important; }
}

/* Fix for iOS button styling */
input[type="submit"],
input[type="button"],
button {
    -webkit-appearance: none;
    appearance: none;
}

/* Better image handling */
img {
    max-width: 100%;
    height: auto;
} 