/* Google Fonts - Cairo pour l'arabe */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;900&display=swap');

/* Reset w Variables */
:root {
    --primary-color: #d90429;
    /* A7mer chbab */
    --secondary-color: #2b2d42;
    /* Azra9 ghameq */
    --light-color: #edf2f4;
    --dark-color: #1a1a1a;
    --font-family: 'Cairo', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--dark-color);
    color: var(--light-color);
    line-height: 1.6;
}

/* Header & Nav */
header {
    background: var(--secondary-color);
    padding: 1rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--primary-color);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* === التغيير هنا === */
nav .logo {
    color: var(--light-color);
    text-decoration: none;
    font-size: 2rem;
    font-weight: 900;
    display: flex;
    /* Bach yjiw f'satr wahed */
    align-items: center;
    /* Bach ykono f nafs l'mostawa */
}

nav .logo img {
    height: 35px;
    /* Sghart chwiya l'logo */
    margin-left: 10px;
    /* Bch nkhali chwiya faragh */
}

nav .logo span {
    vertical-align: middle;
}

/* === نهاية التغيير === */

nav .nav-links {
    list-style: none;
    display: flex;
}

nav .nav-links li {
    margin-right: 20px;
}

nav .nav-links a {
    color: var(--light-color);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s;
}

nav .nav-links a:hover {
    color: var(--primary-color);
}

.menu-icon {
    display: none;
    color: var(--light-color);
    font-size: 1.8rem;
    cursor: pointer;
}

/* Sections Generales */
section {
    padding: 60px 5%;
    text-align: center;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #ff0033;
}

/* Car Showcase (louer.html & acheter1.html) */
.car-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.car-card {
    background: var(--secondary-color);
    border-radius: 10px;
    overflow: hidden;
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.car-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.car-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 15px;
}

.car-card h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    min-height: 45px;
}

.car-card .description {
    min-height: 70px;
    font-size: 0.95rem;
    flex-grow: 1;
}

.car-card .price {
    font-weight: bold;
    font-size: 1.2rem;
    margin: 15px 0;
}

.car-card .btn {
    width: 100%;
    margin-top: auto;
}

/* --- Styles pour index.html --- */

/* Services Section */
.services-section {
    background: var(--secondary-color);
}

.service-options {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.service-box {
    background: var(--dark-color);
    padding: 40px;
    border-radius: 10px;
    width: 350px;
}

.service-box i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Stats Section */
.stats-section {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    flex-basis: 200px;
    /* Base width for each item */
}

.stat-item i {
    font-size: 3rem;
    color: var(--primary-color);
}

.stat-item h3 {
    font-size: 2.5rem;
    margin: 10px 0;
}

/* Contact Section */
.contact-section {
    background: var(--dark-color);
}

.contact-form {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--secondary-color);
    background: #2b2d42;
    color: var(--light-color);
    border-radius: 5px;
    font-family: var(--font-family);
    font-size: 1rem;
}

.contact-form .btn {
    width: auto;
    /* Let the button size itself */
    align-self: center;
    /* Center the button */
    padding: 12px 40px;
}


/* --- Modal Styles (Tafasil) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: var(--secondary-color);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--primary-color);
    width: 90%;
    max-width: 600px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.4s;
    text-align: right;
}

.modal-content img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

.modal-content h2 {
    color: var(--primary-color);
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.modal-content p {
    margin-bottom: 15px;
}

.modal-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
    text-align: right;
}

.modal-details-grid p {
    background: var(--dark-color);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 0;
}

.modal-details-grid p i {
    margin-left: 10px;
    color: var(--primary-color);
}

.modal-content .price {
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    color: var(--light-color);
}

.modal-content .stock {
    font-size: 1.1rem;
    text-align: center;
    color: #ccc;
}

.close-btn {
    color: #aaa;
    position: absolute;
    left: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.3s, transform 0.3s;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    transform: scale(1.2);
}

/* Footer */
footer {
    background: var(--secondary-color);
    padding: 20px 5%;
    text-align: center;
    border-top: 2px solid var(--primary-color);
}

.social-media {
    margin-bottom: 15px;
}

.social-media a {
    color: var(--light-color);
    font-size: 1.8rem;
    margin: 0 15px;
    transition: color 0.3s;
}

.social-media a:hover {
    color: var(--primary-color);
}


/* Responsive Design (pour les téléphones) */
@media (max-width: 768px) {
    nav .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--secondary-color);
        position: absolute;
        top: 65px;
        /* Adjust based on header height */
        right: 0;
        text-align: center;
        border-top: 1px solid var(--primary-color);
    }

    nav .nav-links.active {
        display: flex;
    }

    nav .nav-links li {
        margin: 15px 0;
    }

    .menu-icon {
        display: block;
    }

    .modal-content {
        width: 95%;
        margin: 15% auto;
        padding: 20px;
    }
}


@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* --- Styles pour la page Login --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    background: var(--secondary-color);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.auth-form h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 2.2rem;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: #888;
}

.auth-form input {
    width: 100%;
    padding: 15px 45px 15px 15px;
    /* Padding ml yassar bach matjich lktiba foug l'icon */
    background: #1e1f2b;
    /* Loun chwiya diferente */
    border: 1px solid #444;
    border-radius: 8px;
    color: var(--light-color);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(217, 4, 41, 0.3);
}

.auth-container .btn {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    margin-top: 10px;
}

