/* Variables de couleurs */
:root {
    --primary-green: #2e7d32;
    --light-green: #4caf50;
    --orange: #ff9800;
    --dark-orange: #f57c00;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --dark-gray: #333333;
    --text-gray: #666666;
    --marketplace-bg: #f8f9fa;
    --card-shadow: 0 3px 10px rgba(0,0,0,0.08);
    --card-hover-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--marketplace-bg);
    color: var(--dark-gray);
    line-height: 1.6;
    padding-bottom: 80px; /* Espace pour la navigation du bas */
}

a {
    text-decoration: none;
    color: inherit;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Header avec dégradé de couleurs */
header {
    background: linear-gradient(90deg, var(--primary-green) 0%, var(--white) 50%, var(--orange) 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 5px 0;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
}

.header-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark-gray);
    text-align: center;
}

/* Navigation principale en colonne */
.main-nav {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    margin: 10px 15px;
    padding: 10px 0;
}

.nav-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
}

.nav-column li {
    width: 100%;
}

.nav-column a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--dark-gray);
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 10px;
}

.nav-column a:hover {
    background-color: var(--light-gray);
    transform: translateX(5px);
}

.nav-column a i {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.nav-column a:nth-child(1) i { color: var(--primary-green); }
.nav-column a:nth-child(2) i { color: #ff0000; } /* Rouge pour vidéo */
.nav-column a:nth-child(3) i { color: var(--orange); }

.shortcut {
    position: relative;
}

#notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}

/* Menu Hamburger */
.nm-hamburger-menu {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
}

.nm-hamburger-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 5px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
}

/* Sidebar */
.nm-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background: var(--white);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.nm-sidebar.active {
    left: 0;
}

.nm-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--dark-gray);
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
}

.nm-sidebar ul {
    list-style: none;
    margin-top: 40px;
}

.nm-sidebar li {
    margin-bottom: 10px;
}

.nm-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: var(--dark-gray);
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nm-sidebar a:hover {
    background-color: var(--light-gray);
}

.nm-sidebar i {
    width: 20px;
    text-align: center;
}

