/* ========================================
   MODAL STYLES - Style Wiki Abrak Complet
   POLICE : ROBOTO
   ======================================== */

/* ========== OVERLAY avec FLOU ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 31, 19, 0.75);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* ========== MODAL CONTENT - Style Wiki ========== */
.modal-content {
    background: #fffdf0;
    border: 3px solid #d4b373;
    border-radius: 12px;
    padding: 0;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow:
            0 20px 60px rgba(0, 0, 0, 0.7),
            0 0 40px rgba(212, 179, 115, 0.3);
    animation: modalSlide 0.3s ease;
    position: relative;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== MODAL HEADER - Style Wiki ========== */
.modal-header {
    background: linear-gradient(135deg, #6b5444, #8b6f47);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #d4af37;
}

.modal-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    font-family: 'Roboto', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 1.8rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

/* ========== MODAL BODY ========== */
.modal-body {
    padding: 30px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
    font-family: 'Roboto', sans-serif;
}

/* ========== FORM STYLES (pour modale d'ajout) ========== */
#eventForm {
    padding: 30px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
    font-family: 'Roboto', sans-serif;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #8b5a2b;
    font-size: 1rem;
    letter-spacing: 0.3px;
    font-family: 'Roboto', sans-serif;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background: rgba(212, 179, 115, 0.08);
    border: 2px solid #d4b373;
    border-radius: 8px;
    color: #3d2e1f;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9a826d;
    opacity: 0.7;
    font-family: 'Roboto', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6b5b95;
    background: rgba(107, 91, 149, 0.05);
    box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.1);
}

/* Style spécifique pour les selects */
.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b5a2b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    font-family: 'Roboto', sans-serif;
}

.form-group select option {
    background: #fffdf0;
    color: #3d2e1f;
    padding: 10px;
    font-family: 'Roboto', sans-serif;
}

/* Style pour les textareas */
.form-group textarea {
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
    font-family: 'Roboto', sans-serif;
}

/* Style pour l'input file */
.form-group input[type="file"] {
    padding: 10px;
    background: rgba(212, 179, 115, 0.08);
    border: 2px dashed #d4b373;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
}

.form-group input[type="file"]:hover {
    border-color: #6b5b95;
    background: rgba(107, 91, 149, 0.05);
}

.form-group input[type="file"]::-webkit-file-upload-button {
    background: linear-gradient(135deg, #6b5b95, #8b7ba8);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 10px;
    font-family: 'Roboto', sans-serif;
}

.form-group input[type="file"]::-webkit-file-upload-button:hover {
    background: linear-gradient(135deg, #8b7ba8, #9b8bb8);
}

/* Prévisualisation image */
#imagePreview {
    margin-top: 10px;
    text-align: center;
}

#previewImg {
    max-width: 200px;
    border-radius: 8px;
    border: 2px solid #d4b373;
}

/* ========== FORM ACTIONS ========== */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #d4b373;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-family: 'Roboto', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #d4af37, #f0c346);
    color: #2d1f13;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #f0c346, #ffd766);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #fffdf0;
    color: #8b5a2b;
    border: 2px solid #d4b373;
}

.btn-secondary:hover {
    background: #d4b373;
    color: #3d2e1f;
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* ========== STYLES POUR MODALE DE DÉTAILS ========== */

/* Image de l'événement */
.event-image-container {
    width: 100%;
    margin-bottom: 25px;
    overflow: hidden;
    border-radius: 12px;
}

.event-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    border: 3px solid #d4b373;
    border-radius: 12px;
    background: #fefaf3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Titre et infos principales */
.event-main-info {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #d4b373;
}

.event-main-title {
    font-size: 1.6rem;
    font-weight: 500;
    color: #8b5a2b;
    margin: 0 0 15px 0;
    font-family: 'Roboto', sans-serif;
}

.event-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.event-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: #5a4031;
    font-family: 'Roboto', sans-serif;
}

.event-meta-icon {
    font-size: 1.2em;
}

.event-meta-label {
    font-weight: 500;
    color: #8b5a2b;
    font-family: 'Roboto', sans-serif;
}

/* Boîtes d'infos */
.event-info-box {
    background: rgba(255, 215, 0, 0.08);
    border: 2px solid #d4b373;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.08);
}

.event-description {
    line-height: 1.7;
    color: #3d2e1f;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
}

.event-description p {
    margin: 10px 0;
}

/* ========== BOUTONS D'ACTION - Modale détails ========== */
.modal-actions {
    padding: 20px 30px;
    border-top: 3px solid #d4b373;
    display: flex;
    gap: 15px;
    justify-content: center;
    background: rgba(212, 179, 115, 0.08);
}

