/* Modern Community Design - Remplace l'ancien post-card.css */

/* ===== VARIABLES CSS ===== */
:root {
    --primary-green: #5de519;
    --secondary-green: #79ee3f;
    --dark-green: #121b0e;
    --medium-green: #67974e;
    --light-green: #ebf3e7;
    --very-light-green: #f9fcf8;
    --border-green: #d7e7d0;
    --hover-green: #6adf35;
}

/* ===== RESET ET BASE ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: "Work Sans", "Noto Sans", sans-serif;
    margin: 0;
    padding: 0;
}

/* ===== LAYOUT PRINCIPAL ===== */
.layout-container {
    min-height: 100vh;
}

.layout-content-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== HEADER ET NAVIGATION ===== */
header {
    background: white;
    border-bottom: 1px solid var(--light-green);
}

.nav-tab {
    transition: all 0.3s ease;
    position: relative;
}

.nav-tab:hover {
    color: var(--dark-green);
    transform: translateY(-1px);
}

.nav-tab.active {
    border-bottom-color: var(--secondary-green);
    color: var(--dark-green);
}

/* ===== BARRE DE RECHERCHE ===== */
.search-input {
    transition: all 0.3s ease;
}

.search-input:focus {
    box-shadow: 0 0 0 3px rgba(121, 238, 63, 0.1);
}

/* ===== CARTES DE POSTS FITMEAL ===== */
.post-card-fitmeal {
    transition: all 0.2s ease;
    background: transparent;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.post-card-fitmeal:hover {
    transform: translateY(-1px);
}

.post-card-fitmeal .aspect-video {
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0.75rem;
}

/* Style pour les publications sans image */
.post-card-fitmeal:not(:has(.aspect-video)) .flex-col {
    align-items: stretch;
}

.post-card-fitmeal:not(:has(.aspect-video)) .flex-col>div:first-child {
    padding-left: 0;
    padding-right: 0;
}

/* ===== CARTES D'ÉVÉNEMENTS FITFUEL ===== */
.event-card-fitfuel {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--light-green);
    background: white;
    overflow: hidden;
}

.event-card-fitfuel:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--border-green);
}

.event-card-fitfuel .aspect-video {
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0.75rem;
}

/* ===== ACTIONS SOCIALES ===== */
.post-card-fitmeal .flex-wrap>div,
.event-card-fitfuel .flex-wrap>div {
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: 0.5rem;
}

.post-card-fitmeal .flex-wrap>div:hover,
.event-card-fitfuel .flex-wrap>div:hover {
    background-color: var(--very-light-green);
    transform: scale(1.05);
}

/* ===== BOUTONS ===== */
.create-post-btn {
    transition: all 0.3s ease;
    cursor: pointer;
}

.create-post-btn:hover {
    background-color: var(--border-green);
    transform: translateY(-1px);
}

/* ===== FORMULAIRES ===== */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(121, 238, 63, 0.1);
    border-color: var(--secondary-green);
}

/* ===== SIDEBAR DROITE ===== */
.layout-content-container:last-child {
    position: sticky;
    top: 1.5rem;
    height: fit-content;
}

/* ===== SLIDER DE RAYON ===== */
.radius-value {
    font-weight: 500;
    color: var(--dark-green);
}

/* ===== TENDANCES ===== */
.flex-wrap>div {
    transition: all 0.2s ease;
    cursor: pointer;
}

.flex-wrap>div:hover {
    background-color: var(--border-green);
    transform: translateY(-1px);
}

/* ===== PARTENAIRES CERTIFIÉS ===== */
.overflow-visible>div {
    transition: all 0.3s ease;
    cursor: pointer;
}

.overflow-visible>div:hover {
    transform: scale(1.1);
    border-color: var(--secondary-green);
}

/* ===== MODALES ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card-fitmeal,
.event-card-fitfuel {
    animation: slideInUp 0.4s ease-out;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .layout-content-container:last-child {
        display: none;
    }

    .layout-content-container:first-child {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    header {
        padding: 0.75rem 1rem;
    }

    .nav-tab {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }

    .post-card-fitmeal,
    .event-card-fitfuel {
        margin: 0 0.5rem;
        border-radius: 0.75rem;
    }

    .post-card-fitmeal .p-4,
    .event-card-fitfuel .p-4 {
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .layout-container {
        padding: 0 0.5rem;
    }

    .nav-tab {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }

    .create-post-btn {
        height: 2rem;
        padding: 0 0.75rem;
        font-size: 0.75rem;
    }
}

/* ===== ACCESSIBILITÉ ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== FOCUS VISIBLE ===== */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--secondary-green);
    outline-offset: 2px;
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --dark-green: #f9fcf8;
        --very-light-green: #121b0e;
        --light-green: #1a2a15;
        --border-green: #2a3a25;
    }

    .post-card-fitmeal,
    .event-card-fitfuel {
        background: var(--very-light-green);
        border-color: var(--border-green);
    }

    header {
        background: var(--very-light-green);
        border-bottom-color: var(--border-green);
    }
}

