html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: url('../image/bg_website.png') no-repeat center center fixed;
    background-size: cover;
}

main {
    flex: 1; /* pushes footer to bottom when content is short */
}

footer {
    background-color: #555; /* keep your existing footer style */
    color: white;
}
/* Container with big white background */
.all-container {
    max-width: 1200px;
    margin: 40px auto;
    background: #fff;
    padding: 0 30px 40px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    font-family: Arial, sans-serif;
}

/* Red filter container inside white container */
.filter-container {
    background-color: #c0392b; /* red */
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    width: calc(100% + 60px);  /* 30px left + 30px right padding of parent */
    margin-left: -30px;
    margin-right: -30px;
    box-sizing: border-box;
}

/* Grid layout for the filters */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto;
    gap: 15px 15px;
    align-items: center;
}

/* Title spans all 3 columns */
.filter-grid h2 {
    grid-column: 1 / 4;
    margin-bottom: 10px;
    color: white;
}

/* Row 1 */
.filter-select.condition {
    grid-column: 1 / 2;
}

.filter-select.brand {
    grid-column: 2 / 3;
}

/* Row 2 */
.filter-select.type {
    grid-column: 1 / 2;
}

.filter-select.year {
    grid-column: 2 / 3;
}

.search-btn {
    grid-column: 3 / 4;
    height: 38px;
    font-weight: bold;
    color: white;
    background-color: #2980b9;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: #1f618d;
}

/* Row 3 */
.filter-select.engine-select {
    grid-column: 1 / 2;
}

.search-field {
    grid-column: 2 / 3;
    height: 38px;
    border-radius: 6px;
    border: none;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    width: 100%;
}

.filter-btn {
    grid-column: 3 / 4;
    height: 38px;
    font-weight: bold;
    color: white;
    background-color: #34495e;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.filter-btn:hover {
    background-color: #2c3e50;
}

/* All selects share styling */
.filter-select {
    height: 38px;
    font-size: 14px;
    border-radius: 6px;
    border: none;
    padding: 0 12px;
    box-sizing: border-box;
    outline: none;
    width: 100%;
}

/* Results grid: 4 cards per row */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

/* Card styling */
.card {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
}

/* Make the image square */
.card img {
    width: 100%;
    aspect-ratio: 1 / 1; /* Ensures perfect square */
    object-fit: cover;
    border-bottom: 1px solid #ccc;
}

/* Adjust text spacing */
.card h3 {
    margin: 10px 15px 5px 15px;
    font-size: 18px;
}

.card p {
    margin: 0 15px 10px 15px;
    font-size: 14px;
    color: #555;
}

.card a {
    margin: 10px 15px 15px 15px;
    text-align: center;
    padding: 8px 0;
    background-color: #2980b9;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.card a:hover {
    background-color: #1f618d;
}





.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin: 20px 0;
    font-family: Arial, sans-serif;
}

.pagination button {
    padding: 12px 20px;
    min-width: 48px;
    border: 2px solid black;
    background-color: black;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    user-select: none;
    box-sizing: border-box;
}

.pagination button:hover:not(:disabled):not(.current-page) {
    background-color: white;
    color: black;
}

.pagination button:disabled {
    border-color: #555;
    color: #555;
    cursor: default;
    background-color: #ddd;
}

.pagination .current-page {
    background-color: red;
    color: white;
    cursor: default;
}