.btn-delete {
    background: linear-gradient(135deg, #c1443d, #b8352f);
    color: white;
    border: 2px solid #a12e28;
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Roboto', sans-serif;
    box-shadow: 0 4px 10px rgba(193, 68, 61, 0.3);
}

.btn-delete:hover {
    background: linear-gradient(135deg, #a13630, #8b2e28);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(193, 68, 61, 0.4);
}

.btn-close-modal {
    background: #fffdf0;
    color: #8b5a2b;
    border: 2px solid #d4b373;
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Roboto', sans-serif;
}

.btn-close-modal:hover {
    background: #d4b373;
    color: #3d2e1f;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(212, 179, 115, 0.4);
}

/* Bouton Modifier */
.btn-edit {
    background: linear-gradient(135deg, #4a7ba7, #5a8bb7);
    color: white;
    border: 2px solid #3a6b97;
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Roboto', sans-serif;
    box-shadow: 0 4px 10px rgba(74, 123, 167, 0.3);
}

.btn-edit:hover {
    background: linear-gradient(135deg, #5a8bb7, #6a9bc7);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(74, 123, 167, 0.4);
}

/* ========== SCROLLBARS ========== */
.modal-body::-webkit-scrollbar,
#eventForm::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track,
#eventForm::-webkit-scrollbar-track {
    background: rgba(212, 179, 115, 0.1);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb,
#eventForm::-webkit-scrollbar-thumb {
    background: #d4b373;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover,
#eventForm::-webkit-scrollbar-thumb:hover {
    background: #c9a03e;
}

/* ========== BOUTON INFO - VERSION SOLIDE ET VISIBLE ========== */
.info-btn {
    /* Layout et taille */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: 10px;
    padding: 0;

    /* Style visuel solide */
    background: linear-gradient(135deg, #4a9eff 0%, #2b7de9 100%);
    border: none;
    border-radius: 50%;

    /* Texte */
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    font-family: 'Arial', sans-serif;
    line-height: 1;

    /* Interactivité */
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;

    /* Ombres */
    box-shadow: 0 3px 10px rgba(42, 125, 233, 0.4);

    /* Position */
    position: relative;
    overflow: visible;
}

.info-btn:hover {
    background: linear-gradient(135deg, #5eabff 0%, #3d8ef5 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(42, 125, 233, 0.5);
}

.info-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(42, 125, 233, 0.4);
}

/* Bouton info inline (dans la modale de détails) */
.info-btn-inline {
    width: 28px;
    height: 28px;
    margin-left: 10px;
    font-size: 18px;
    vertical-align: middle;
}

/* Animation de pulsation bleue */
@keyframes pulseBlue {
    0%, 100% {
        box-shadow:
            0 4px 15px rgba(42, 125, 233, 0.6),
            0 0 20px rgba(74, 158, 255, 0.4),
            inset 0 1px 3px rgba(255, 255, 255, 0.5);
    }
    50% {
        box-shadow:
            0 4px 20px rgba(42, 125, 233, 0.8),
            0 0 30px rgba(74, 158, 255, 0.6),
            inset 0 1px 3px rgba(255, 255, 255, 0.5);
    }
}

/* Animation de ripple bleue */
@keyframes rippleBlue {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Bulle d'information */
.info-tooltip {
    display: none;
    margin-top: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.08));
    border: 2px solid #d4af37;
    border-radius: 8px;
    color: #5a4031;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.2s ease;
}

.info-tooltip.active {
    display: block;
}

/* Bulle d'information inline (dans la modale de détails) - VERSION AMÉLIORÉE */
.info-tooltip-inline {
    position: absolute;
    display: none;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 8px);
    padding: 14px 18px;
    background: linear-gradient(135deg, #fef9e7 0%, #fdeec4 100%);
    border: 3px solid #d4af37;
    border-radius: 10px;
    color: #3d2e1f;
    font-size: 13px;
    line-height: 1.6;
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset,
        0 2px 5px rgba(212, 175, 55, 0.3);
    z-index: 10000;
    width: max-content;
    max-width: 380px;
    white-space: normal;
    font-weight: 500;
    backdrop-filter: blur(8px);
    pointer-events: none;
}

/* Icône dans la bulle - Simple */
.info-tooltip-inline svg,
.info-tooltip svg,
.tooltip-icon svg {
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
    stroke: #d4af37;
}

.info-tooltip-inline.active {
    display: block;
    animation: fadeInOnly 0.2s ease;
}

/* Petite flèche pour la bulle inline - CENTRÉE SOUS LE CHIFFRE */
.info-tooltip-inline::before {
    content: '';
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 11px solid #d4af37;
    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.1));
}

/* Flèche interne (pour l'effet de bordure) - CENTRÉE */
.info-tooltip-inline::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fef9e7;
}

/* Animation simple sans scale pour éviter de bouger le modal */
@keyframes fadeInOnly {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Animation améliorée pour la bulle (non utilisée pour inline) */
@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-body,
    #eventForm {
        padding: 20px;
    }

    .event-meta {
        flex-direction: column;
        gap: 10px;
    }

    .event-image {
        max-width: 180px;
        max-height: 180px;
    }

    .form-actions {
        flex-direction: column;
    }
}