/* Event card styling - Updated to remove title overlay */
.advertisement-card {
    position: relative;
}

.navbar {
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

/* Card styling with warm theme */
.card {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    background-color: var(--background-white);
}

/* Navbar styling */
.navbar {
    background-color: var(--background-gray) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Link colors */
a {
    color: var(--primary-color);
}

a:hover {
    color: var(--primary-hover);
}

/* Badge colors */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-warning {
    background-color: #f59e0b !important;
}

.bg-success {
    background-color: #10b981 !important;
}

.alert {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Modern Design System - Cool Blue/Gray Colors */
:root {
    --primary-color: #10b981;          /* Vert moyen */
    --primary-hover: #059669;          /* Vert foncé */
    --primary-light: #d1fae5;          /* Vert très clair */
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --border-color: #d1d5db;
    --background-white: #ffffff;
    --background-beige: #f8fafc;       /* Fond global pastel gris/bleuté */
    --background-gray: #f1f5f9;        /* Gris pastel clair pour les blocs */
}

/* Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--background-beige) !important;
}

/* Ensure the main container also has beige background */
.container {
    background-color: var(--background-beige);
}

/* Ensure the main content area has beige background */
main {
    background-color: var(--background-beige);
}

h1, h2, h3, h4, h5, h6 {
    color: #374151; /* Gris foncé au lieu de noir */
    font-weight: 600;
}

/* Custom button styles */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

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

.btn-secondary {
    background-color: var(--background-white);
    border-color: var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.btn-secondary:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

/* Form styles */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.form-control {
    border-radius: 8px;
    border-color: var(--border-color);
    font-size: 0.875rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(249, 115, 22, 0.25);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Map layout containment */
.map-container {
    position: relative;
    overflow: hidden; /* Clip Leaflet tiles and controls inside the card */
    border-radius: 4px;
}

/* Ensure Leaflet canvas fills the container and respects rounding */
.leaflet-container {
    width: 100% !important;
    height: 100% !important;
    border-radius: inherit;
}

/* Prevent Bootstrap's img max-width from shrinking Leaflet tiles, avoiding layout glitches */
.leaflet-container img {
    max-width: none !important;
}

/* Clip any overflow at the card level as a safety net */
.card {
    overflow: hidden;
}

/* Réduction des polices pour les annonces */
.announcement-card .card-title {
    font-size: 0.8rem !important;
    line-height: 1.3;
    margin-top: 0.1rem !important; /* Marge minimale au-dessus du titre */
    margin-bottom: 0.1rem !important; /* Marge minimale entre titre et texte */
    color: #374151 !important; /* Gris foncé au lieu de noir */
}

.announcement-card .card-text {
    font-size: 0.75rem !important;
    line-height: 1.3;
}

.announcement-card .author-name {
    font-size: 0.8rem !important;
}

.announcement-card .time-text {
    font-size: 0.7rem !important;
}

.announcement-card .address-text {
    font-size: 0.7rem !important;
}

.announcement-card .interaction-text {
    font-size: 0.7rem !important;
}

/* Compactage des cartes d'annonces */
.announcement-card .card-body {
    padding: 0.75rem !important; /* Réduit de p-4 (1rem) à 0.75rem */
}

.announcement-card .d-flex.justify-content-between.align-items-start {
    margin-bottom: 0.1rem !important; /* Marge minimale entre en-tête et titre */
}

.announcement-card .mb-3 {
    margin-bottom: 0.5rem !important; /* Réduit de mb-3 (1rem) à 0.5rem */
}

.announcement-card .mb-2 {
    margin-bottom: 0 !important; /* Supprime complètement la marge */
}

.announcement-card .card-title {
    margin-bottom: 0.1rem !important; /* Marge minimale entre titre et texte */
}

.announcement-card .pt-3 {
    padding-top: 0.5rem !important; /* Réduit de pt-3 (1rem) à 0.5rem */
}

/* Style harmonisé pour les badges de catégorie */
.category-badge {
    background-color: #ffffff !important;
    color: #f97316 !important;
    border: 1px solid #f97316 !important;
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 12px !important;
}

/* Style pour les badges sur la carte */
.map-popup .badge {
    background-color: #ffffff !important;
    color: #f97316 !important;
    border: 1px solid #f97316 !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 8px !important;
}

/* Alignement de la navbar */
.navbar-brand {
    display: flex !important;
    align-items: center !important;
}

.navbar-nav .nav-link {
    display: flex !important;
    align-items: center !important;
    font-size: 0.875rem !important; /* Réduction de la police des menus */
}

.navbar-brand {
    font-size: 1rem !important; /* Réduction de la police du titre */
}

/* Publicités flottantes - Styles isolés pour éviter les conflits */
.floating-ads-left {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    max-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: opacity 0.3s ease;
    /* Isolation pour éviter les conflits */
    isolation: isolate;
    pointer-events: auto;
}

.floating-ads-left.hidden {
    opacity: 0;
    pointer-events: none;
}

.floating-ad-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    transition: transform 0.2s ease;
    width: 160px;
    height: 300px;
    /* Isolation pour éviter les conflits */
    isolation: isolate;
    position: relative;
}

.floating-ad-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.floating-ad-card:nth-child(2) {
    height: 250px;
}

.ad-header {
    background: #f8f9fa;
    padding: 8px 12px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #6c757d;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    /* Empêcher la propagation des événements */
    pointer-events: none;
}

.floating-ad-placeholder {
    width: 100%;
    height: calc(100% - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 0.7rem;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
    /* Empêcher la propagation des événements */
    pointer-events: none;
}

/* Styles pour les liens de publicité */
.ad-link {
    display: block;
    width: 100%;
    height: 100%;
    /* Isolation pour éviter les conflits */
    isolation: isolate;
    position: relative;
    z-index: 1;
}

.ad-image {
    /* Empêcher la sélection d'image */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.ad-overlay {
    /* Empêcher la sélection de texte */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
