/**
 * Design moderne et attrayant pour les annonces
 * Cathédrale Saint-Augustin
 */

:root {
    --bleu-fonce: #1a4b8c;
    --bleu-moyen: #2a6ec6;
    --bleu-clair: #e6f0fa;
    --jaune-or: #ffc72c;
    --jaune-or-fonce: #e6b325;
    --texte-noir: #333333;
    --texte-blanc: #ffffff;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 199, 44, 0.4); }
    50% { box-shadow: 0 0 40px rgba(255, 199, 44, 0.7); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ===== BODY & BASE ===== */
* {
    box-sizing: border-box;
}

html {
    margin: 0 !important;
    padding: 0 !important;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    background: rgba(255, 255, 255, 0.95) !important;
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    margin: 0 !important;
    padding: 0 !important;
    color: #333;
    line-height: 1.6;
}

/* Supprimer tout espace au-dessus de la navbar */
body > header:first-child,
body > .navbar:first-child,
body > nav:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Fix Bootstrap qui peut ajouter des marges */
.container,
.container-fluid {
    margin-right: auto;
    margin-left: auto;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '✟';
    position: fixed;
    font-size: 800px;
    color: rgba(26, 75, 140, 0.08) !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

/* ===== CONTAINER ===== */
.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    padding: 2rem 2rem 4rem;
    margin: 200px auto 0;
    animation: fadeInUp 0.8s ease-out;
}

@media (min-width: 1200px) {
    .container {
        max-width: 1320px;
        padding: 2.5rem 2rem 4rem;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
        padding: 3rem 2rem 5rem;
    }
}

/* ===== TITRE PRINCIPAL ===== */
h1 {
    text-align: center;
    color: var(--bleu-fonce);
    margin-bottom: 3rem;
    font-weight: 800;
    font-size: 2.8rem;
    position: relative;
    padding: 2rem 0;
    text-shadow: 
        0 0 20px rgba(255, 199, 44, 0.5),
        0 0 40px rgba(255, 199, 44, 0.3),
        4px 4px 8px rgba(0, 0, 0, 0.3);
    animation: slideInLeft 1s ease-out;
    letter-spacing: 2px;
}

h1::before {
    content: '✟';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4rem;
    color: var(--jaune-or);
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 199, 44, 0.8));
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 5px;
    background: linear-gradient(90deg, transparent 0%, var(--jaune-or) 20%, var(--jaune-or) 80%, transparent 100%);
    border-radius: 10px;
    box-shadow: 0 0 20px var(--jaune-or);
    animation: shimmer 3s linear infinite;
    background-size: 200% 100%;
}

/* ===== ROW ===== */
.row {
    position: relative;
    z-index: 1;
}

/* ===== ANNONCE CONTAINER ===== */
.annonce-container {
    animation: fadeInUp 0.8s ease-out backwards;
    perspective: 1000px;
}

.annonce-container:nth-child(1) { animation-delay: 0.1s; }
.annonce-container:nth-child(2) { animation-delay: 0.2s; }
.annonce-container:nth-child(3) { animation-delay: 0.3s; }
.annonce-container:nth-child(4) { animation-delay: 0.4s; }
.annonce-container:nth-child(5) { animation-delay: 0.5s; }
.annonce-container:nth-child(6) { animation-delay: 0.6s; }

/* ===== ANNONCE CARD ===== */
.annonce-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.annonce-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    transition: left 0.8s ease;
    z-index: 1;
    pointer-events: none;
}

.annonce-card:hover::before {
    left: 100%;
}

.annonce-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--jaune-or) 0%, var(--bleu-moyen) 50%, var(--jaune-or) 100%);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

.annonce-card:hover {
    transform: translateY(-15px) rotateX(5deg) scale(1.03);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25), 0 0 50px rgba(255, 199, 44, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

/* ===== HEADER ===== */
.annonce-header {
    padding: 2rem 1.5rem 1rem;
    position: relative;
    background: linear-gradient(135deg, rgba(230, 240, 250, 0.4) 0%, rgba(255, 255, 255, 0.1) 100%);
    z-index: 2;
}

.annonce-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.annonce-title i {
    font-size: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.annonce-card:hover .annonce-title {
    transform: translateX(10px);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
}

.annonce-card:hover .annonce-title i {
    animation: rotate 1s ease-in-out;
}

/* ===== CONTENT ===== */
.annonce-content {
    padding: 1.5rem;
    flex-grow: 1;
    position: relative;
    z-index: 2;
}

.annonce-text {
    color: var(--texte-noir);
    line-height: 1.7;
    font-size: 0.9rem;
    margin: 0;
    max-height: 200px;
    overflow: hidden;
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.annonce-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.95) 100%);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.annonce-card.expanded .annonce-text {
    max-height: none;
}

.annonce-card.expanded .annonce-text::after {
    opacity: 0;
}

/* ===== META ===== */
.annonce-meta {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 2;
    font-size: 0.85rem;
    font-weight: 500;
}

.annonce-meta i {
    margin-right: 0.5rem;
    animation: pulse 3s ease-in-out infinite;
}

/* ===== PRIORITY BADGE ===== */
.priority-badge {
    padding: 0.35rem 1rem;
    border-radius: 25px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 199, 44, 0.4);
    animation: glow 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.priority-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    animation: shimmer 3s linear infinite;
}