.social-login {
    margin: 25px 0;
    border-top: 1px solid #444;
    padding-top: 25px;
}

.social-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.social-btn {
    flex-grow: 1;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: opacity 0.3s;
}

.social-btn:hover {
    opacity: 0.9;
}

.google-btn {
    background-color: #DB4437;
}

.facebook-btn {
    background-color: #4267B2;
}


.form-toggle,
.form-toggle-link {
    margin-top: 20px;
    font-size: 0.95rem;
}

.form-toggle a,
.form-toggle-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

.form-toggle a:hover,
.form-toggle-link a:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-block;
    margin-top: 25px;
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--light-color);
}

/* Style l buton t3 login f la page principale */
.btn-login {
    padding: 8px 20px !important;
    font-size: 1rem !important;
    background: transparent;
    border: 2px solid var(--primary-color);
    transition: all 0.3s;
}

.btn-login:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
}



/* Styling for the Hero Section with a background image */
.hero {
    /* I've added a dark layer (linear-gradient) over the image to make the text readable */
    background-image: linear-gradient(rgba(43, 45, 66, 0.8), rgba(26, 26, 26, 0.8)), url('https://images.unsplash.com/photo-1517524206127-48bbd363f357?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;      /* Ensures the image covers the whole area */
    background-position: center; /* Centers the image */
    background-repeat: no-repeat;
    min-height: 90vh;            /* Makes the section nice and tall */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff; /* Ensures text is white */
}

/* Add a shadow to the text to make it stand out from the image */
.hero h1 {
    font-size: 3.8rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

.hero p {
    font-size: 1.6rem;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
}


/* --- Sticky Header Styles --- */

/* This makes the header stick to the top */
header {
    position: -webkit-sticky; /* For Safari */
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.4s ease, box-shadow 0.4s ease; /* Smooth transition */
}

/* This is a new style that we will add with JavaScript when the user scrolls */
/* It gives the header a background and a shadow to distinguish it from the page content */
header.scrolled {
    background-color: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Make sure the main content starts below the header */
/* We need to adjust the padding-top for sections that are at the very top of the page */
.hero, .car-showcase, .static-page-container, .booking-section {
    padding-top: 120px; /* Adjust this value based on your header's height */
}

/* --- Back to Top Button Styles --- */

.back-to-top-btn {
    position: fixed; /* This makes it float over the content */
    bottom: 25px;
    right: 25px;
    z-index: 999; /* To make sure it's above other elements */
    
    background-color: var(--primary-color);
    color: var(--light-color);
    border: none;
    border-radius: 50%; /* Makes it a circle */
    width: 50px;       /* Set width */
    height: 50px;      /* Set height */
    
    display: flex; /* This is to center the icon inside the button */
    align-items: center;
    justify-content: center;
    
    font-size: 1.2rem;
    text-decoration: none;
    
    opacity: 0; /* Hidden by default */
    visibility: hidden; /* Also hidden from screen readers initially */
    transform: translateY(20px); /* Start slightly lower for a nice effect */
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}

.back-to-top-btn:hover {
    background-color: #ff0033; /* Darker red on hover */
    transform: translateY(-5px); /* Move up slightly on hover */
}

/* This class will be added by JavaScript to show the button */
.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* Return to its original position */
}
/* --- Modal Gallery & Enhanced Details Styles --- */

.modal-gallery {
    margin-bottom: 20px;
}

.modal-main-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    border: 3px solid var(--primary-color);
}

.modal-thumbnails {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.modal-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s, transform 0.3s;
}

.modal-thumb:hover {
    transform: scale(1.05);
}

.modal-thumb.active {
    border-color: var(--primary-color);
}

.modal-specs-container, .modal-features-container {
    background-color: var(--dark-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: right;
}

.modal-specs-container h4, .modal-features-container h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

#modal-features-list {
    list-style: none;
    padding: 0;
    columns: 2; /* Display features in two columns if space allows */
}

#modal-features-list li {
    padding: 5px 0;
}

#modal-features-list li::before {
    content: '\f00c'; /* Font Awesome check icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color);
    margin-left: 10px;
}

.modal-purchase-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--dark-color);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}
/* --- Filter Container Styles --- */

.filter-container {
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
    text-align: right;
}

.filter-group label {
    font-weight: bold;
    color: var(--light-color);
}

.filter-group input[type="text"],
.filter-group select {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #444;
    background-color: var(--dark-color);
    color: var(--light-color);
    font-family: var(--font-family);
}

.filter-group input[type="range"] {
    cursor: pointer;
}
/* --- Testimonials Section Styles --- */

.testimonials-section {
    background-color: var(--dark-color);
    padding-top: 60px;
    padding-bottom: 60px;
}

.testimonials-section h2 {
    text-align: center;
    margin-bottom: 40px;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.testimonial-card {
    background-color: var(--secondary-color);
    border-radius: 10px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid #444;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.testimonial-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    margin-bottom: 15px;
    object-fit: cover;
}

.testimonial-text {
    font-style: italic;
    color: #ccc;
    line-height: 1.7;
    flex-grow: 1; /* Ensures all cards have same height in a row */
}

.testimonial-name {
    margin-top: 20px;
    font-weight: bold;
    color: var(--light-color);
}

.testimonial-rating {
    margin-top: 5px;
    color: #f39c12; /* Gold color for stars */
}