/* General Styles */
.search-sec {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}
.search-sec .container {
    max-width: 1200px;
    margin: auto;
}
.search-sec label {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    color: #333;
}
.search-sec .form-control {
    border: 1px solid #ddd;
    padding: 8px;
    width: 100%;
    border-radius: 6px;
    font-size: 15px;
    color: #333;
    background: #fff;
    transition: border-color 0.3s;
    white-space: nowrap; /* Prevent text wrapping */
    overflow: visible; /* Ensure text isn't clipped */
}
.search-sec .form-control:focus {
    border-color: #04AF9F;
    outline: none;
    box-shadow: 0 0 5px rgba(4, 175, 159, 0.3);
}
.search-sec .form-control::placeholder {
    color: #999;
    opacity: 1;
}

/* Flexbox Layout */
.row {
    display: flex;
    flex-wrap: nowrap; /* Prevent wrapping on desktop */
    gap: 10px;
    padding-bottom: 10px;
}
.col-lg-4, .col-md-7 {
    flex: 0 0 25% !important; /* 4 columns in a 12-column grid */
    min-width: 200px; /* Minimum width to avoid cramping */
}

/* Button Styles */
.search-sec .btn {
    background: #04AF9F;
    color: #fff;
    border-radius: 6px;
    padding: 14px;
    border: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    font-size: 16px;
    width: 80%;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 23px; /* Align with dropdown height */
}
.search-sec .btn:hover {
    background: #C00564;
    transform: translateY(-2px);
}

/* Result Styles */
#search-results .machine-item {
    background: #fff;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    gap: 15px; /* Space between image and details */
}
#search-results .machine-item:hover {
    transform: translateY(-3px);
}
#search-results .machine-image {
    flex: 0 0 auto;
}
#search-results .machine-image img.machine-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    transition: opacity 0.3s;
}
#search-results .machine-image img.machine-thumbnail:hover {
    opacity: 0.9;
}
#search-results .machine-details {
	line-height: 1.1;
    flex: 1 1 auto;
}
#search-results .machine-details h3 {
    margin: 0 0 10px;
    font-size: 20px;
}
#search-results .machine-details h3 a {
    color: #04AF9F;
    text-decoration: none;
}
#search-results .machine-details h3 a:hover {
	color: #ff0066;
    text-decoration: underline;
}
#search-results .machine-details p {
    margin: 5px 0;
    color: #555;
}
#search-results .search-results-count {
    font-size: 16px;
    color: #333;
    margin: 10px 0;
}
#search-results .no-results, 
#search-results .error {
    color: #C00564;
    font-size: 16px;
    margin: 20px 0;
}

/* Pagination */
#search-results .pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}
#search-results .pagination button {
    padding: 10px 20px;
    background: #04AF9F;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.3s;
}
#search-results .pagination button:hover {
    background: #C00564;
}

/* Loading Spinner */
#search-results .loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #04AF9F;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
#search-results .loading {
    text-align: center;
    color: #555;
    margin: 10px 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .row {
        flex-wrap: wrap; /* Allow wrapping on smaller desktops */
    }
    .col-lg-3, .col-md-6 {
        flex: 1;
        min-width: 220px; /* Ensure fields are readable */
    }
}
@media (max-width: 992px) {
    .col-lg-3, .col-md-6 {
        min-width: 100%;
    }
    .search-sec .btn {
        width: 100%;
        margin-top: 10px;
    }
    #search-results .machine-item {
        flex-direction: column;
        align-items: flex-start;
    }
    #search-results .machine-image img.machine-thumbnail {
        width: 250px;
		object-fit: cover;
        height: auto;
        max-height: 150px;
    }
}
@media (max-width: 576px) {
    .search-sec {
        padding: 20px;
    }
    #search-results .machine-item {
        padding: 15px;
    }
    #search-results .machine-details h3 {
        font-size: 18px;
    }
}