/* Barre de recherche */
.search-bar {
    padding: 15px;
    background: var(--white);
    margin: 10px 0;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-input {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.search-input input {
    flex: 1;
    padding: 12px 50px 12px 20px;
    border-radius: 30px;
    border: 1px solid #ddd;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}

.search-input input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

.search-input button {
    position: absolute;
    right: 5px;
    top: 5px;
    background-color: var(--primary-green);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 7px 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-input button:hover {
    background-color: var(--light-green);
}

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Section espace pub */
.espace-pub {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--card-shadow);
}

.espace-pub h2 {
    color: var(--primary-green);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pub {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.pub img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

.pub-details {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 20px;
}

.pub-details h3 {
    margin-bottom: 10px;
}

/* Section résultats utilisateurs */
.users-results {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--card-shadow);
}

.users-results h2 {
    color: var(--primary-green);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-result {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.user-result:last-child {
    border-bottom: none;
}

.user-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.user-result p {
    flex: 1;
}

.user-result a {
    color: var(--primary-green);
    font-weight: 500;
}

.user-result a:hover {
    color: var(--light-green);
}

/* ==========================================================================
   SECTION ANNONCES - MODE 2 COLONNES MARKETPLACE
   ========================================================================== */

.annonces {
    background: transparent;
    padding: 0;
    margin: 20px 0;
    box-shadow: none;
}

.annonces h2 {
    color: var(--primary-green);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 0 15px 0;
    border-bottom: 2px solid var(--light-green);
    font-size: 1.5rem;
    background: var(--white);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

/* Grille Marketplace - 2 colonnes sur mobile */
.annonces-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.annonce-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f1f3f4;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.annonce-card:active {
    transform: scale(0.98);
}

.annonce-image-container {
    width: 100%;
    height: 160px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.annonce-card:hover .annonce-image-container img {
    transform: scale(1.05);
}

.image-placeholder {
    color: white;
    font-size: 2.5rem;
    opacity: 0.8;
}

.online-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    background-color: #4CAF50;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.annonce-info {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.annonce-title {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1rem;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.annonce-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--orange);
    margin-bottom: 8px;
}

.annonce-date {
    font-size: 0.75rem;
    color: #8e9a9d;
    margin-bottom: 12px;
}

.annonce-vendor {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f8f9fa;
}

.vendor-photo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.vendor-name {
    font-size: 0.85rem;
    color: var(--primary-green);
    font-weight: 500;
}

.vendor-name:hover {
    color: var(--light-green);
}

.annonce-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.like-container, .share-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.like-btn, .share-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
    flex: 1;
    justify-content: center;
}

.like-btn:hover, .share-btn:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

.like-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.like-btn.active {
    color: #e74c3c;
}

.like-btn.active i {
    color: #e74c3c;
}

.like-count {
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 0.8rem;
}

.error-message {
    color: #e74c3c;
    font-size: 0.7rem;
    display: none;
}

/* Menu de partage amélioré */
.share-container {
    position: relative;
}

.share-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 12px;
    z-index: 10;
    min-width: 160px;
    border: 1px solid #e9ecef;
    margin-bottom: 8px;
}

.share-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background-color 0.3s;
    color: var(--dark-gray);
    font-size: 0.85rem;
}

.share-menu a:hover {
    background-color: #f8f9fa;
}

.share-menu i {
    width: 16px;
    font-size: 16px;
}

.fa-facebook-f { color: #1877f2; }
.fa-twitter { color: #1da1f2; }
.fa-whatsapp { color: #25d366; }

/* Animation de cœur améliorée */
.heart-animation {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    animation: heartFloat 0.6s ease-out forwards;
    color: #e74c3c;
    font-size: 1.5rem;
}

@keyframes heartFloat {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-40px) scale(1.8);
        opacity: 0;
    }
}

/* Version Desktop pour les annonces */
@media (min-width: 768px) {
    .annonces-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .annonce-image-container {
        height: 180px;
    }
    
    .annonce-info {
        padding: 20px;
    }
    
    .annonce-title {
        font-size: 1.1rem;
    }
    
    .annonce-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--card-hover-shadow);
    }
    
    .like-btn:hover, .share-btn:hover {
        background: #f8f9fa;
        transform: translateY(-2px);
    }
}

@media (min-width: 1024px) {
    .annonces-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
    
    .annonce-image-container {
        height: 200px;
    }
}

/* État vide */
.no-annonces {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    grid-column: 1 / -1;
}

.no-annonces i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 20px;
}

.no-annonces h2 {
    color: #6c757d;
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.no-annonces p {
    color: #8e9a9d;
    font-size: 1rem;
}

/* ==========================================================================
   FIN SECTION ANNONCES MARKETPLACE
   ========================================================================== */

/* Navigation du bas */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    z-index: 100;
}

.bottom-nav-left, .bottom-nav-right {
    display: flex;
    gap: 25px;
}

.nav-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-gray);
    transition: color 0.3s;
    font-size: 12px;
}

.nav-icon:hover {
    color: var(--primary-green);
}

.nav-icon i {
    font-size: 20px;
    margin-bottom: 3px;
}

.publish {
    background: linear-gradient(135deg, var(--primary-green), var(--orange));
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
    transition: transform 0.3s;
}

.publish:hover {
    transform: scale(1.1);
}

/* Footer */
footer {
    background-color: var(--dark-gray);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

footer strong {
    color: var(--orange);
}

/* Badge de notification */
.notification-badge {
    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;
    display: none;
}

/* Responsive général */
@media (max-width: 768px) {
    .header-content {
        gap: 8px;
    }
    
    .header-title {
        font-size: 16px;
    }
    
    .main-nav {
        margin: 8px 10px;
    }
    
    .nav-column a {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .bottom-nav-left, .bottom-nav-right {
        gap: 15px;
    }
    
    .nav-text {
        display: none;
    }
}

@media (max-width: 576px) {
    .nm-sidebar {
        width: 280px;
    }
    
    .search-bar {
        padding: 10px;
    }
    
    .pub img {
        height: 200px;
    }
    
    .bottom-nav {
        padding: 8px 15px;
    }
    
    .bottom-nav-left, .bottom-nav-right {
        gap: 10px;
    }
    
    /* Ajustements pour mobile très petit */
    .annonces-grid {
        gap: 12px;
    }
    
    .annonce-image-container {
        height: 140px;
    }
    
    .annonce-info {
        padding: 12px;
    }
}