@font-face {
    font-family: Prompt;
    src: url(../fonts/Prompt/Prompt-Light.ttf);
}

* {
    font-family: prompt !important;
}

body {
    background: #eee !important;
}

.error {
    border: 1px solid red !important;
}

.card {
    border-radius: 0.7rem !important;
    border: none;
}

.header p {
    font-size: 24px;
    font-weight: bold;
}

.title {
    font-size: 18px;
    font-weight: bold;
}

.tdCenter {
    text-align: center;
}


.checkbox {
    margin-right: 150px;
}

.radio:nth-child(2) {
    margin-right: 35px;
}

.checkbox {
    margin-right: 150px;
}

.radio:nth-child(2) {
    margin-right: 35px;
}

input[type="radio"] {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    flex-grow: 0;
    border: 1px solid #ccc;
    border-radius: 50%;
    margin-right: 0.5em;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 50% 50%;
    transition: 0.3s
}

input[type="radio"]:checked::before {
    border-color: #0b76ef;
    background-color: #0b76ef;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3.5' fill='%23fff'/%3e%3c/svg%3e");
}

.checkbox {
    /* for the label element associated with .custom-checkbox */
    /* creating a pseudo-element in label before with the following styles*/
    /* styles for a checkbox in the checked state */
    margin-bottom: 10px;
}

.checkbox label {
    transition: 0.3s;

}

.checkbox:hover .custom-checkbox+label::before {
    border-color: blue;
}

.checkbox:hover label {
    color: blue;
}

.checkbox .custom-checkbox {
    position: absolute;
    z-index: -1;
    opacity: 0;
}

.checkbox .custom-checkbox+label {
    width: 20rem !important;
    display: inline-flex;
    align-items: center;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.checkbox .custom-checkbox+label::before {
    transition: 0.3s;
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    flex-grow: 0;
    border: 1px solid #cccccc;
    border-radius: 4px;
    margin-right: 0.5em;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 50% 50%;
}

.checkbox .custom-checkbox:checked+label::before {
    border-color: #0b76ef;
    background-color: #0b76ef;
    background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2210%22%20viewBox%3D%220%200%2012%2010%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10%202L4.5%208L2%205.27273%22%20stroke%3D%22white%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22square%22%2F%3E%0A%3C%2Fsvg%3E%0A");
}

.form-check label {
    margin-left: 10px !important;
}

.form-check {
    margin-bottom: 10px;
}

.autoComplete_wrapper {
    display: block;
}

.autoComplete_wrapper>input {
    width: 100%;
}

.ui-menu-item {
    border-bottom: 1px solid lightgray !important;
    padding: 2px !important;

}

.ui-autocomplete {
    height: 300px !important;
    border-radius: 8px !important;
    padding: 10px !important;
    overflow-y: auto !important;
    width: auto !important;
    top: 310px !important;
}

p {
    margin: 10px 10px;
}

.select2-container--default .select2-selection--single{
    height: 38px
}

.select2-container--default .select2-selection--single .select2-selection__rendered{
    padding: 5px 15px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border-radius: 5px;
}

/* Select2 Responsiveness */
.select2-container {
    width: 100% !important;
}

@media (max-width: 450px) {
    .ui-autocomplete {
        top: 500px !important;
        width: 335px !important;
        left: 29px !important;
    }
}

/* --- Added for Aesthetics & Responsiveness --- */

/* Card Aesthetics */
.card {
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 20px !important; /* Proper spacing between cards */
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
}

/* Modern Input Styling */
.form-control, .form-select {
    border-radius: 8px !important;
    border: 1px solid #dee2e6;
    padding: 10px 15px;
    height: auto;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #0b76ef;
    box-shadow: 0 0 0 3px rgba(11, 118, 239, 0.15);
}

/* Button & Interactive Elements */
.btn {
    border-radius: 8px !important;
    padding: 10px 20px;
    font-weight: 500;
}

/* Mobile Responsiveness Improvements */
@media (max-width: 768px) {
    .header p {
        font-size: 20px; /* Smaller header on mobile */
    }
    
    .title p {
        font-size: 18px !important;
    }

    /* Adjust margins for full width usage on mobile */
    .col-12.m-2 {
        margin: 0.5rem 0 !important;
        padding: 0 5px;
    }
    
    .card {
        margin: 10px 0 !important;
        padding: 15px 5px !important;
    }

    /* Stack radio/checkboxes vertically on very small screens if needed, 
       or ensure they have enough touch area */
    .checkbox, .radio {
        margin-right: 15px !important;
        margin-bottom: 15px;
    }
    
    .checkbox .custom-checkbox+label {
        width: 100% !important; /* Full width labels for easier tapping */
    }
}

/* Image Responsiveness */
.zoomable-image {
    max-width: 100%;
    height: auto !important; /* Override inline styles for mobile */
    max-height: 150px;
}

@media (max-width: 768px) {
    /* ... existing mobile styles ... */
    
    .zoomable-image {
        max-height: 120px; /* Slightly smaller on mobile */
    }
}

/* Table Responsiveness */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

/* Custom Scrollbar for tables */
.table-responsive::-webkit-scrollbar {
    height: 6px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* Stacked Table for Mobile (Part 2.5) */
@media (max-width: 768px) {
    .table-stack-mobile thead {
        display: none;
    }

    .table-stack-mobile tr {
        display: block;
        margin-bottom: 2rem;
        background-color: #fff;
        border: 1px solid #ddd;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .table-stack-mobile td {
        display: block;
        text-align: right;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50% !important; /* Space for label */
        padding-top: 10px;
        padding-bottom: 10px;
        min-height: 40px;
    }

    .table-stack-mobile td:last-child {
        border-bottom: none;
    }

    .table-stack-mobile td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%;
        white-space: normal; /* Allow wrapping */
        text-align: left;
        font-weight: bold;
        color: #555;
        top: 50%;
        transform: translateY(-50%);
    }

    /* Special handling for the Image cell which is tall */
    .table-stack-mobile td[data-label="ชนิดฉลาก"] {
        text-align: center !important;
        padding-left: 15px !important;
        padding-top: 50px; /* Space for label at top */
    }

    .table-stack-mobile td[data-label="ชนิดฉลาก"]::before {
        top: 15px;
        transform: none;
        width: 100%;
        text-align: center;
    }

    /* Adjust checkbox/radio alignment in stacked view */
    .table-stack-mobile .form-check {
        display: inline-block;
        margin-right: 10px;
    }
}