﻿/* Styling for the vehicle list container */
.vehicle-list {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping of cards to the next line if there are too many */
    justify-content: flex-start; /* Distributes space evenly between cards */
    gap: 20px; /* Reduce horizontal and vertical gaps between cards */
    padding: 20px; /* Adds padding around the entire container */
}

/* Styling for individual vehicle cards */
.vehicle-card {
    background-color: white;
    border-radius: 12px; /* Rounds the corners of the card */
    border: 2px solid #ddd; /* Light gray border */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Keeps the shadow effect */
    width: calc(30% - 10px); /* Adjust width to account for reduced gaps */
    margin-bottom: 20px; /* Maintain vertical spacing */
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column; /* Makes the card's content stack vertically */
    position: relative;
    perspective: 1000px; /* Enable 3D effect for the flip */
}

    .vehicle-card:hover {
        transform: scale(1.05); /* Increase size of the card */
        border-color: #74b62c; /* Change border color to green on hover */
    }

    .vehicle-card h3 {
        text-align: center;
    }

/* This class will handle the flip effect */
.vehicle-card-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d; /* Makes the 3D effect possible */
    position: relative;
}

    /* The flipped state (rotate the card 180 degrees) */
    .vehicle-card-inner.flipped {
        transform: rotateY(180deg);
    }

/* Styling for the front of the card */
.vehicle-card-front {
    backface-visibility: hidden; /* Ensures the back side is not visible when flipped */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

/* Styling for the back of the card */
.vehicle-card-back {
    backface-visibility: hidden; /* Ensures the front side is not visible when flipped */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #f5f5f5; /* Slightly different color for the back */
    display: flex;
    flex-direction: column; /* Stack content vertically */
    justify-content: flex-start; /* Align content at the top */
    align-items: center; /* Align content to the left */
    padding: 20px; /* Add padding around the content */
    transform: rotateY(180deg); /* Initially hide the back by rotating it */
}



    /* Styling for the heading on the back */
    .vehicle-card-back h3 {
        margin-bottom: 15px; /* Add space below the heading */
        font-size: 22px; /* Increase font size for the heading */
        color: #333; /* Dark color for the heading */
    }

    /* Styling for the paragraph elements on the back */
    .vehicle-card-back p {
        margin: 10px 0; /* Vertical margin between each paragraph */
        font-size: 16px; /* Adjust font size for better readability */
        color: #555; /* Slightly lighter text color */
        line-height: 1.5; /* Improve line height for better readability */
    }


/* Vehicle image styling */
.vehicle-card img {
    width: 95%; /* Scale down the image width */
    height: auto; /* Maintain the aspect ratio of the image */
    margin: 0 auto; /* Center the image horizontally within the card */
    display: block; /* Ensure the image is treated as a block element */
    padding-top: 10px; /* Add some padding above the image for spacing */
    border-width: 10px; /* Set the border width */
    border-style: solid; /* Set border style to solid */
    border-image: linear-gradient(to bottom, #a8d638 50%, black 50%) 1; /* Gradient border */
    border-image-slice: 1;
}

/* Container for the price and mileage in the footer */
.footer {
    display: flex;
    justify-content: center; /* To space the price and mileage apart */
    width: 100%;
    padding: 10px 0;
    box-sizing: border-box;
    margin-top: auto;
}


/* Green Footer Block with Price */
.price-footer {
    background-color: #014094;
    color: white;
    padding: 10px; /* Add padding to the price block */
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    width: 60%; /* Green footer takes up 60% of the width */
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

/* Mileage next to the price */
.mileage {
    color: #333; /* Mileage text color */
    font-size: 16px; /* Set the font size for mileage */
    text-align: right; /* Align the mileage text to the right */
    padding: 10px 20px; /* Add padding to the mileage area */
    width: 40%; /* Mileage takes up the remaining 40% */
    box-sizing: border-box; /* Ensure padding doesn't cause overflow */
    font-weight: bold; /* Make mileage bold */
    background-color: white;
    border: 2px solid #014094; /* Add a border between price and mileage */
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}





/* Styling for price and mileage inside the footer */
.price-footer .price,
.price-footer .mileage {
    display: inline-block;
}

/* Optional: add some space between the price and mileage */
.price-footer .mileage {
    margin-left: 20px;
}


/* Create a block arrow to the right of the footer */
.price-footer::after {
    content: "";
    position: absolute;
    top: 0;
    right: -20px; /* Position the triangle at the right edge */
    width: 0;
    height: 0;
    border-top: 0 solid transparent; /* Match the height of the footer */
    border-bottom: 0 solid transparent; /* Match the height of the footer */
    border-left: 20px solid #74b62c; /* Creates the green triangle */
}

/* Keep price and mileage properly aligned in both front and back */
.price-footer, .mileage {
    margin: 0; /* Ensure no extra margin or padding */
}

/* Base CSS here */

/* Mobile - small screens (max-width: 480px) */
@media only screen and (max-width: 480px) {
    .vehicle-list {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 10px;
    }

    .vehicle-card {
        width: 100%;
        margin: 0 auto 20px;
    }

        .vehicle-card h3 {
            font-size: 18px;
        }

        .vehicle-card p {
            font-size: 14px;
        }

    .footer {
        flex-direction: column;
        align-items: center;
    }

    .price-footer,
    .mileage {
        width: 100%;
        border-radius: 0;
        box-sizing: border-box;
        border: none;
        background-color: #74b62c;
        color: white;
        text-align: center;
        padding: 5px;
    }

    .price-footer {
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
    }

    .mileage {
        border-bottom-left-radius: 12px;
        border-bottom-right-radius: 12px;
        margin-top: 5px;
        background-color: white;
        border: 2px solid #74b62c;
        color: #333;
    }
}

/* Tablets - medium screens (481px - 768px) */
@media only screen and (min-width: 481px) and (max-width: 768px) {
    .vehicle-list {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 20px;
    }

    .vehicle-card {
        width: 80%;
        margin: 0 auto 20px;
    }

        .vehicle-card h3 {
            font-size: 20px;
        }

        .vehicle-card p {
            font-size: 16px;
        }

    .footer {
        flex-direction: column;
        align-items: center;
    }

    .price-footer,
    .mileage {
        width: 90%;
        border-radius: 0;
        box-sizing: border-box;
        border: none;
        background-color: #74b62c;
        color: white;
        text-align: center;
        padding: 10px;
    }

    .price-footer {
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
    }

    .mileage {
        border-bottom-left-radius: 12px;
        border-bottom-right-radius: 12px;
        margin-top: 10px;
        background-color: white;
        border: 2px solid #74b62c;
        color: #333;
    }
}

