* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
    text-decoration: none;
    scroll-behavior: smooth;
    list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
}

/* General Styles */
body {
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: #F0F8FF;
    /* Light blue background */
    color: #333333;

}

/* Header */
header {
    background: linear-gradient(to bottom, #001F3F, #003366);
    color: white;
    z-index: 1000;
    position: fixed;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Menu */
.menu-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
    font-size: 16px;
    margin-right: auto;
}

.brand-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Logo */
.brand-logo img {
    height: 60px;
    width: auto;
}

/* Address */
.brand-address {
    text-align: right;
    font-size: 16px;
    line-height: 1.4;
}

.brand-address a {
    color: inherit;
    text-decoration: none;
}

.brand-address a:hover {
    text-decoration: underline;
}

/* Dropdown menu styling */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: -250px;
    width: 250px;
    height: calc(100vh - 80px);
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transition: left 0.3s ease;
    z-index: 999;
}

.dropdown-menu li {
    border-bottom: 1px solid #ccc;
}

.dropdown-menu li:last-child {
    border-bottom: none;
}

/* Menu items styling */
.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #001F3F;
    text-decoration: none;
}

.dropdown-menu a:hover {
    background: linear-gradient(to top, #001F3F, #003366);
    color: white;
}

/* Show menu */
.dropdown-menu.show {
    left: 0;
}

main {
    flex: 1;
    background-color: #f0f8ff;
    color: #333333;
    padding-top: 80px;
}

/* Landing Page Styles */
.landing {
    text-align: center;
}

.landing img {
    width: 50vw;
    height: 50vh;
    box-shadow: 0 0 20px 5px rgba(0, 0, 0, 0.5);
    /* Shadow over the whole photo */
    border-radius: 8px;
    /* Optional: Add rounded corners */
    margin-top: 5px;
}

.inventory-btn,
.view-btn,
.button {
    display: inline-block;
    margin: 10px 0;
    padding: 10px 20px;
    background-color: #ffd700;
    color: #001F3F;
    border: none;
    border-radius: 9px;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.2s;
}

.inventory-btn:hover,
.view-btn:hover,
.button:hover {
    background-color: #FFA500;
    transform: translateY(-2px);
}

.featured {
    padding: 60px 20px;
    max-width: 1200px;
    margin: auto;
    text-align: center;
}

.featured h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #001F3F;
    font-family: 'Montserrat', sans-serif;
}

.featured-vehicles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.featured-car {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    padding-bottom: 15px;
}

.featured-car:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px 8px rgba(0, 0, 0, 0.15);
}

.featured-car img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 2px solid #f0f0f0;
}

.featured-car h3 {
    margin: 15px 0 5px;
    color: #001F3F;
    font-size: 1.3em;
    font-family: 'Montserrat', sans-serif;
}

.featured-car .price {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 15px;
}

.featured-car .featured-btn {
    display: inline-block;
    padding: 8px 20px;
    background-color: #001F3F;
    color: #ffd700;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.featured-car .featured-btn:hover {
    background-color: #003366;
    color: white;
}

.featured-car .details {
    color: #666;
    font-size: 0.9em;
    margin: 5px 0 15px;
    padding: 0 15px;
}

.error-message,
.no-featured p {
    color: #666;
    font-style: italic;
    grid-column: 1/-1;
    padding: 20px;
}

iframe {
    width: 100%;
}

/* About Us Styles */
#about.about {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

#about.about h1 {
    text-align: center;
    margin-bottom: 15px;
    margin-top: 15px;
    font-size: 2.5rem;
    color: #333;
}

#about.about .center {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    /* Align items to top */
    gap: 40px;
}

#about.about img {
    width: 45%;
    /* Control image width */
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#about.about p {
    flex: 1;
    /* Take remaining space */
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    text-align: left;
    padding-right: 20px;
}

/* Contact Us Style */
.contact {
    padding: 20px;
}

.contact h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 20px;
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

#contact-form {
    flex: 1;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#contact-form label {
    display: flex;
    flex-direction: column;
    font-weight: bold;
}

#contact-form input,
#contact-form textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

#contact-form textarea {
    resize: vertical;
    min-height: 150px;
}

#contact-form button {
    padding: 10px 20px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
}

#contact-form button:hover {
    background-color: #0056b3;
}

.dealership-info {
    flex: 1;
    max-width: 500px;
    text-align: center;
    margin: 0 auto;
}

.dealership-info img {
    width: 100%;
    height: auto;
    max-height: 35vh;
    object-fit: cover;
    border-radius: 2px;
}

