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

.message-icon {
    position: relative;
    display: inline-block;
    padding: 0.5rem;
    transition: transform 0.3s;
    text-decoration: none;
}
.message-icon:hover { transform: scale(1.1); }
.message-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

:root {
    --primary-color: #00a67e;
    --primary-dark: #008f6b;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --accent-orange: #f39c12;
    --accent-blue: #3498db;
    --accent-green: #2ecc71;
    --light-bg: #f5f5f5;
    --dark-bg: #1a1a2e;
    --text-color: #333;
    --text-light: #666;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 20px rgba(0,0,0,0.15);
    --border-radius: 10px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background: var(--light-bg);
    line-height: 1.6;
}

/* Header & Navigation */
header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.logo span {
    font-size: 0.8rem;
    color: var(--text-light);
    display: block;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-login, .btn-register, .btn-logout {
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
}

.btn-login {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-login:hover {
    background: var(--primary-color);
    color: white;
}

.btn-register {
    background: var(--primary-color);
    color: white;
}

.btn-register:hover {
    background: var(--primary-dark);
}

.btn-logout {
    background: var(--accent-color);
    color: white;
}

.btn-logout:hover {
    background: #c0392b;
}

#userInfo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#userPseudo {
    font-weight: bold;
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background: white;
    color: var(--primary-color);
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 2rem;
    transition: transform 0.3s;
}

.cta-button:hover {
    transform: translateY(-2px);
}

/* Services Section */
.services {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.services h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--secondary-color);
}

.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

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

.card-icon {
    font-size: 4rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.card h3 {
    padding: 1rem;
    font-size: 1.3rem;
}

.card p {
    padding: 0 1rem 1.5rem;
    color: var(--text-light);
}

/* Statistics */
.stats-preview {
    background: var(--secondary-color);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.stats-preview h2 {
    margin-bottom: 2rem;
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Auth Pages */
.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-container {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 450px;
    width: 100%;
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.btn-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: var(--primary-dark);
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Search Section */
.breakdown-search, .search-modes {
    background: var(--white);
    margin: 2rem;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.search-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-filters select,
.search-filters input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    flex: 1;
    min-width: 150px;
}

.search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: var(--primary-dark);
}

.mode-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.mode-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--light-bg);
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s;
}

.mode-chip:hover {
    background: #e0e0e0;
}

.mode-chip input {
    margin: 0;
    cursor: pointer;
}

.search-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-bar input {
    flex: 2;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.search-bar select {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Add Breakdown Section */
.add-breakdown-section {
    background: var(--white);
    margin: 2rem;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.add-breakdown-section h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.add-breakdown-section form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.media-upload {
    margin-top: 0.5rem;
}

.media-upload label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.media-upload small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-light);
    font-size: 0.8rem;
}

/* Cards Grid */
.ads-grid, .breakdowns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.ad-card, .breakdown-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.ad-card:hover, .breakdown-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* Ad Badges */
.ad-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 10;
    box-shadow: var(--shadow);
}

.badge-non-roulant {
    background: var(--accent-color);
    color: white;
}

.badge-reviser {
    background: var(--accent-orange);
    color: white;
}

.badge-bon-etat {
    background: var(--accent-green);
    color: white;
}

.badge-parts {
    background: var(--accent-blue);
    color: white;
}

.ad-images {
    height: 200px;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    font-size: 3rem;
    color: var(--text-light);
}

.ad-info, .breakdown-content {
    padding: 1rem;
}

.ad-info h3, .vehicle-info h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.description {
    color: var(--text-light);
    margin: 0.5rem 0;
    line-height: 1.5;
}

.ad-meta, .breakdown-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: var(--text-light);
}

.view-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 1rem;
    width: 100%;
    transition: background 0.3s;
}

.view-btn:hover {
    background: var(--primary-dark);
}

.vehicle-info {
    background: var(--light-bg);
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.vehicle-info h4 {
    margin-bottom: 0.25rem;
}

.vehicle-type {
    font-size: 0.85rem;
    color: var(--text-light);
}

.breakdown-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.media-gallery img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
}

.breakdown-footer {
    padding: 0.5rem 1rem 1rem;
    margin-top: 0;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 650px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    color: var(--secondary-color);
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
}

.close:hover {
    color: var(--accent-color);
}

.modal-content .form-group {
    padding: 0 1.5rem;
}

.modal-content .submit-btn {
    margin: 1.5rem;
    width: calc(100% - 3rem);
}

/* Add Ad Button */
.add-ad-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background 0.3s;
    margin-left: 2rem;
}

.add-ad-btn:hover {
    background: var(--primary-dark);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        text-align: center;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .auth-buttons {
        justify-content: center;
    }
    
    .stats-grid {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-filters,
    .search-bar {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .hero-content h2 {
        font-size: 1.8rem;
    }
    
    .ads-grid, .breakdowns-grid {
        padding: 1rem;
        gap: 1rem;
    }
    
    .add-breakdown-section,
    .breakdown-search,
    .search-modes {
        margin: 1rem;
    }

}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-header .close {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.modal-header .close:hover {
    color: #e74c3c;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
/* Styles pour les menus déroulants */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 8px;
    overflow: hidden;
}

.dropdown-content a {
    color: #2c3e50;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    transition: background 0.3s;
}

.dropdown-content a:hover {
    background-color: #f5f5f5;
    color: #00a67e;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn {
    color: #00a67e;
}