/* ===== STYLES POUR LES ACTIONS (LIKES, COMMENTAIRES) ===== */

/* Boutons d'action */
.action-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: #67974e;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.action-btn:hover {
    background-color: rgba(103, 151, 78, 0.1);
}

.action-btn svg {
    margin-right: 6px;
    transition: all 0.2s ease;
}

/* Bouton de like */
.like-btn:hover {
    color: #e53e3e;
}

.like-btn:hover svg {
    stroke: #e53e3e;
    transform: scale(1.1);
}

/* État du bouton de like */
.like-btn.liked {
    color: #e53e3e;
}

.like-btn.liked svg {
    fill: #e53e3e !important;
    stroke: #e53e3e !important;
    animation: heartBeat 0.3s ease-in-out;
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Bouton de commentaire */
.comment-btn:hover {
    color: #3182ce;
}

.comment-btn:hover svg {
    stroke: #3182ce;
    transform: scale(1.1);
}

/* Compteurs */
.like-count,
.comments-count {
    font-weight: 600;
    color: inherit;
    transition: color 0.2s ease;
}

/* ===== STYLES POUR LES COMMENTAIRES ===== */

/* Section des commentaires */
.comments-section {
    border-top: 1px solid #ebf3e7;
    background-color: #f9fcf8;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

/* État caché - géré par JavaScript */
.comments-section.hidden {
    display: none !important;
    opacity: 0;
    transform: translateY(-10px);
}

/* Formulaire de commentaire */
.ajax-comment-form {
    padding: 16px;
    border-bottom: 1px solid #ebf3e7;
}

.ajax-comment-form input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ebf3e7;
    border-radius: 20px;
    background-color: #f9fcf8;
    color: #121b0e;
    font-size: 14px;
    transition: all 0.2s ease;
}

.ajax-comment-form input[type="text"]:focus {
    outline: none;
    border-color: #79ee3f;
    box-shadow: 0 0 0 3px rgba(121, 238, 63, 0.1);
    transform: scale(1.02);
}

.ajax-comment-form button[type="submit"] {
    padding: 8px 16px;
    background-color: #79ee3f;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ajax-comment-form button[type="submit"]:hover {
    background-color: #6adf35;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(121, 238, 63, 0.3);
}

.ajax-comment-form button[type="submit"]:disabled {
    background-color: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Liste des commentaires */
.comments-list {
    max-height: 400px;
    overflow-y: auto;
}

.comment {
    padding: 12px 16px;
    border-bottom: 1px solid #f9fcf8;
    transition: all 0.2s ease;
}

.comment:hover {
    background-color: #f1f5f0;
    transform: translateX(4px);
}

.comment:last-child {
    border-bottom: none;
}

/* Avatar des commentateurs */
.comment .bg-center {
    background-color: #ebf3e7;
    color: #67974e;
    font-weight: bold;
    font-size: 12px;
    transition: all 0.2s ease;
}

.comment:hover .bg-center {
    background-color: #d1e7c7;
    transform: scale(1.05);
}

/* Contenu des commentaires */
.comment p {
    margin: 0;
    line-height: 1.4;
}

/* Message "Aucun commentaire" */
.comments-list .text-center {
    padding: 20px;
    color: #67974e;
    font-style: italic;
    text-align: center;
}

/* Bouton de commentaire */
.comment-btn {
    transition: all 0.2s ease;
}

.comment-btn:hover {
    transform: scale(1.05);
}

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

/* ===== STYLES POUR LES RÉPONSES AUX COMMENTAIRES ===== */
.reply-btn {
    transition: all 0.2s ease;
    cursor: pointer;
}

.reply-btn:hover {
    transform: scale(1.05);
}

.reply-form {
    transition: all 0.3s ease;
}

.reply-form.hidden {
    display: none;
}

.reply-form textarea {
    resize: vertical;
    min-height: 32px;
}

.comment-replies {
    border-left: 2px solid #ebf3e7;
    margin-left: 1.5rem;
    padding-left: 1rem;
}

.reply-item {
    transition: all 0.2s ease;
}

.reply-item:hover {
    background-color: #f9fcf8;
    transform: translateX(4px);
}

.delete-comment-btn,
.delete-reply-btn {
    transition: all 0.2s ease;
    cursor: pointer;
}

.delete-comment-btn:hover,
.delete-reply-btn:hover {
    transform: scale(1.05);
}

/* ===== STYLES POUR LES BOUTONS DE PAGINATION DES RÉPONSES ===== */
.show-more-replies-btn,
.hide-more-replies-btn {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
    font-weight: 500;
}

.show-more-replies-btn:hover,
.hide-more-replies-btn:hover {
    background-color: #ebf3e7 !important;
    border-color: #67974e;
    transform: translateY(-1px);
}

.show-more-replies-btn:active,
.hide-more-replies-btn:active {
    transform: translateY(0);
}

/* ===== ANIMATIONS POUR LES RÉPONSES SUPPLÉMENTAIRES ===== */
.more-replies {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0);
    max-height: 1000px;
    overflow: hidden;
}

.more-replies.hidden {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    margin: 0;
    padding: 0;
}

/* ===== AMÉLIORATIONS RESPONSIVES ===== */
@media (max-width: 768px) {
    .comment-replies {
        margin-left: 1rem;
        padding-left: 0.75rem;
    }

    .reply-form textarea {
        font-size: 0.875rem;
    }

    .show-more-replies-btn,
    .hide-more-replies-btn {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
}

/* ===== STYLES POUR LA MODAL DE CRÉATION DE POST ===== */
#createPostModal {
    animation: fadeIn 0.3s ease-out;
}

#createPostModal.show {
    display: flex !important;
}