.dealership-address {
    margin: 20px 0;
    font-style: normal;
}

.dealership-address a {
    text-decoration: none;
    color: inherit;
}

.dealership-address a:hover {
    text-decoration: underline;
}

.contact table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.contact table th,
.contact table td {
    padding: 10px;
    border: 1px solid #ccc;
}

.contact table th {
    background-color: white;
    font-weight: bold;
}

.contact table tr {
    background-color: white;
}

/* Form Styles */
/* Contact Form Styles */
#contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

#contact-form label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 600;
}

#contact-form input,
#contact-form textarea {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

#contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

#contact-form button[type="submit"] {
    background-color: #007BFF;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

#contact-form button[type="submit"]:hover {
    background-color: #0056b3;
}

#contact-form button[type="submit"]:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

/* Success Message */
#form-success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    text-align: center;
    max-width: 600px;
    box-sizing: border-box;
}

#form-success-message.hidden {
    display: none;
}

/* Error Message */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    text-align: center;
}

/* Shared Section Styles */
.cars-for-sale,
.parts-for-sale {
    max-width: 1200px;
    margin: 0 auto;
}

.cars-for-sale h1,
.parts-for-sale h1,
.cars-for-sale p,
.parts-for-sale p {
    text-align: center;
}

/* Filters Section - Shared between Cars and Parts */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: bold;
    margin-bottom: 5px;
}

.filter-group select {
    padding: 5px;
    font-size: 16px;
    cursor: pointer;
}

.filter-button,
.filter-button-parts {
    padding: 8px 16px;
    background-color: #007BFF;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    height: auto;
    align-self: flex-end;
}

.filter-button:hover {
    background-color: #0056b3;
}

/* Listings Grid - Shared between Cars and Parts */
.car-listings,
.part-listings {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Card Styles - Shared between Cars and Parts */
.car-card,
.part-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    background: white(255, 255, 255);
}

.car-card:hover,
.part-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: #777977;
}

.car-card img,
.part-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    border-bottom: 1px solid #ddd;
}

.car-card h2,
.part-card h2 {
    font-size: 20px;
    margin: 10px 0;
}

.car-card .price,
.part-card .price {
    font-size: 18px;
    font-weight: bold;
    color: #007BFF;
}

.car-card .details,
.part-card .details {
    font-size: 14px;
    color: #666;
}

/* Part-specific details */


/* Button container for better alignment */
.car-card .button-container,
.part-card .button-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* Enhanced View Details Button - Matching Edit Button Style */
.car-card .view-details,
.part-card .view-details {
    background-color: #0275d8;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin-top: 15px;
    position: relative;
    overflow: hidden;
}

.car-card .view-details:hover,
.part-card .view-details:hover {
    background-color: #025aa5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.car-card .view-details:active,
.part-card .view-details:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.car-card .view-details::before,
.part-card .view-details::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.car-card .view-details:hover::before,
.part-card .view-details:hover::before {
    left: 100%;
}

.car-card .view-details i,
.part-card .view-details i {
    font-size: 14px;
}

/* Enhanced Edit Button Styles */
.edit-car,
.edit-part {
    background-color: #5cb85c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin: 10px 5px 0 0;
    width: 100px;
    position: relative;
    overflow: hidden;
}

.edit-car:hover,
.edit-part:hover {
    background-color: #4cae4c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.edit-car:active,
.edit-part:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.edit-car::before,
.edit-part::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.edit-car:hover::before,
.edit-part:hover::before {
    left: 100%;
}

.edit-car i,
.edit-part i {
    font-size: 14px;
}

.delete-car,
.delete-part {
    background-color: #d9534f;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100px;
    margin: 10px 0 0 5px;
}

.delete-car:hover,
.delete-part:hover {
    background-color: #c9302c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

body.admin-mode .delete-car,
body.admin-mode .delete-part {
    display: inline-block;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    grid-column: 1 / -1;
}

/* Form and other elements */
#cancel-edit {
    background-color: #f44336;
    margin-left: 10px;
}

#cancel-edit:hover {
    background-color: #d32f2f;
}

.form-notification {
    padding: 12px;
    margin: 10px 0;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
}

.form-notification.success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.form-notification.error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

#submit-button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#submit-button.edit-mode {
    background-color: #2196F3;
}

#submit-button:hover {
    opacity: 0.9;
}

#submit-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Car & Parts Details Page Styles */
.car-details-container,
.part-details-container {
    max-width: 1200px;
    margin: 100px auto 2rem;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    padding: 0 1rem;
}

