/* ============================================
   CORESYSTEM - COMMENTS.CSS
   ============================================
   Styles pour le module de gestion des commentaires
   Contient les styles pour les commentaires, la modale d'image
   et les formulaires de commentaires
   ============================================ */

/* ============================================
   MODALE D'IMAGE
   ============================================ */

.image-modal-image-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    width: auto;
    height: auto;
    max-width: none;
    overflow: visible;
    flex-shrink: 0;
}

.image-modal-content {
    /* Afficher l'image comme dans un visualiseur d'images (adaptée à l'écran) */
    /* Réduire automatiquement si l'image dépasse l'écran, comme l'aperçu Windows */
    width: auto;
    height: auto;
    /* Limiter la taille pour qu'elle s'adapte à l'écran avec une marge plus grande */
    max-width: calc(100vw - 150px);
    max-height: calc(100vh - 150px);
    /* Réduire proportionnellement si nécessaire, mais ne pas agrandir */
    object-fit: contain;
    /* Désactiver l'agrandissement automatique des images */
    image-rendering: auto;
    /* S'assurer qu'il n'y a pas de transformation ou de zoom */
    transform: none;
    zoom: 1;
    /* Désactiver tout zoom ou scale */
    -ms-zoom: 1;
    -webkit-transform: scale(1);
    /* S'assurer que la taille est calculée correctement */
    box-sizing: border-box;
    border: 2px solid #31b086;
    border-radius: 8px;
    box-shadow: 
        0 0 20px rgba(49, 176, 134, 0.4),
        0 0 40px rgba(116, 157, 145, 0.2),
        inset 0 0 20px rgba(49, 176, 134, 0.1),
        inset 0 0 0 1px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    /* Réduire les effets visuels qui peuvent faire paraître l'image plus grande */
    filter: drop-shadow(0 0 5px rgba(49, 176, 134, 0.2));
    /* S'assurer que l'image n'est pas étirée */
    object-position: center;
    /* Si l'image est plus petite que l'écran, la laisser à sa taille native */
    min-width: 0;
    min-height: 0;
}

/* Style spécifique pour les vidéos dans la modal */
video.image-modal-content {
    width: 1080px;
    max-width: 95vw;
    height: auto;
    max-height: 90vh;
}

/* Boutons de navigation dans la modal */
.image-modal-nav-btn {
    position: fixed; /* Fixé par rapport à l'écran */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid #31b086;
    color: #31b086;
    cursor: pointer;
    width: 75px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 15px;
    font-size: 32px;
    font-weight: bold;
    z-index: 2000001; /* Doit être au-dessus du contenu de la modal */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: 0 0 20px rgba(49, 176, 134, 0.4);
    text-shadow: 0 0 10px rgba(49, 176, 134, 0.8);
}

.image-modal-nav-btn:hover:not(:disabled) {
    background: rgba(49, 176, 134, 0.3);
    color: #31b086;
    box-shadow: 
        0 0 40px rgba(49, 176, 134, 0.9),
        inset 0 0 15px rgba(49, 176, 134, 0.5);
    border-color: #31b086;
    transform: translateY(-50%) scale(1.15);
    text-shadow: 0 0 20px rgba(49, 176, 134, 1);
}

.image-modal-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.image-modal-nav-prev {
    left: 40px;
}

.image-modal-nav-next {
    right: 40px;
}

/* Compteur d'images dans la modal */
.image-modal-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #C5D4E0;
    padding: 8px 15px;
    border-radius: 20px;
    font-family: 'Source Code Pro', monospace;
    font-size: 12px;
    z-index: 100;
    border: 1px solid rgba(49, 176, 134, 0.3);
}

.image-modal-info {
    margin-top: 0;
    padding-top: 0;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    position: relative;
    z-index: 10;
}

.image-modal-date.top-date {
    position: absolute;
    top: -35px;
    right: 0;
    margin-bottom: 0;
    font-size: 24px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #31b086;
    background: none;
    padding: 0;
    border: none;
    backdrop-filter: none;
    pointer-events: none;
    text-shadow: 0 0 12px rgba(49, 176, 134, 0.8);
}

.image-modal-date {
    color: rgba(49, 176, 134, 0.9);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Source Code Pro', monospace;
    margin-bottom: 2px;
    text-shadow: 0 0 10px rgba(49, 176, 134, 0.5);
}

.image-modal-description {
    color: rgba(197, 212, 224, 0.9);
    font-size: 13px;
    font-family: 'Source Code Pro', monospace;
    line-height: 1.5;
    text-shadow: 0 0 5px rgba(49, 176, 134, 0.3);
}

.image-modal-comments-container {
    max-height: none;
    overflow-y: visible;
    padding: 0;
    background: none;
    backdrop-filter: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(49, 176, 134, 0.5) rgba(0, 0, 0, 0.1);
    pointer-events: auto !important;
    position: relative;
    z-index: 0;
}