/* ===== NO ANNONCES ===== */
.no-annonces {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 5rem 3rem;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1s ease-out;
}

.no-annonces::before {
    content: '✟';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 200px;
    color: rgba(26, 75, 140, 0.05);
    z-index: 0;
    animation: float 6s ease-in-out infinite;
}

.no-annonces i {
    color: var(--bleu-moyen);
    margin-bottom: 2rem;
    font-size: 4rem;
    animation: bounce 2s ease-in-out infinite;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 10px 20px rgba(42, 110, 198, 0.3));
}

.no-annonces h3 {
    color: var(--bleu-fonce);
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    font-size: 1.7rem;
}

.no-annonces p {
    color: #666;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

/* ===== RESPONSIVE ===== */

/* Tablettes et petits écrans */
@media (max-width: 1199px) {
    .container { 
        margin-top: 110px;
        padding: 2rem 1.5rem 3rem; 
    }
    
    h1 { 
        font-size: 2.4rem;
        padding: 1.5rem 0;
    }
    
    h1::before {
        font-size: 2rem;
    }
    
    .annonce-title { 
        font-size: 1.15rem; 
    }
    
    .annonce-title i {
        font-size: 1.4rem;
    }
    
    .annonce-header {
        padding: 1.5rem 1.2rem 0.8rem;
    }
    
    .annonce-content {
        padding: 1.2rem;
    }
    
    .annonce-text {
        font-size: 0.88rem;
    }
}

@media (max-width: 991px) {
    .container { 
        margin-top: 120px;
        padding: 1.5rem 1rem 2.5rem; 
        max-width: 100%;
    }
    
    h1 { 
        font-size: 2.1rem;
        margin-bottom: 2.5rem;
        padding: 1.2rem 0;
    }
    
    h1::before {
        font-size: 1.8rem;
    }
    
    h1::after {
        width: 150px;
        height: 4px;
    }
    
    .annonce-title { 
        font-size: 1.1rem;
    }
    
    .annonce-title i {
        font-size: 1.35rem;
    }
    
    .annonce-text {
        font-size: 0.87rem;
    }
    
    .annonce-title i {
        font-size: 1.5rem;
    }
    
    .annonce-card {
        margin-bottom: 1.5rem;
    }
    
    .annonce-card:hover {
        transform: translateY(-12px) scale(1.02);
    }
}

/* Tablettes en mode portrait et grands mobiles */
@media (max-width: 768px) {
    .container { 
        margin-top: 140px;
        padding: 1.2rem 1rem 2rem;
    }
    
    h1 { 
        font-size: 1.7rem;
        margin-bottom: 2rem;
        padding: 1rem 0;
        letter-spacing: 1px;
    }
    
    h1::before { 
        font-size: 1.5rem;
        top: -15px;
    }
    
    h1::after {
        width: 120px;
        height: 3px;
    }
    
    .annonce-container {
        margin-bottom: 1rem;
    }
    
    .annonce-card { 
        margin-bottom: 0;
        border-radius: 16px;
    }
    
    .annonce-card:hover { 
        transform: translateY(-10px) scale(1.01);
    }
    
    .annonce-header {
        padding: 1.5rem 1rem 0.8rem;
    }
    
    .annonce-title {
        font-size: 1.05rem;
    }
    
    .annonce-title i {
        font-size: 1.3rem;
    }
    
    .annonce-content {
        padding: 1rem;
    }
    
    .annonce-text {
        font-size: 0.88rem;
        line-height: 1.6;
        max-height: 180px;
    }
    
    .annonce-meta { 
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }
    
    .priority-badge { 
        align-self: flex-start;
        padding: 0.35rem 1rem;
        font-size: 0.7rem;
    }
    
    .no-annonces { 
        padding: 3rem 1.5rem;
        border-radius: 16px;
    }
    
    .no-annonces::before {
        font-size: 150px;
    }
    
    .no-annonces i { 
        font-size: 3rem;
        margin-bottom: 1.5rem;
    }
    
    .no-annonces h3 {
        font-size: 1.3rem;
    }
    
    .no-annonces p {
        font-size: 0.92rem;
    }
}

/* Petits mobiles */
@media (max-width: 576px) {
    .container {
        margin-top: 160px;
        padding: 1rem 0.8rem 1.5rem;
    }
    
    h1 { 
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
        padding: 0.8rem 0;
    }
    
    h1::before {
        font-size: 1.3rem;
        top: -12px;
    }
    
    h1::after {
        width: 100px;
        height: 3px;
    }
    
    .row {
        margin: 0;
    }
    
    .annonce-container {
        padding: 0 0.2rem;
        margin-bottom: 1rem;
    }
    
    .annonce-card {
        border-radius: 14px;
    }
    
    .annonce-card:hover {
        transform: translateY(-8px) scale(1.01);
    }
    
    .annonce-header {
        padding: 1.2rem 0.8rem 0.6rem;
    }
    
    .annonce-title { 
        font-size: 0.98rem;
        gap: 0.6rem;
    }
    
    .annonce-title i {
        font-size: 1.2rem;
    }
    
    .annonce-content {
        padding: 0.8rem;
    }
    
    .annonce-text { 
        font-size: 0.85rem;
        line-height: 1.55;
        max-height: 150px;
    }
    
    .annonce-text::after {
        height: 40px;
    }
    
    .annonce-meta {
        padding: 0.7rem 0.8rem;
        font-size: 0.78rem;
    }
    
    .priority-badge {
        padding: 0.3rem 0.85rem;
        font-size: 0.62rem;
    }
    
    .no-annonces {
        padding: 2rem 1rem;
        border-radius: 14px;
    }
    
    .no-annonces::before {
        font-size: 120px;
    }
    
    .no-annonces i {
        font-size: 2.7rem;
        margin-bottom: 1rem;
    }
    
    .no-annonces h3 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }
    
    .no-annonces p {
        font-size: 0.88rem;
    }
    
    .no-annonces h3 {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }
    
    .no-annonces p {
        font-size: 0.95rem;
    }
}