.car-details-gallery,
.part-details-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Main image container */
.main-image-container {
    width: 100%;
    height: 60vh;
    max-height: 400px;
    min-height: 300px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

.main-image-container img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* Thumbnail container (shows exactly 5 thumbnails) */
.thumbnail-container {
    width: 520px;
    /* 5 thumbnails * 100px + 4 gaps * 5px */
    overflow-x: auto;
    display: flex;
    gap: 5px;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #007bff #f1f1f1;
    min-height: 75px;
    /* Prevent layout shift */
}

/* Placeholder for initial loading */
.thumbnail-placeholder {
    width: 100px;
    height: 75px;
    background-color: #f0f0f0;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Actual thumbnail */
.thumbnail {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.thumbnail:hover {
    transform: scale(1.03);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.thumbnail.active {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3);
}

/* Custom scrollbar */
.thumbnail-container::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.thumbnail-container::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 3px;
}

/* Enhanced Details Layout */
.car-details-info,
.part-details-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.car-details-info h1,
.part-details-info h1 {
    text-align: center;
    color: black;

}

.price-badge {
    background-color: #001F3F;
    color: #FFD700;
    padding: 0rem 0.5rem;
    border-radius: 8px;
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    margin: 0 auto;
    width: fit-content;
}


.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    /* Reduced gap for tighter spacing */
    text-align: center;
}

.icon-and-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spec-item i {
    font-size: 1.2rem;
    color: #001F3F;
}

.spec-label {
    font-size: 0.95rem;
    color: #333;
    font-weight: 600;
    font-family: inherit;
    margin: 0;
}

.spec-value {
    font-size: 1.1rem;
    color: #333;
    margin-top: -0.1rem;
    /* Fine-tune vertical spacing */
}

.car-description {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    line-height: 1.7;
    color: black
}

.part-card .view-details:hover {
    background-color: #003366;
    color: white;
}

body.admin-mode .delete-part {
    display: block;
}

.delete-part:hover {
    background-color: #c82333;
}

/* Loading and Error States */
.part-loading {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

.part-skeleton {
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    height: 350px;
    position: relative;
    animation: pulse 1.5s infinite ease-in-out;
}

.no-results {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px 0;
    color: #666;
    font-size: 1.1rem;
}

.error-message {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px 0;
    color: #dc3545;
    font-size: 1.1rem;
}

/* Show Admin Buttons - Cars & Parts Only */
#show-admin-button-cars,
#show-admin-button-parts {
    padding: 10px 20px;
    background-color: #007BFF;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin: 10px 0;
    transition: background-color 0.3s ease;
    display: inline-block;
}

#show-admin-button-cars:hover,
#show-admin-button-parts:hover {
    background-color: #0056b3;
}

/* Admin Access Containers - Cars & Parts Only */
#admin-access-cars,
#admin-access-parts {
    max-width: 300px;
    margin: auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#admin-access-cars input,
#admin-access-parts input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

#admin-access-cars button,
#admin-access-parts button {
    padding: 10px 20px;
    background-color: #007BFF;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

#admin-access-cars button:hover,
#admin-access-parts button:hover {
    background-color: #0056b3;
}

/* Admin Forms - Cars & Parts Only */
.admin-form-cars,
.admin-form-parts {
    max-width: 500px;
    margin: 10px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.admin-form-cars h2,
.admin-form-parts h2 {
    color: black;
    margin-bottom: 20px;
    text-align: center;
}

.admin-form-cars label,
.admin-form-parts label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 18px;
    color: black;
}

.admin-form-cars input,
.admin-form-parts input,
.admin-form-cars select,
.admin-form-parts select,
.admin-form-cars textarea,
.admin-form-parts textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.admin-form-cars button,
.admin-form-parts button {
    padding: 10px 20px;
    background-color: #007BFF;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.admin-form-cars button:hover,
.admin-form-parts button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* File Input Styles - Shared by both forms */
.file-input-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

/* Custom File Button */
.custom-file-button {
    background-color: #007BFF;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    width: fit-content;
    border: none;
}

.custom-file-button:hover {
    background-color: #0069d9;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.custom-file-button:active {
    transform: translateY(0);
}

/* Files Display Area */
.files-display {
    width: 100%;
    padding: 15px;
    border-radius: 6px;
    background-color: white;
    border: 1px dashed #ced4da;
}

.files-count {
    font-size: 0.95rem;
    color: #495057;
    margin-bottom: 10px;
}

/* File List */
.file-list {
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 8px;
    background-color: #f8f9fa;
}

.file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    font-size: 0.85rem;
    color: #212529;
    border-bottom: 1px solid #e9ecef;
}