.image-modal-comments-container h3 {
    color: rgba(49, 176, 134, 0.9);
    text-shadow: 0 0 10px rgba(49, 176, 134, 0.5);
    margin-bottom: 0;
    margin-top: 0;
    padding-bottom: 0;
    padding-top: 0;
    line-height: 1;
}

.image-modal-comments-container::-webkit-scrollbar {
    width: 8px;
}

.image-modal-comments-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.image-modal-comments-container::-webkit-scrollbar-thumb {
    background: rgba(169, 186, 201, 0.5);
    border-radius: 4px;
    transition: background 0.3s;
}

.image-modal-comments-container::-webkit-scrollbar-thumb:hover {
    background: rgba(169, 186, 201, 0.7);
}

.image-comments-container {
    max-height: none;
    overflow-y: visible;
    margin-bottom: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Réduire l'espace du premier commentaire après le titre */
.image-comments-container > .comment:first-child {
    margin-top: 0;
}

.image-comments-container p {
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.image-comment-form-container,
.image-guest-comment-form-container {
    margin-top: 15px;
}

.image-comment-form-container textarea,
.image-guest-comment-form-container textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #749d91;
    border-radius: 4px;
    background: white !important;
    color: #333 !important;
    font-family: Arial, sans-serif;
    margin-bottom: 10px;
    resize: vertical;
}

.image-guest-comment-form-container input {
    width: 100%;
    padding: 10px;
    border: 2px solid #749d91;
    border-radius: 4px;
    background: white !important;
    color: #333 !important;
    font-family: Arial, sans-serif;
    margin-bottom: 10px;
}

.image-comment-form-container .btn,
.image-guest-comment-form-container .btn {
    width: 100%;
    padding: 10px;
    border: 2px solid #31b086;
    border-radius: 4px;
    background: rgba(49, 176, 134, 0.95);
    color: white;
    cursor: pointer;
    font-family: "Source Code Pro", monospace;
    font-weight: 600;
    transition: all 0.3s;
}

.image-comment-form-container .btn:hover,
.image-guest-comment-form-container .btn:hover {
    background: rgba(49, 176, 134, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(49, 176, 134, 0.4);
}

/* ============================================
   COMMENTAIRES
   ============================================ */

.comment {
    background: linear-gradient(135deg, rgba(78, 102, 91, 0.4) 0%, rgba(78, 102, 91, 0.3) 100%);
    border-left: 4px solid #31b086;
    border-right: 1px solid rgba(116, 157, 145, 0.3);
    border-top: 1px solid rgba(116, 157, 145, 0.3);
    border-bottom: 1px solid rgba(116, 157, 145, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    gap: 10px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 10px;
}

.comment-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.comment-author {
    color: #31b086;
    font-weight: 700;
    font-size: 13px;
    font-family: 'Source Code Pro', monospace;
    text-shadow: 0 0 8px rgba(49, 176, 134, 0.4);
}

.comment-date {
    color: #A9BAC9;
    font-size: 11px;
    font-family: 'Source Code Pro', monospace;
}

.comment-guest-badge {
    background: rgba(49, 176, 134, 0.2);
    border: 1px solid #31b086;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    color: #31b086;
    font-family: 'Source Code Pro', monospace;
}

.comment-edited {
    color: #749d91;
    font-size: 10px;
    font-style: italic;
    font-family: 'Source Code Pro', monospace;
}

.comment-content {
    color: #C5D4E0;
    font-size: 14px;
    line-height: 1.6;
    font-family: 'Source Code Pro', monospace;
    word-wrap: break-word;
}

.comment-text {
    margin-bottom: 10px;
    word-wrap: break-word;
}

.comment-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-edit-comment,
.btn-delete-comment {
    padding: 6px 10px;
    background: rgba(116, 157, 145, 0.2);
    border: 1px solid rgba(116, 157, 145, 0.4);
    border-radius: 6px;
    color: #C5D4E0;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    font-family: 'Source Code Pro', monospace;
}

.btn-edit-comment:hover {
    background: rgba(116, 157, 145, 0.3);
    border-color: rgba(116, 157, 145, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(116, 157, 145, 0.3);
}

.btn-delete-comment {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.4);
    color: #ff6b6b;
}

.btn-delete-comment:hover {
    background: rgba(255, 107, 107, 0.3);
    border-color: rgba(255, 107, 107, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.comment-edit-form {
    margin-top: 10px;
}

.comment-edit-textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #749d91;
    border-radius: 4px;
    background: white !important;
    color: #333 !important;
    font-family: Arial, sans-serif;
    margin-bottom: 10px;
    resize: vertical;
}

.comment-edit-buttons {
    display: flex;
    gap: 8px;
}

/* Classe pour cacher les éléments */
.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    color: #A9BAC9;
    padding: 40px;
    font-size: 14px;
    font-family: 'Source Code Pro', monospace;
}



