/* Styles spécifiques à la page Contribuer */

.contribuer-panel {
    position: relative;
    width: 100%;
    min-height: 600px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

.contribuer-error-message {
    padding: 1rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    color: #f87171;
    font-family: 'URW Form', sans-serif;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.contribuer-success-message {
    padding: 1rem;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 8px;
    color: #4ade80;
    font-family: 'URW Form', sans-serif;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    display: flex !important;
    align-items: center;
    animation: slideIn 0.3s ease-out;
    position: relative;
    z-index: 10;
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-area {
    flex: 1;
    min-height: 400px;
    margin-bottom: 2rem;
    margin-right: 200px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

/* Template de post */
.post-template {
    width: 100%;
    max-width: 600px;
    padding: 1.5rem;
    border-radius: 16px;
    position: relative;
    z-index: 5;
}

.post-template-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-template-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.post-template-author {
    display: flex;
    flex-direction: column;
}

.post-template-username {
    font-family: 'Brevia', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.post-template-content {
    margin-bottom: 1rem;
}

.post-type-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-content-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-family: 'URW Form', sans-serif;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
}

.post-content-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.post-content-textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.post-content-description {
    min-height: 80px;
    margin-top: 1rem;
}

/* Aperçu du média */
.media-preview {
    width: 100%;
    min-height: 300px;
    border-radius: 12px;
    overflow: visible;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    position: relative;
    z-index: 10;
}

.media-preview.has-media {
    border: none;
    background: transparent;
    padding: 0;
    min-height: auto;
    display: block !important;
    overflow: visible;
    z-index: 10;
}

.media-preview.has-media img,
.media-preview.has-media video {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 12px;
    display: block !important;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
    visibility: visible !important;
    opacity: 1 !important;
}

.media-preview img,
.media-preview video {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

.media-preview.has-media .media-placeholder {
    display: none;
}

.media-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
}

/* Support pour :has() si disponible (fallback) */
.media-preview:has(img),
.media-preview:has(video) {
    border: none;
    background: transparent;
    padding: 0;
    min-height: auto;
    display: block;
    overflow: visible;
    z-index: 10;
}

.media-preview:has(img) .media-placeholder,
.media-preview:has(video) .media-placeholder {
    display: none;
}

.media-placeholder-icon {
    width: 64px;
    height: 64px;
    color: rgba(255, 255, 255, 0.4);
    stroke-width: 1.5;
}

.media-placeholder-text {
    font-family: 'URW Form', sans-serif;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}


/* Boutons d'interaction du template */
.post-template-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.post-action-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'URW Form', sans-serif;
    font-size: 0.875rem;
    cursor: default;
}

.post-action-item .action-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* Right Side Menu - Boutons à droite sur desktop */
.side-menu {
    position: absolute;
    right: 2rem;
    top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 180px;
    z-index: 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 90px;
    color: #fff;
    font-family: 'URW Form', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 2;
}

.menu-label {
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
    flex: 1;
    display: block;
}

.menu-item-media .menu-label {
    text-align: center;
    flex: 1;
}

.menu-item-publish {
    background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
    border: none;
    font-weight: 500;
}

.menu-item-publish:hover {
    background: linear-gradient(135deg, #7C3AED 0%, #9333EA 100%);
    transform: translateY(-1px);
}

/* Mode Orange pour menu-item-publish */
body.mode-orange .menu-item-publish {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%) !important;
}

body.mode-orange .menu-item-publish:hover {
    background: linear-gradient(135deg, #E55A2B 0%, #E6821A 100%) !important;
}


/* Responsive adjustments - Tablet */
@media (max-width: 768px) {
    .contribuer-panel {
        padding: 1.5rem;
        min-height: 500px;
    }

    .content-area {
        margin-right: 0;
        margin-bottom: 80px;
        margin-top: 1rem;
        order: 2;
    }

    /* Boutons en haut sur tablette/mobile */
    .side-menu {
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.875rem;
        margin-bottom: 1.25rem;
        order: 1;
    }

    .menu-item {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 140px;
        font-size: 0.8125rem;
        padding: 0.75rem 0.875rem;
    }

    .menu-icon {
        width: 18px;
        height: 18px;
    }

}

/* Responsive adjustments - Mobile */
@media (max-width: 480px) {
    .contribuer-panel {
        padding: 1rem;
    }

    .content-area {
        margin-bottom: 70px;
        min-height: 300px;
        margin-top: 0.75rem;
        order: 2;
    }

    /* Boutons en haut sur mobile */
    .side-menu {
        gap: 0.75rem;
        margin-bottom: 1rem;
        order: 1;
    }

    .menu-item {
        flex: 1 1 100%;
        min-width: 100%;
        padding: 0.625rem 0.75rem;
        font-size: 0.75rem;
    }

    .menu-icon {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

    .menu-label {
        font-size: 0.75rem;
        line-height: 1.3;
    }

    
    .post-template {
        padding: 1rem;
    }
    
    .post-template-header {
        gap: 0.75rem;
    }
    
    .post-template-avatar {
        width: 40px;
        height: 40px;
    }
    
    .post-template-username {
        font-size: 0.9rem;
    }
    
}

/* Styles pour les champs description */
.description-container {
    margin-top: 1rem;
}

/* Styles pour les utilisateurs identifiés */
.tagged-users-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

#tagged-users {
    display: flex;
}

.tagged-users-label {
    font-family: 'URW Form', sans-serif;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.tagged-users-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tagged-user-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.875rem;
}

.tagged-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.tagged-user-name {
    font-family: 'URW Form', sans-serif;
    color: #fff;
    font-weight: 500;
}

.tagged-user-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.tagged-user-remove:hover {
    color: #fff;
}

/* Styles pour le modal d'identification */
.tag-user-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.tag-user-modal-content {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tag-user-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-user-modal-header h3 {
    font-family: 'Brevia', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.tag-user-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.tag-user-modal-close:hover {
    color: #fff;
}

.tag-user-modal-body {
    padding: 1.5rem;
    position: relative;
}

.tag-user-search-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 90px;
    color: #fff;
    font-family: 'URW Form', sans-serif;
    font-size: 1rem;
    outline: none;
}

.tag-user-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.tag-user-search-input:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

/* Styles pour les suggestions d'utilisateurs */
.user-suggestions {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.user-suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-suggestion-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-suggestion-item:first-child {
    border-radius: 12px 12px 0 0;
}

.user-suggestion-item:last-child {
    border-radius: 0 0 12px 12px;
}

.user-suggestion-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-suggestion-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-suggestion-name {
    font-family: 'Brevia', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
}

.user-suggestion-username {
    font-family: 'URW Form', sans-serif;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Styles pour le modal Catégorie */
.category-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.category-modal-content {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.category-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.category-modal-header h3 {
    font-family: 'Brevia', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.category-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.category-modal-close:hover {
    color: #fff;
}

.category-modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
}

/* Styles pour les options de catégorie */
.category-option {
    padding: 0;
}

.category-radio-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.category-radio-label:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.category-radio-input {
    display: none;
}

.category-radio-custom {
    position: relative;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.category-radio-input:checked + .category-radio-custom {
    border-color: #A855F7;
    background: #A855F7;
}

.category-radio-input:checked + .category-radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
}

.category-radio-input:checked ~ .category-label-text .category-title {
    color: #A855F7;
}

.category-label-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.category-title {
    font-family: 'Brevia', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    transition: color 0.2s ease;
}

.category-description {
    font-family: 'URW Form', sans-serif;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* Mode Orange pour la catégorie sélectionnée */
body.mode-orange .category-radio-input:checked + .category-radio-custom {
    border-color: #FF6B35;
    background: #FF6B35;
}

body.mode-orange .category-radio-input:checked ~ .category-label-text .category-title {
    color: #FF6B35;
}

/* Responsive adjustments pour le modal Catégorie */
@media (max-width: 768px) {
    .category-modal-content {
        width: 95%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .category-modal-header {
        padding: 1.25rem;
    }
    
    .category-modal-body {
        padding: 1.25rem;
        gap: 0.875rem;
    }
    
    .category-radio-label {
        padding: 0.875rem;
    }
    
    .category-title {
        font-size: 0.9375rem;
    }
    
    .category-description {
        font-size: 0.8125rem;
    }
    
    .category-radio-custom {
        width: 22px;
        height: 22px;
    }
    
    .category-radio-input:checked + .category-radio-custom::after {
        width: 8px;
        height: 8px;
    }
}

/* Styles pour le modal Options */
.options-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.options-modal-content {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.options-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.options-modal-header h3 {
    font-family: 'Brevia', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.options-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.options-modal-close:hover {
    color: #fff;
}

.options-modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

/* Styles pour les options */
.option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.option-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.option-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.option-title {
    font-family: 'Brevia', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.option-description {
    font-family: 'URW Form', sans-serif;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* Toggle Switch pour les options */
.toggle-switch {
    position: relative;
    display: inline-block;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: relative;
    display: block;
    width: 56px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: background-color 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: transform 0.3s ease, background-color 0.3s ease;
    z-index: 1;
}

/* Toggle ON state */
.toggle-input:checked + .toggle-slider {
    background: linear-gradient(135deg, #FF6B35 0%, #8B5CF6 100%);
    border-color: rgba(255, 255, 255, 0.3);
}

.toggle-input:checked + .toggle-slider::before {
    transform: translateX(24px);
    background-color: #fff;
}

/* Responsive adjustments pour le modal Options */
@media (max-width: 768px) {
    .options-modal-content {
        width: 95%;
        max-width: 100%;
    }
    
    .option-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .toggle-switch {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .options-modal-header {
        padding: 1.25rem;
    }
    
    .options-modal-body {
        padding: 1.25rem;
        gap: 1.25rem;
    }
    
    .option-item {
        padding: 0.875rem;
    }
    
    .option-title {
        font-size: 0.9375rem;
    }
    
    .option-description {
        font-size: 0.8125rem;
    }
    
    .toggle-slider {
        width: 52px;
        height: 30px;
    }
    
    .toggle-slider::before {
        width: 22px;
        height: 22px;
        top: 4px;
        left: 4px;
    }
    
    .toggle-input:checked + .toggle-slider::before {
        transform: translateX(22px);
    }
}