.file-list li:last-child {
    border-bottom: none;
}

.file-list li .file-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}

.file-list li .file-size {
    color: #6c757d;
    font-size: 0.8rem;
}

.file-list li .remove-file {
    color: #dc3545;
    cursor: pointer;
    margin-left: 10px;
    font-size: 1rem;
}

/* Existing Images Section */
.existing-images {
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.existing-images h4 {
    margin-top: 0;
    color: #333;
}

.existing-images-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.existing-image-item {
    position: relative;
    width: 100px;
    height: 100px;
}

.existing-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Add to your styles */
.image-preview-item.marked-for-deletion {
    opacity: 0.6;
    position: relative;
}

.image-preview-item.marked-for-deletion::after {
    content: "×";
    position: absolute;
    top: 0;
    right: 0;
    font-size: 24px;
    color: red;
    background: rgba(255, 255, 255, 0.7);
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    border-radius: 50%;
}

.image-mismatch-warning {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px;
    background: #ffeb3b;
    border-left: 5px solid #ff9800;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-width: 300px;
}

.image-mismatch-warning h4 {
    margin-top: 0;
    color: #d32f2f;
}

.image-mismatch-warning button {
    background: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    margin-top: 10px;
}

.sync-error-alert {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ffebee;
    border-left: 5px solid #f44336;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 300px;
}

.sync-error-alert h3 {
    margin-top: 0;
    color: #c62828;
}

.sync-error-alert button {
    background: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 10px;
}

/* Image Previews */
.image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.delete-image-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: red;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.files-count {
    margin: 10px 0;
    font-size: 14px;
    color: #666;
}

.image-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: rgba(220, 53, 69, 0.9);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.image-preview:hover .remove-image {
    opacity: 1;
}

.image-preview-item {
    position: relative;
    display: inline-block;
    margin: 5px;
}

.delete-image-btn,
.remove-new-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.new-image {
    border: 2px dashed #007BFF;
}

.delete-image-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: red;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
}

.marked-for-deletion {
    opacity: 0.5;
    border: 2px solid red;
}


.files-count {
    margin: 10px 0;
    font-size: 0.9em;
    color: #666;
}