/* Types de publication */
.post-type-option {
    cursor: pointer;
}

.post-type-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background-color: #f9fcf8;
    border: 2px solid #e8f0e3;
    border-radius: 1rem;
    transition: all 0.2s ease;
    text-align: center;
}

.post-type-badge svg {
    color: #6b8a5a;
    width: 1.5rem;
    height: 1.5rem;
}

.post-type-badge span {
    font-size: 0.875rem;
    font-weight: 500;
    color: #2d3a2a;
}

.post-type-option input:checked+.post-type-badge {
    background-color: #e8f0e3;
    border-color: #6b8a5a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 138, 90, 0.15);
}

.post-type-option:hover .post-type-badge {
    border-color: #6b8a5a;
    transform: translateY(-1px);
}

/* Boutons de média */
.media-upload-btn {
    transition: all 0.2s ease;
}

.media-upload-btn:hover {
    transform: translateY(-1px);
}

/* Prévisualisation des médias */
#media-preview {
    max-height: 200px;
    overflow-y: auto;
}

.media-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: #f9fcf8;
    border: 2px solid #e8f0e3;
}

.media-preview-item img,
.media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-preview-item .remove-media {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    background-color: rgba(239, 68, 68, 0.9);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.media-preview-item .remove-media:hover {
    background-color: rgb(239, 68, 68);
    transform: scale(1.1);
}

/* Animation d'entrée */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive pour la modal */
@media (max-width: 768px) {
    #createPostModal .max-w-4xl {
        max-width: 95vw;
        margin: 0.5rem;
    }

    #createPostModal .p-6 {
        padding: 1rem;
    }

    .post-type-badge {
        padding: 0.75rem;
    }

    .post-type-badge span {
        font-size: 0.75rem;
    }
}

/* ===== STYLES POUR LA MODAL D'ÉVÉNEMENT ===== */
#createEventModal {
    animation: fadeIn 0.3s ease-out;
}

#createEventModal.show {
    display: flex !important;
}

/* Indicateur d'étapes */
.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.step-indicator.active div {
    background-color: #6b8a5a;
    color: white;
    transform: scale(1.1);
}

.step-indicator:not(.active) div {
    background-color: #e8f0e3;
    color: #6b8a5a;
}

.step-indicator span {
    transition: all 0.3s ease;
}

.step-indicator.active span {
    color: #6b8a5a;
    font-weight: 600;
}

/* Contenu des étapes */
.step-content {
    display: none;
    animation: slideIn 0.3s ease-out;
}

.step-content.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Zone de drop des médias */
#media-drop-zone {
    cursor: pointer;
    transition: all 0.3s ease;
}

#media-drop-zone:hover {
    background-color: rgba(107, 138, 90, 0.05);
}

#media-drop-zone.dragover {
    border-color: #6b8a5a;
    background-color: rgba(107, 138, 90, 0.1);
}

/* Aperçu des médias */
#media-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #e8f0e3;
    transition: all 0.3s ease;
}

#media-preview img:hover {
    transform: scale(1.05);
    border-color: #6b8a5a;
}

/* Responsive pour la modal d'événement */
@media (max-width: 768px) {
    #createEventModal .max-w-5xl {
        max-width: 95vw;
        margin: 0.5rem;
    }

    #createEventModal .p-6 {
        padding: 1rem;
    }

    .step-indicator {
        gap: 0.25rem;
    }

    .step-indicator div {
        width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }

    .step-indicator span {
        font-size: 0.625rem;
    }
}