/* Très petits mobiles */
@media (max-width: 375px) {
    .container {
        margin-top: 180px;
        padding: 0.8rem 0.5rem 1.2rem;
    }
    
    h1 {
        font-size: 1.25rem;
        margin-bottom: 1.2rem;
    }
    
    h1::before {
        font-size: 1.15rem;
    }
    
    .annonce-title {
        font-size: 0.92rem;
    }
    
    .annonce-title i {
        font-size: 1.1rem;
    }
    
    .annonce-text {
        font-size: 0.82rem;
    }
    
    .annonce-meta {
        font-size: 0.75rem;
    }
    
    .priority-badge {
        font-size: 0.6rem;
    }
}

/* Mode paysage sur mobile */
@media (max-width: 900px) and (orientation: landscape) {
    .container {
        margin-top: 100px;
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    h1::before {
        font-size: 1.5rem;
    }
    
    .annonce-card {
        margin-bottom: 1rem;
    }
    
    .annonce-text {
        max-height: 120px;
    }
}

/* Optimisations pour les performances sur mobile */
@media (max-width: 768px) {
    /* Réduire les animations sur mobile pour améliorer les performances */
    .annonce-card::before,
    .annonce-card::after {
        animation: none;
    }
    
    .priority-badge::before {
        animation: none;
    }
    
    /* Simplifier l'effet de hover sur mobile */
    .annonce-card:hover {
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    }
    
    /* Désactiver certaines animations complexes */
    body::before {
        animation: none;
    }
}

/* Support pour les écrans à haute résolution */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .annonce-card {
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }
}

/* ===== GRILLE BOOTSTRAP OVERRIDE ===== */
.row {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

@media (max-width: 768px) {
    .row {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }
}

@media (max-width: 576px) {
    .row {
        --bs-gutter-x: 0.8rem;
        --bs-gutter-y: 0.8rem;
    }
    
    .col-md-6,
    .col-lg-4 {
        padding-left: 0.4rem !important;
        padding-right: 0.4rem !important;
    }
}

/* ===== ACCESSIBILITÉ ===== */
.annonce-card:focus-within {
    outline: 4px solid var(--jaune-or);
    outline-offset: 4px;
}

.annonce-card:focus {
    outline: 4px solid var(--jaune-or);
    outline-offset: 4px;
}

/* Préférence utilisateur pour les animations réduites */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== IMAGES ===== */
.annonce-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.annonce-content img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ===== LISTES ===== */
.annonce-text ul,
.annonce-text ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.annonce-text li {
    margin: 0.5rem 0;
    transition: all 0.3s ease;
}

.annonce-text li:hover {
    transform: translateX(8px);
    color: var(--bleu-moyen);
}

/* ===== PRINT ===== */
@media print {
    body { background: white; }
    body::before, body::after { display: none; }
    .annonce-card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
    .annonce-card:hover { transform: none; }
}