/* Footer Styles */
footer {
    background: linear-gradient(to bottom, #001F3F, #003366);
    color: white;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    padding: 10px 0;
}

footer p {
    bottom: 0;
    left: 0;
    height: 5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.socials {
    justify-content: center;
    display: flex;
    gap: 2rem;
}

.socials i {
    color: #FFD700;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
}

.socials i:hover {
    color: #ffa500;
    transform: scale(1.1);
}

.socials i:active {
    transform: scale(0.95);
}

.footer-address {
    display: none;
}

/* Screen Optimization */
/* Large devices (desktops, less than 1280px) */
@media (max-width: 1280px) {
    .featured-vehicles {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .car-details-container,
    .part-details-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .main-image-container {
        height: 400px;
    }

    .thumbnail-container {
        width: 100%;
    }
}

/* Medium devices (tablets, less than 768px) */
@media (max-width: 768px) {

    /* Header adjustments */
    .brand-address {
        font-size: 14px;
        line-height: 1.2;
    }

    /* About section */
    #about.about .center {
        flex-direction: column;
        align-items: center;
    }

    #about.about img {
        width: 100%;
        margin-bottom: 20px;
    }

    /* Featured vehicles */
    .featured-vehicles {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    /* Car/parts listings */
    .car-listings,
    .part-listings {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Contact form */
    .contact-container {
        flex-direction: column;
    }

    #contact-form,
    .dealership-info {
        max-width: 100%;
    }

    /* Footer */
    .socials {
        gap: 1.5rem;
    }

    .price-badge {
        font-size: 1.5rem;
        padding: 0.8rem 1.2rem;
    }

    .details-header h1 {
        font-size: 1.5rem;
    }

    .details-meta {
        flex-direction: column;
        gap: 0.3rem;
        align-items: center;
    }

    .specs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small devices (phones, less than 600px) */
@media (max-width: 600px) {

    /* Header */
    header {
        height: 70px;
        padding: 0 10px;
    }

    .brand-logo {
        left: 50%;
        transform: translateX(-50%);
    }

    .brand-logo img {
        height: 50px;
    }

    .brand-address {
        display: none;
    }

    .dropdown-menu {
        top: 70px;
        height: calc(100vh - 70px);
    }

    .dropdown-menu.show {
        left: 0;
    }

    /* Home/Index Page */
    .landing img {
        width: 90vw;
        height: auto;
        max-height: 35vh;
    }

    /* Featured section */
    .featured {
        padding: 30px 15px;
    }

    .featured h2 {
        font-size: 1.8rem;
    }

    .featured-vehicles,
    .car-listings,
    .part-listings {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* About section */
    .about {
        text-align: center;
        padding: 20px 15px;
    }

    /* Forms */
    .contact form {
        width: 100%;
        padding: 0 15px;
    }

    /* Contact Us */
    .dealership-info img {
        max-height: 25vh;
    }

    .contact table {
        font-size: 14px;
    }

    .contact table th,
    .contact table td {
        padding: 6px;
    }

    /* Footer */
    .footer-address {
        display: block;
        font-size: 14px;
    }

    .socials {
        gap: 1rem;
    }

    .socials i {
        font-size: 1.5rem;
    }

    /* Admin buttons */
    .car-card .button-container,
    .part-card .button-container {
        flex-direction: column;
        gap: 5px;
    }

    .view-details,
    .edit-car,
    .edit-part,
    .delete-car,
    .delete-part {
        width: 100%;
        margin: 5px 0;
    }
}

/* Extra small devices (phones, less than 400px) */
@media (max-width: 400px) {

    /* Car Listings Grid */
    .car-listings {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 10px;
    }

    /* Car Cards */
    .car-card {
        padding: 10px;
        margin-bottom: 15px;
    }

    .car-card img {
        height: 150px;
    }

    .car-card h2 {
        font-size: 18px;
        margin: 8px 0;
    }

    .car-card .price {
        font-size: 16px;
    }

    .car-card .details {
        font-size: 13px;
        margin: 3px 0 10px;
    }

    /* Car Details Page */
    .car-details-container {
        margin: 80px auto 1rem;
        padding: 0 10px;
        grid-template-columns: 1fr;
    }

    .main-image-container {
        height: 250px;
    }

    .thumbnail-container {
        width: 100%;
        justify-content: flex-start;
    }

    .thumbnail {
        width: 80px;
        height: 60px;
    }

    .price-badge {
        font-size: 1.2rem;
        padding: 0.4rem 0.8rem;
    }

    .specs-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 0.8rem;
    }

    /* Car Filters */
    .filters {
        flex-direction: column;
        align-items: stretch;
        padding: 0 10px;
    }

    .filter-group {
        margin-bottom: 8px;
    }

    .filter-group select {
        min-height: 34px;
        /* Ensure consistent height */
        appearance: none;
        /* Remove default styling */
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 8px center;
        background-size: 14px;
        padding-right: 30px;
    }

    .filter-button {
        align-self: stretch;
        margin-top: 5px;
    }

    /* Car Buttons */
    .car-card .button-container {
        flex-direction: column;
        gap: 5px;
    }

    .car-card .view-details,
    .car-card .edit-car,
    .car-card .delete-car {
        width: 100%;
        padding: 8px 10px;
        font-size: 13px;
        margin: 3px 0;
    }

    /* Featured Cars Section */
    .featured-car {
        padding-bottom: 10px;
    }

    .featured-car img {
        height: 150px;
    }

    .featured-car h3 {
        font-size: 1.1em;
        margin: 10px 0 5px;
    }

    .featured-car .price {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .featured-car .featured-btn {
        padding: 6px 15px;
        font-size: 0.9em;
    }

    /* Model dropdown visibility fix */
    #model-filter {
        display: block !important;
        /* Force show model dropdown */
        opacity: 0.5;
        /* Grayed out when no make selected */
        transition: opacity 0.3s ease;
    }

    #model-filter.has-make-selected {
        opacity: 1;
        /* Full visibility when make is selected */
    }

    /* Admin Controls for Cars */
    #show-admin-button-cars {
        width: 100%;
        margin: 5px 0;
    }

    #admin-access-cars {
        width: 90%;
        padding: 15px;
    }

    .admin-form-cars {
        padding: 15px;
    }

    /* Form Elements */
    .admin-form-cars input,
    .admin-form-cars select,
    .admin-form-cars textarea {
        font-size: 14px;
    }

    .file-input-container {
        padding: 10px;
    }

    .custom-file-button {
        padding: 8px 15px;
    }

    .image-preview-item {
        width: 80px;
        height: 80px;
    }

    .main-image-container {
        height: 50vh;
        min-height: 250px;
    }

    .price-badge {
        font-size: 1.3rem;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }
}