/* =====================================
   TIMELINE - Apple-Inspired Minimalist Design
   ===================================== */

:root {
    /* Apple-inspired color palette */
    --primary: #007aff;
    --primary-dark: #0056b3;
    --accent: #34c759;
    --warning: #ff9500;
    --error: #ff3b30;
    
    /* Neutral palette */
    --white: #ffffff;
    --gray-50: #f9f9f9;
    --gray-100: #f5f5f7;
    --gray-200: #e5e5e7;
    --gray-300: #d2d2d7;
    --gray-400: #a1a1a6;
    --gray-500: #86868b;
    --gray-600: #6e6e73;
    --gray-700: #515154;
    --gray-800: #1d1d1f;
    --gray-900: #000000;
    
    /* Typography */
    --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 50%;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Timeline Container */
.timeline {
    position: relative;
    padding: 0;
    max-width: 100%;
    margin: 0px auto 0;
    font-family: var(--font-family);
}

/* Timeline Line - centered */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #007aff 0%, #0056b3 100%);
    opacity: 0.8;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.3);
}


/* Timeline Item - Base */
.timeline-item {
    position: relative;
    margin-bottom: 0;
    width: 100%;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

/* Timeline Item Left */
.timeline-item.timeline-left {
    text-align: right;
    padding-right: calc(50% + 60px);
    padding-left: 0;
}

.timeline-item.timeline-left .timeline-content {
    margin-right: 0;
}

.timeline-item.timeline-left .timeline-date {
    right: calc(50% - 40px);
}

/* Timeline Item Right */
.timeline-item.timeline-right {
    text-align: left;
    padding-left: calc(50% + 60px);
    padding-right: 0;
}

.timeline-item.timeline-right .timeline-content {
    margin-left: 0;
}

.timeline-item.timeline-right .timeline-date {
    left: calc(50% - 40px);
}

/* Override positioning for context timeline */
.context-timeline .timeline-item.timeline-left .timeline-date,
.context-timeline .timeline-item.timeline-right .timeline-date {
    left: auto;
    right: auto;
    position: relative;
}

/* Date Badge positioning for left/right items */
.timeline-item.timeline-left .timeline-date-badge {
    left: var(--spacing-md);
    right: auto;
}

.timeline-item.timeline-right .timeline-date-badge {
    right: var(--spacing-md);
    left: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Apple-style Date Circle */
.timeline-date {
    position: absolute;
    top: 0;
    width: 80px;
    height: 80px;
    z-index: 10;
    background: linear-gradient(135deg, #007aff 0%, #0056b3 100%);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-full);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-semibold);
    font-size: 1rem;
    text-align: center;
    line-height: 1.2;
    box-shadow: 
        var(--shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 0 0 0 rgba(0, 122, 255, 0);
    transition: var(--transition-normal);
    z-index: 10;
    backdrop-filter: blur(10px);
}



/* Apple-style Content Card */
.timeline-content {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    border-radius: 18px;
    box-shadow: 
        2px 4px 12px #00000014,
        0 1px 3px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
    padding: 30px;
    padding-bottom: 110px; /* Espace pour les images en bas */
    position: relative;
    transition: all .3s cubic-bezier(0,0,.5,1);
    backdrop-filter: blur(10px);
}
.timeline-content.main{
    padding-top:0px;
}


.timeline-content > * {
    position: relative;
    z-index: 2;
}

/* Date Badge dans le coin en haut à droite - Apple style */
.timeline-date-badge {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: rgba(255, 255, 255, 0.9);
    color: var(--gray-800);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.04);
    z-index: 3;
    letter-spacing: -0.01em;
    transition: var(--transition-fast);
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition-normal);
}


/* Typography - Apple style */
.timeline-content h5 {
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.timeline-content p {
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
    font-size: 1rem;
    font-weight: var(--font-weight-regular);
}

.timeline-content .text-muted {
    color: var(--gray-500);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    font-weight: var(--font-weight-medium);
}

.timeline-content .text-muted i {
    color: var(--primary);
    font-size: 1rem;
}

/* Clean Theme Badges */
.timeline-content .badge {
    font-size: 0.75rem;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    margin-right: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    border: 1px solid !important;
    transition: var(--transition-fast);
    background: white !important;
    font-family: var(--font-family);
}

/* Wikipedia Section */
.wikipedia-section {
    margin: var(--spacing-lg) 0;
    text-align: center;
}

/* Wikipedia Shimmer */
.wiki-shimmer {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.wiki-shimmer.fade-out {
    opacity: 0;
}

.shimmer-wiki-button {
    width: 120px;
    height: 36.38px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.shimmer-wiki-button::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%);
    animation: shimmerSlide 1.5s infinite;
}

/* Wikipedia Button */
.wiki-button-container {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wiki-button-container.fade-in {
    opacity: 1;
}

.wiki-button {
    background: transparent;
    border: 1px solid transparent;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    transition: var(--transition-normal);
    color: transparent;
    background-image: linear-gradient(135deg, #007aff 0%, #0056b3 100%);
    background-clip: text;
    -webkit-background-clip: text;
    position: relative;
}

.wiki-button::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    background: linear-gradient(135deg, #007aff 0%, #0056b3 100%);
    border-radius: var(--radius-sm);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask-composite: xor;
}

.wiki-button:hover {
    background-image: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
    transform: translateY(-1px);
}

.wiki-button:hover::before {
    background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
}

.wiki-button:active {
    transform: translateY(0);
}

.wiki-button i {
    font-size: 1rem;
    color: #007aff;
    background: linear-gradient(135deg, #007aff 0%, #0056b3 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Wikipedia Modal */
.wikipedia-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.wikipedia-modal.fade-in {
    opacity: 1;
}

.wikipedia-modal.fade-out {
    opacity: 0;
}

.wikipedia-modal.show {
    display: block;
}

.wikipedia-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 600px;
    max-height: 80vh;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.wikipedia-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    background: var(--white);
    color: var(--gray-700);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: var(--transition-normal);
    z-index: 1002;
    font-family: var(--font-family);
}

.wikipedia-modal-close:hover {
    background: var(--error);
    color: var(--white);
    transform: scale(1.1);
    border-color: var(--error);
    box-shadow: var(--shadow-lg);
}

.wikipedia-modal-body {
    padding: var(--spacing-2xl);
    max-height: 80vh;
    overflow-y: auto;
}

.wikipedia-modal-body h3 {
    color: var(--gray-800);
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-lg);
    font-family: var(--font-family);
    letter-spacing: -0.01em;
}

.wikipedia-modal-body #wikiModalExtract {
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: var(--spacing-xl);
    font-size: 1rem;
    font-family: var(--font-family);
}

.wikipedia-actions {
    border-top: 1px solid var(--gray-200);
    padding-top: var(--spacing-lg);
}

.wiki-link-button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, #007aff 0%, #0056b3 100%);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    transition: var(--transition-normal);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.wiki-link-button:hover {
    background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
    text-decoration: none;
    color: white;
}

.wiki-link-button:active {
    transform: translateY(0);
}

.wiki-link-button i {
    font-size: 1.125rem;
}


.timeline-content .badge:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Timeline line à gauche */
    .timeline::before {
        left: 60px;
    }
    
    /* Reset des styles desktop pour timeline-item */
    .timeline-item {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: var(--spacing-2xl);
        text-align: left;
        display: flex;
        align-items: flex-start;
        gap: var(--spacing-lg);
    }
    
    /* Timeline-left et timeline-right: même style sur mobile */
    .timeline-item.timeline-left,
    .timeline-item.timeline-right {
        padding-left: 0;
        padding-right: 0;
        text-align: left;
        display: flex;
        align-items: flex-start;
        gap: var(--spacing-lg);
    }
    
    /* Date à gauche */
    .timeline-date {
        position: relative;
        top: 0;
        left: 0;
        right: auto;
        width: 60px;
        height: 60px;
        font-size: 0.7rem;
        flex-shrink: 0;
        margin-left: var(--spacing-sm);
    }
    
    /* Contenu à droite */
    .timeline-content {
        flex: 1;
        padding: var(--spacing-xl);
        margin-left: 0;
        margin-right: 0;
    }
    
    .timeline-content h5 {
        font-size: 1.25rem;
        margin-right:90px;
    }
    
    /* Période lines sur mobile - enlever le 50% du calcul */
    .periode-line {

    }
}

@media (max-width: 480px) {
    /* Timeline line à gauche pour très petit écran */
    .timeline::before {
        left: calc(50% - 1.5px);
    }
    
    /* Ajustements pour très petit écran */
    .timeline-item {
        gap: var(--spacing-md);
        margin-bottom: 0px;
        padding-bottom:15px;
        padding-top:15px;
        display:inline !important;
    }
    
    /* Date plus petite */
    .timeline-item.timeline-left .timeline-date, .timeline-item.timeline-right .timeline-date {
        left: calc(50% - 32px) !important;
        width: 60px;
        height: 60px;
        font-size: 0.9rem;
        margin-left: 0px;
        margin-bottom: 10px;
        margin-top: 40px;
    }
    
    /* Contenu plus compact */
    .timeline-content {
        padding: var(--spacing-sm);
        z-index:3;
        padding-bottom:90px;
    }
    
    /* Période lines sur mobile - enlever le 50% du calcul */
    .periode-line {

    }

    .timeline-item.timeline-left .timeline-date-badge{
        right: var(--spacing-md);
        left: auto;
    }

    .wikipedia-section{
        margin: var(--spacing-xs) 0;
        margin-bottom:20px;
    }

   .event-description-container .event-description{
        margin-bottom: 0px;
    }

    .timeline-period-base{
        margin-top:50px !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .timeline-item {
        animation: none;
        opacity: 1;
    }
    
    .timeline-date,
    .timeline-content {
        transition: none;
    }
}

/* Focus states */
.timeline-date:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
/* Context modal styles */
.context-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.context-modal.fade-in {
    opacity: 1;
}

.context-modal.fade-out {
    opacity: 0;
}

.context-modal-content {
    background: none;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

.context-modal-close {
    color: rgba(255, 255, 255, 0.8);
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.context-modal-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.context-modal-content h3 {
    color: white;
    font-size: 1.8rem;
    font-weight: var(--font-weight-semibold);
    margin: 20px 0 30px 0;
    text-align: center;
    font-family: var(--font-family);
}


.context-timeline {
    margin-top: 20px;
}

.context-timeline .timeline-item {
    margin-bottom: 2rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.context-timeline .timeline-item.current-event {
    opacity: 1;
}

.context-timeline .timeline-item.current-event .timeline-content h5 {
    color: #007aff;
    font-weight: bold;
}

/* Timeline horizontale dans la popup */
.context-timeline {
    display: flex;
    flex-direction: row;
    gap: 20px;
    overflow-y: hidden;
    padding: 20px 50px 40px 50px;
    align-items: flex-start;
    position: relative;
    scroll-behavior: smooth;
    width: 100%;
    height: 100%;
    flex: 1;
    justify-content: center;
}

.context-timeline::before {
    content: '';
    position: absolute;
    top: 90px; /* Position de la ligne horizontale sous les cercles */
    left: 0; /* Utiliser toute la largeur */
    right: 0; /* Utiliser toute la largeur */
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 10%, 
        var(--primary) 50%, 
        rgba(255, 255, 255, 0.3) 90%, 
        transparent 100%);
    opacity: 0.8;
    z-index: 1;
}

.context-timeline .timeline-item {
    flex: 0 0 auto;
    width: calc(20% - 16px);
    height: auto;
    max-width: 450px;
    margin-bottom: 0;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    text-align: center;
}

.context-timeline .timeline-date {
    position: relative;
    top: 0;
    left: auto;
    right: auto;
    transform: none;
    margin-bottom: 20px;
    z-index: 3;
}

.context-timeline .timeline-content {
    width: auto;
    height: auto;
    padding: 20px;
    padding-bottom: 150px;
    margin-top: 0;
    position: relative;
    z-index: 2;
    text-align: center;
}

.context-timeline .timeline-date-badge {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    margin-bottom: 10px;
    display: inline-block;
}

/* Styles spécifiques pour l'événement actuel dans la timeline horizontale */
.context-timeline .timeline-item.current-event .timeline-date {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 
        0 8px 20px rgba(0, 122, 255, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

/* Tooltips stylés pour les périodes - réutilise la classe timeline-period */
.periode-tooltip {
    position: relative;
}

.periode-line {
    z-index: 1;
}

.periode-line.periode-tooltip {
    z-index: 2;
}

.periode-tooltip-content {
    z-index: 99999 !important;
}

.periode-tooltip:hover {
    z-index: 99998 !important;
}

.periode-tooltip:hover .periode-tooltip-content,
.periode-tooltip:hover .periode-tooltip-content.timeline-period,
.periode-tooltip-content[style*="display: block"],
.periode-tooltip-content.timeline-period[style*="display: block"] {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(-50%) translateX(5px);
    z-index: 99999 !important;
}

/* Style spécifique pour les tooltips - même rendu que l'ancien code qui fonctionnait */
.periode-tooltip-content.timeline-period.timeline-period-base {
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    width: 300px;
    max-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 99999 !important;
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    overflow: visible;
}

/* Flèche du tooltip */
.periode-tooltip-content.timeline-period::after {
    content: '';
    position: absolute;
    left: -11px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid var(--periode-color);
    z-index: 3;
}

/* Styles pour les éléments de période */
.periode-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 11;
}

.periode-content {
    position: relative;
    z-index: 11;
}

h2.periode-title {
    font-size: 1rem;
}

.periode-title {
    margin: 0 0 5px 0;
}

.periode-dates {
    color: #666;
}

.periode-description {
    font-size: 0.9em;
    margin: 8px 0 0 0;
    color: #555;
}

.periode-line-base {
    position: absolute;
    width: 6px;
    cursor: pointer;
}

.periode-line-in-period {
    top: -50px;
    bottom: -50px;
    z-index: 0;
}

.periode-line-in-event {
    top: 0;
    bottom: 0;
}

    .periode-line-in-event{
        left: var(--offset) !important;
    }
    .periode-line-in-period {
        left: var(--offset) !important;
    }
    
    /* Décaler les blocs de période sur mobile */
    .timeline-period {
        margin-left: var(--margin, 0px) !important;
    }
    
    /* Décaler le contenu des événements sur mobile */
    .timeline-content {
        margin-left: var(--content-margin, 0px) !important;
    }
/* Mobile : utiliser l'offset sans 50% */
@media (max-width: 768px) {
    .periode-line-in-event{
        min-height: 530px;
    }
}

.periode-tooltip-base {
    margin: 0;
    padding: 15px;
    border-radius: 8px;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    overflow: visible;
    min-width: 280px;
    max-width: 400px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 99999 !important;
}

.timeline-period-base {
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    position: relative;
    z-index: 100;
    overflow: visible;
}

.timeline-item-base {
    position: relative;
}

.timeline-item {
    z-index: 1000;
}

.hidden-element {
    display: none;
}

.flex-container {
    display: flex;
}

/* Bouton de suppression d'événement - exactement le même style que override-edit-btn */
.override-delete-btn {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #dc3545; /* Rouge pour la suppression */
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.override-delete-btn:hover {
    background: #f8f9fa;
    color: #c82333;
    border-color: #dc3545;
}

/* Visibilité au survol - même logique que override-edit-btn */
.event-title:hover .override-delete-btn,
.event-description:hover .override-delete-btn,
.event-description-container:hover .override-delete-btn {
    opacity: 1;
}

h3.timeline-event-title{
    font-size: 1rem;
}

/* Responsive - même que override-edit-btn */
@media (max-width: 768px) {
    .override-delete-btn {
        opacity: 1;
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Bouton d'ajout d'événement */
.add-event-button {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    z-index: 10;
}

.btn-add-event {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent) 0%, #28a745 100%);
    border: 2px solid white;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition-normal);
    box-shadow: 
        var(--shadow-md),
        0 0 0 0 rgba(52, 199, 89, 0.4);
    font-family: var(--font-family);
}

.btn-add-event:hover {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    transform: scale(1.1);
    box-shadow: 
        var(--shadow-lg),
        0 0 0 4px rgba(52, 199, 89, 0.2);
}

.btn-add-event:active {
    transform: scale(0.95);
}

.btn-add-event i {
    font-size: 1.1rem;
}

/* Responsive adjustments for add button */
@media (max-width: 768px) {
    .add-event-button {
        left: calc(50% + 30px);
        bottom: -25px;
    }
    
    .btn-add-event {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .add-event-button {
        left: calc(50% - 2px);
        bottom: -35px;
    }
    
    .btn-add-event {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    /* Context timeline mobile - vertical layout */
    .context-timeline {
        flex-direction: column;
        padding: 20px;
        gap: 30px;
        justify-content: flex-start;
    }
    
    .context-timeline::before {
        display: none; /* Hide horizontal line */
    }
    
    .context-timeline .timeline-item {
        width: 100%;
        max-width: none;
        flex: none;
        display: block;
    }
    
    .context-timeline .timeline-content {
        text-align: left;
        padding: 15px;
    }
    
    .context-timeline .timeline-date {
        position: absolute;
        left: -60px;
        top: 20px;
        margin-bottom: 0;
        transform: none;
    }
    
    .context-timeline .timeline-date-badge {
        position: relative;
        display: block;
        margin-bottom: 10px;
        text-align: left;
    }
    
    /* Disable context popup link on mobile */
    [data-action="click->event-context#showContext"] {
        pointer-events: none !important;
        cursor: default !important;
    }
}


.modal-dialog{
    --bs-modal-width: 1000px;
}