/*
 * Custom styles for the Inspection Records plugin (Safe version).
 * These styles provide a simple layout for the front‑end search form and the admin edit form.
 */

/* Front end search container */
.cv-safe-search-form {
    max-width: 700px;
    background: #f7f8fd;
    border: 3px solid #eceefb;
    padding: 30px;
    border-radius: 10px;
}

/* Card styling for record details */
.cv-safe-search-form .card {
    border-radius: 8px;
}
.cv-safe-search-form .card-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Admin table tweaks */
.cv-safe-search-form .form-inline .form-control {
    margin-right: 10px;
}

/* Improved search bar layout */
.cv-safe-search-bar {
    display: flex;
    align-items: stretch;
    width: 100%;
}
.cv-safe-search-bar .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border: 1px solid #ced4da;
    flex-grow: 1;
}
.cv-safe-search-bar .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: 0;
    padding-left: 20px;
    padding-right: 20px;
}

@media screen and (max-width: 480px) {
    .cv-safe-search-form form.form-inline {
        display: block;
    }
    .cv-safe-search-form form.form-inline .form-control,
    .cv-safe-search-form form.form-inline .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Styles for the inspection details card */
.cv-safe-details .cv-safe-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 1rem;
    text-align: left;
}
.cv-safe-details .cv-safe-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.cv-safe-details .cv-safe-label {
    font-weight: 600;
    color: #000;
    margin-right: 0.5rem;
    min-width: 160px;
}
.cv-safe-details .cv-safe-value {
    color: #000;
    flex: 1;
    word-break: break-word;
}

/* RTL environments: force left‑to‑right direction for consistent layout */
.cv-safe-search-form {
    direction: ltr;
}
.cv-safe-details {
    direction: ltr;
    text-align: left;
}
.cv-safe-details .cv-safe-row {
    margin-bottom: 0.75rem;
}
.cv-safe-details .cv-safe-label,
.cv-safe-details .cv-safe-value {
    font-size: 1rem;
}

/* Custom search bar wrapper styles for Verify button */
.cv-safe-search-wrapper {
    display: flex;
    align-items: stretch;
    width: 100%;
    /* No outer border on the wrapper */
    border: none;
    border-radius: 0;
    overflow: hidden;
}

/* Button on the left side */
.cv-safe-search-wrapper .cv-verify-btn {
    background: #000;
    color: #fff;
    /* Square edges */
    border-radius: 0;
    /* Add border except on the right side to merge with input */
    border: 1px solid #000;
    border-right: none;
    padding: 0 30px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    white-space: nowrap;
}

/* Input field on the right side */
.cv-safe-search-wrapper .cv-verify-input {
    flex-grow: 1;
    /* Add a border and remove border radius */
    border: 1px solid #000;
    border-left: none;
    border-radius: 0;
    padding: 10px 15px;
    font-size: 1rem;
}

/* Remove default outline on focus */
.cv-safe-search-wrapper .cv-verify-input:focus {
    outline: none;
}

/* Make sure form controls fit well on small screens */
@media screen and (max-width: 480px) {
    .cv-safe-search-wrapper {
        flex-direction: column;
    }
    .cv-safe-search-wrapper .cv-verify-btn,
    .cv-safe-search-wrapper .cv-verify-input {
        border-radius: 0;
        border: 2px solid #000;
    }
    .cv-safe-search-wrapper .cv-verify-btn {
        border-bottom: none;
    }
    .cv-safe-search-wrapper .cv-verify-input {
        border-top: none;
    }
}