/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&display=swap');

:root {
    /* Brand Colors */
    --primary: #2563eb;       /* Royal Blue */
    --primary-dark: #1e40af;
    --accent: #f59e0b;        /* Amber for call-to-actions/price */
    
    /* Neutrals */
    --dark: #0f172a;          /* Slate 900 */
    --text-main: #334155;     /* Slate 700 */
    --text-light: #64748b;    /* Slate 500 */
    --bg-body: #f8fafc;       /* Very light blue-grey */
    --white: #ffffff;
    --border: #e2e8f0;
    
    /* Feedback */
    --danger: #ef4444;
    --success: #10b981;
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    color: var(--dark);
    font-weight: 700;
    line-height: 1.2;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }

/* --- Navbar --- */
header {
    background: var(--dark);
    color: var(--white);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.95); /* Slight transparency */
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    font-family: 'Great Vibes', cursive;
    font-size: 2rem;
    color: var(--white);
    letter-spacing: 1px;
}

header nav a {
    color: #cbd5e1;
    margin-left: 24px;
    font-weight: 500;
    font-size: 0.95rem;
}

header nav a:hover {
    color: var(--white);
}

/* --- Hero Section (New) --- */
.hero {
    background: linear-gradient(rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0.3)), url('./images/index.jpg');
    background-size: cover;
    background-position: center;
    /* object-fit: fill; */
    height: 450px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 0 20px;
    margin-bottom: 40px;
}

.hero h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.2rem;
    color: #cbd5e1;
    max-width: 600px;
    margin-bottom: 2rem;
}

/* --- Layout --- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1;
    width: 100%;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

/* --- Modern Card --- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-img-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover img {
    transform: scale(1.05);
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
}

/* Tags/Badges style for mileage/year */
.specs-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.spec-badge {
    background: #f1f5f9;
    color: var(--text-light);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.price {
    font-size: 1.4rem;
    color: var(--primary);
    font-weight: 800;
    margin-top: auto; /* Pushes price to bottom */
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: var(--primary);
    color: white;
    border-radius: 8px; /* Pill shape looks modern too, try 50px */
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    gap: 8px;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-block { width: 100%; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-outline { 
    background: transparent; 
    border: 2px solid var(--white); 
    color: var(--white);
}
.btn-outline:hover { background: var(--white); color: var(--dark); }

/* --- Details Page Layout (Split) --- */
.detail-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr; /* Image wider than info */
    gap: 40px;
    margin-top: 40px;
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .detail-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
}

/* Slider Overrides */
.slider-container {
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    height: 100%;
    min-height: 400px;
}

.slider-img {
    height: 500px;
    object-fit: contain;
}

/* --- Forms --- */
.form-box {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #f8fafc;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

footer {
    background: var(--dark);
    color: var(--text-light);
    padding: 40px 0;
    margin-top: auto;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* --- Image Slider (Carousel) --- */
.slider-container {
    position: relative;
    max-width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    /* Black background for photos */
}

.slider-img {
    width: 100%;
    height: 500px;
    /* Fixed height for consistency */
    object-fit: contain;
    /* Keeps entire image visible */
    display: block;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    font-size: 1.5rem;
    border-radius: 50%;
    transition: background 0.3s;
    user-select: none;
}

.slider-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

/* --- Error Handling Styles --- */
.input-group input.error,
.form-group input.error,
.form-group textarea.error {
    border-color: var(--danger) !important;
    background-color: #fef2f2 !important; /* Light red bg */
    animation: shake 0.3s ease-in-out;
}

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 5px;
    display: none; /* Hidden by default */
    font-weight: 500;
}

.input-group.error .error-msg,
.form-group.error .error-msg {
    display: block;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

html {
    scroll-behavior: smooth;
}

/* --- Smart Upload Styles --- */
.upload-area {
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-area i {
    font-size: 2.5rem;
    color: #94a3b8;
    margin-bottom: 10px;
}

/* The Preview Grid */
.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.preview-card {
    position: relative;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.preview-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Red "X" button to remove image */
.remove-img-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.9); /* Red */
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.remove-img-btn:hover {
    transform: scale(1.1);
    background: #dc2626;
}