/* ==========================================
   ZENDURE SUGGESTIONS - CSS DÉDIÉ (COMPACT)
   ========================================== */

/* Reset et isolation CSS pour éviter les conflits */
#zendure-system {
    position: relative;
    max-width: 1000px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    clear: both;
    z-index: 1;
}

#zendure-system *,
#zendure-system *:before,
#zendure-system *:after {
    box-sizing: border-box;
}

/* Formulaires d'authentification */
#zendure-system .zendure-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #ddd;
    position: relative;
}

#zendure-system .zendure-tabs {
    display: flex;
    margin-bottom: 20px;
    border: none;
    background: none;
}

#zendure-system .zendure-tab {
    flex: 1;
    padding: 12px;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    text-align: center;
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 500;
}

#zendure-system .zendure-tab:first-child {
    border-radius: 6px 0 0 6px;
}

#zendure-system .zendure-tab:last-child {
    border-radius: 0 6px 6px 0;
}

#zendure-system .zendure-tab:hover {
    background: #f8f9fa;
}

#zendure-system .zendure-tab.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

/* Header principal */
#zendure-system .suggestions-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#zendure-system .suggestions-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: white;
    font-weight: 700;
}

#zendure-system .suggestions-header p {
    margin: 0 0 12px 0;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
}

#zendure-system .suggestions-header a {
    color: white;
    text-decoration: underline;
}

#zendure-system .suggestions-header a:hover {
    color: rgba(255,255,255,0.8);
}

/* Formulaires */
#zendure-system .form-group {
    margin-bottom: 15px;
}

#zendure-system .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #343a40;
    font-size: 13px;
}

#zendure-system .form-group input,
#zendure-system .form-group textarea,
#zendure-system .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

#zendure-system .form-group input:focus,
#zendure-system .form-group textarea:focus,
#zendure-system .form-group select:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

#zendure-system .form-group textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* Boutons */
#zendure-system .btn {
    display: inline-block;
    padding: 10px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    margin-right: 8px;
    font-family: inherit;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
}

#zendure-system .btn:hover {
    background: #0056b3;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

#zendure-system .btn:active {
    transform: translateY(0);
}

#zendure-system .btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#zendure-system .btn-cancel {
    background: #6c757d;
}

#zendure-system .btn-cancel:hover {
    background: #545b62;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

#zendure-system .btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    margin: 0 2px;
}

#zendure-system .form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Interface compacte pour les suggestions */
#zendure-system .suggestion-card.compact {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#zendure-system .suggestion-card.compact:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

#zendure-system .suggestion-header-row {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

#zendure-system .suggestion-info {
    flex: 1;
    min-width: 0;
}

#zendure-system .suggestion-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

#zendure-system .status-badge {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#zendure-system .status-nouveau { background: #fff3cd; color: #856404; }
#zendure-system .status-examine { background: #d1ecf1; color: #0c5460; }
#zendure-system .status-approuve { background: #d4edda; color: #155724; }
#zendure-system .status-rejete { background: #f8d7da; color: #721c24; }
#zendure-system .status-realise { background: #e2e3e5; color: #383d41; }

#zendure-system .category-badge {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#zendure-system .suggestion-title {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
    word-break: break-word;
}

#zendure-system .suggestion-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #6c757d;
    flex-wrap: wrap;
}

#zendure-system .suggestion-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Actions compactes */
#zendure-system .suggestion-actions {
    display: flex;
    gap: 4px;
    align-items: flex-start;
    flex-shrink: 0;
}

#zendure-system .vote-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    min-width: 50px;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

#zendure-system .vote-btn:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-1px);
}

#zendure-system .vote-btn:disabled,
#zendure-system .vote-btn.voted {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

#zendure-system .vote-count {
    font-size: 10px;
    margin-top: 2px;
}

#zendure-system .details-btn,
#zendure-system .edit-btn,
#zendure-system .delete-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
    font-family: inherit;
}

#zendure-system .details-btn:hover {
    background: #0056b3;
}

