/* =========================================
   VARIABLES & CONFIGURATION (Inchangé)
   ========================================= */
:root {
    --primary: #0f172a;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --secondary: #f59e0b;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-light: #64748b;
    --danger: #ef4444;
    --success: #10b981;
    --border: #e2e8f0;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

/* =========================================
   RESET & BASE (Inchangé)
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   HEADER & NAVIGATION (ADAPTÉ)
   ========================================= */
header {
    background: rgba(15, 23, 42, 0.9); /* Bleu nuit avec légère transparence */
    backdrop-filter: blur(10px); /* Effet de flou moderne */
    -webkit-backdrop-filter: blur(10px);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    letter-spacing: -1px;
    text-decoration: none;
}

header .logo span { color: var(--secondary); }

nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

nav a {
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: 0.3s;
}

nav a:hover { color: white; }

/* Nouveau bouton de déconnexion */
.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171 !important;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: var(--danger);
    color: white !important;
    transform: scale(1.05);
}

.btn-logout svg {
    width: 20px;
    height: 20px;
}

/* =========================================
   BOUTONS & RESTE DU CSS (Inchangé)
   ========================================= */
.btn-main, .btn-publish, .btn-login {
    background: var(--accent);
    color: white !important;
    padding: 10px 22px;
    border-radius: var(--radius);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn-publish:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* =========================================
   HERO SECTION (Index)
   ========================================= */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto 30px;
}

.search-bar {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    background: white;
    padding: 8px;
    border-radius: 50px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 0 20px;
    font-size: 1rem;
    outline: none;
    border-radius: 50px;
}

.search-bar button {
    border-radius: 50px;
    padding: 12px 30px;
}

/* =========================================
   GRILLE & CARTES (ADS)
   ========================================= */
.section-padding { padding: 60px 0; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.card img, .card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body, .card-content {
    padding: 20px;
    flex-grow: 1;
}

.card-price {
    color: var(--accent);
    font-weight: 800;
    font-size: 1.25rem;
    margin-bottom: 10px;
}

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

.card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

/* =========================================
   AUTHENTIFICATION (Login/Register)
   ========================================= */
.auth-wrapper {
    min-height: calc(100vh - 150px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background: white;
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 10px; }

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    ring: 3px rgba(37, 99, 235, 0.1);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.auth-footer {
    margin-top: 25px;
    text-align: center;
    font-size: 0.9rem;
}

.auth-footer a { color: var(--accent); font-weight: 600; }

/* =========================================
   PAGE DÉTAILS
   ========================================= */
.detail-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    margin: 40px 0;
}

.main-img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.info-box {
    background: white;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--border);
    position: sticky;
    top: 100px;
}

.price-big {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 20px;
}

/* =========================================
   PAGE RECHERCHE (Filtres & Liste)
   ========================================= */
.main-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    padding: 40px 0;
}

.filters {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    height: fit-content;
    box-shadow: var(--shadow);
}

.ad-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ad-item {
    display: flex;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: 0.3s;
}

.ad-item img {
    width: 250px;
    height: 180px;
    object-fit: cover;
}

.ad-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}
/* =========================================
   FOOTER COMPACT
   ========================================= */
footer {
    background: var(--primary); /* */
    color: white;
    padding: 40px 0 20px; /* Padding réduit */
    margin-top: 100px; /* Marge réduite */
    border-top: 3px solid var(--secondary); /* */
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 30px; /* Espacement réduit */
    margin-bottom: 30px;
}

.footer-logo {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: white;
}

.footer-logo span { 
    color: var(--secondary); /* */
}

.footer-links h4 {
    margin-bottom: 15px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: white;
    letter-spacing: 0.5px;
}

.footer-links ul li {
    margin-bottom: 8px; /* Liste plus serrée */
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.9rem;
    transition: 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: #64748b;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
    .footer-about { grid-column: span 2; }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 992px) {
    .detail-grid, .main-container {
        grid-template-columns: 1fr;
    }
    .filters { display: none; } /* On cache les filtres sur mobile ou on les adapte */
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .ad-item { flex-direction: column; }
    .ad-item img { width: 100%; }
    nav { display: none; } /* Menu burger à prévoir idéalement */
}