/* ============================================================
   CSS GLOBAL - FORMULAIRES DE PUBLICATION (Universel)
   Gère automatiquement les préfixes : sell-, buy-, location-, etc.
   ============================================================ */

/* 1. Conteneurs et Cartes */
[class$="-modal-container"] { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
[class$="-card"] { background: #fff; border-radius: 16px; }
[class$="-card-body"] { padding: 20px; }

/* 2. Profil Utilisateur */
[class$="-user-info"] { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding: 16px; background: #f9fafb; border-radius: 16px; }
[class$="-user-avatar"] { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; border: 2px solid #667eea; }
[class$="-user-avatar"] img { width: 100%; height: 100%; object-fit: cover; }
[class$="-user-details"] { flex: 1; }
[class$="-user-name"] { font-weight: 600; font-size: 15px; color: #1f2937; }
[class$="-user-visibility"] select { border: none; background: transparent; font-size: 13px; color: #6b7280; outline: none; }
[class$="-info-btn"] { background: #f3f4f6; border: none; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; color: #6b7280; }

/* 3. Étapes (Steps) */
[class$="-steps"] { display: flex; align-items: center; margin-bottom: 30px; padding: 0 10px; }
[class$="-step-item"] { display: flex; flex-direction: column; align-items: center; gap: 6px; }
[class$="-step-circle"] { width: 36px; height: 36px; border-radius: 50%; background: #f3f4f6; border: 2px solid #e5e7eb; display: flex; align-items: center; justify-content: center; font-weight: 600; color: #9ca3af; }
[class$="-step-item"].active [class$="-step-circle"] { background: linear-gradient(135deg, #667eea, #764ba2); border-color: #667eea; color: white; }
[class$="-step-item"].completed [class$="-step-circle"] { background: #10b981; border-color: #10b981; color: white; }
[class$="-step-label"] { font-size: 12px; color: #6b7280; }
[class$="-step-line"] { height: 2px; background: #e5e7eb; flex: 1; margin: 0 10px; }
[class$="-step-line"].completed { background: #667eea; }
[class$="-step-content"] { display: none; }
[class$="-step-content"].active { display: block; }

/* 4. Champs de formulaire */
[class$="-form-group"] { margin-bottom: 20px; }
[class$="-label"] { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; color: #374151; }
[class$="-required"] { color: #ef4444; }
[class$="-input"], [class$="-select"], [class$="-textarea"] { width: 100%; padding: 10px 14px; border: 1.5px solid #e5e7eb; border-radius: 12px; font-size: 14px; box-sizing: border-box; }
[class$="-input"]:focus, [class$="-select"]:focus, [class$="-textarea"]:focus { outline: none; border-color: #667eea; }
[class$="-textarea"] { resize: vertical; min-height: 90px; }
[class$="-row"] { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }

/* 5. Upload de médias */
[class$="-media-upload"] { border: 2px dashed #e5e7eb; border-radius: 16px; padding: 24px; text-align: center; cursor: pointer; background: #fafbfc; }
[class$="-media-upload"]:hover { border-color: #667eea; }
[class$="-media-upload"] p { margin: 0 0 4px; font-weight: 500; color: #374151; }
[class$="-media-upload"] small { color: #9ca3af; font-size: 12px; }
[class$="-file-input"] { display: none; }

/* 6. Liste des images en HORIZONTAL (Crucial pour l'affichage) */
[class$="-file-previews"] {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 12px 4px !important;
    margin-top: 16px !important;
    scroll-behavior: smooth;
}
[class$="-file-previews"]::-webkit-scrollbar { height: 6px; }
[class$="-file-previews"]::-webkit-scrollbar-thumb { background: #667eea; border-radius: 3px; }

[class$="-file-preview"] {
    flex: 0 0 120px !important;
    width: 120px !important;
    height: 120px !important;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s ease;
}
[class$="-file-preview"]:hover { transform: translateY(-4px); border-color: #667eea; box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25); }
[class$="-file-preview"] img, [class$="-file-preview"] video { width: 100%; height: 100%; object-fit: cover; }

/* 7. Infos fichier */
[class$="-file-info"] {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 6px 4px; color: white; font-size: 9px;
    display: flex; justify-content: space-between;
    z-index: 2;
}
[class$="-file-name"] { max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 8. Bouton suppression */
[class$="-file-preview-remove"] {
    position: absolute; top: 4px; right: 4px;
    background: rgba(0, 0, 0, 0.6); border: none; color: white;
    width: 22px; height: 22px; border-radius: 50%;
    cursor: pointer; font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
}
[class$="-file-preview-remove"]:hover { background: #ef4444; transform: scale(1.15); }

/* 9. Alertes */
[class$="-alert"] { padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; display: none; font-size: 14px; }
[class$="-alert"].show { display: block; }
[class$="-alert"].error { background: #fee2e2; color: #991b1b; }
[class$="-alert"].success { background: #d1fae5; color: #065f46; }

/* 10. Navigation (Boutons) */
[class$="-navigation"] { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid #e5e7eb; }
[class$="-btn"] { 
    padding: 10px 20px !important; 
    border: none; 
    border-radius: 30px !important; 
    font-size: 14px !important; 
    font-weight: 500 !important; 
    cursor: pointer; 
    text-align: center;
}
[class$="-btn-primary"] { background: linear-gradient(135deg, #667eea, #764ba2) !important; color: white !important; }
[class$="-btn-secondary"] { background: white !important; color: #6b7280 !important; border: 1.5px solid #e5e7eb !important; }
[class$="-btn-success"] { background: linear-gradient(135deg, #10b981, #059669) !important; color: white !important; }
[class$="-btn"]:disabled { opacity: 0.5 !important; cursor: not-allowed !important; }
[class$="-step-counter"] { font-size: 13px; color: #9ca3af; background: #f3f4f6; padding: 6px 14px; border-radius: 30px; }

/* ============================================================
   CORRECTIONS GLOBALES DE LA MODALE (Fond blanc opaque)
   ============================================================ */
.modal-content {
    background: #ffffff !important;
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-body {
    background: #ffffff;
    padding: 0;
}

/* ============================================================
   MODALE APERÇU IMAGE GRAND FORMAT
   ============================================================ */
.wisdak-image-modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 99999; align-items: center; justify-content: center; }
.wisdak-modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(4px); }
.wisdak-modal-content { position: relative; z-index: 2; max-width: 95vw; max-height: 95vh; display: flex; align-items: center; justify-content: center; }
.wisdak-modal-media { display: flex; align-items: center; justify-content: center; }
.wisdak-modal-close { position: absolute; top: -45px; right: 0; background: rgba(255,255,255,0.2); border: none; color: white; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 18px; font-weight: bold; }
.wisdak-modal-close:hover { background: rgba(255,255,255,0.4); }
.wisdak-modal-delete { position: absolute; top: -45px; left: 0; background: #ef4444; border: none; color: white; padding: 8px 16px; border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 600; }
.wisdak-modal-delete:hover { background: #dc2626; }

/* Responsive */
@media (max-width: 640px) { 
    [class$="-row"] { grid-template-columns: 1fr; } 
}