#zendure-system .edit-btn {
    background: #fd7e14;
}

#zendure-system .edit-btn:hover {
    background: #e86100;
}

#zendure-system .delete-btn {
    background: #dc3545;
}

#zendure-system .delete-btn:hover {
    background: #c82333;
}

#zendure-system .details-btn.active {
    background: #dc3545;
}

/* Section détails */
#zendure-system .suggestion-details {
    border-top: 1px solid #f0f0f0;
    padding: 15px;
    background: #f8f9fa;
    display: none;
}

#zendure-system .suggestion-description {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    line-height: 1.6;
    border-left: 3px solid #007cba;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#zendure-system .description-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#zendure-system .suggestion-description h4 {
    margin: 0;
    color: #212529;
    font-size: 16px;
    font-weight: 700;
}

#zendure-system .edit-description-form {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

/* Commentaires */
#zendure-system .comments-section {
    margin-top: 15px;
}

#zendure-system .comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

#zendure-system .comments-header h4 {
    margin: 0;
    color: #212529;
    font-size: 16px;
    font-weight: 700;
}

#zendure-system .add-comment-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
}

#zendure-system .add-comment-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

#zendure-system .comment-form {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    display: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#zendure-system .comment-form textarea {
    width: 100%;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    transition: border-color 0.2s;
}

#zendure-system .comment-form textarea:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

#zendure-system .comment-actions {
    display: flex;
    gap: 8px;
}

#zendure-system .comment-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

#zendure-system .comment-item:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#zendure-system .comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f8f9fa;
}

#zendure-system .comment-author-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

#zendure-system .comment-author {
    font-weight: 600;
    color: #007cba;
    font-size: 13px;
}

#zendure-system .comment-date {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
}

#zendure-system .comment-text {
    line-height: 1.5;
    color: #495057;
    font-size: 13px;
}

#zendure-system .delete-comment-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s;
}

#zendure-system .delete-comment-btn:hover {
    background: #c82333;
}

#zendure-system .edit-description-btn {
    background: #fd7e14;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
}

#zendure-system .edit-description-btn:hover {
    background: #e86100;
}

#zendure-system .save-edit-btn {
    background: #28a745;
}

#zendure-system .save-edit-btn:hover {
    background: #218838;
}

#zendure-system .cancel-edit-btn {
    background: #6c757d;
}

#zendure-system .cancel-edit-btn:hover {
    background: #545b62;
}

/* Messages */
#zendure-system .message {
    padding: 12px 15px;
    margin: 12px 0;
    border-radius: 6px;
    font-weight: 500;
    border-left: 3px solid;
    font-size: 14px;
}

#zendure-system .message.success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

#zendure-system .message.error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

#zendure-system .no-comments {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    background: white;
    border-radius: 6px;
    border: 1px dashed #dee2e6;
    font-size: 13px;
}

#zendure-system .no-suggestions {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    background: white;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
    font-size: 16px;
}

#zendure-system .loading {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    font-style: italic;
    font-size: 13px;
}

/* Classes utilitaires */
#zendure-system .hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    #zendure-system {
        margin: 10px;
    }
    
    #zendure-system .suggestion-header-row {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    
    #zendure-system .suggestion-actions {
        justify-content: center;
        width: 100%;
    }
    
    #zendure-system .suggestion-meta {
        flex-direction: column;
        gap: 4px;
    }
    
    #zendure-system .comments-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    #zendure-system .comment-actions {
        flex-direction: column;
    }
    
    #zendure-system .suggestions-header {
        padding: 15px;
        text-align: center;
    }
    
    #zendure-system .suggestions-header h2 {
        font-size: 20px;
    }
    
    #zendure-system .description-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    #zendure-system .zendure-tabs {
        flex-direction: column;
    }
    
    #zendure-system .zendure-tab:first-child,
    #zendure-system .zendure-tab:last-child {
        border-radius: 6px;
    }
    
    #zendure-system .suggestion-actions {
        flex-wrap: wrap;
    }
    
    #zendure-system .form-actions {
        flex-direction: column;
    }
}